CN107682282B - Service quality method and network equipment for guaranteeing service bandwidth - Google Patents

Service quality method and network equipment for guaranteeing service bandwidth Download PDF

Info

Publication number
CN107682282B
CN107682282B CN201710833948.9A CN201710833948A CN107682282B CN 107682282 B CN107682282 B CN 107682282B CN 201710833948 A CN201710833948 A CN 201710833948A CN 107682282 B CN107682282 B CN 107682282B
Authority
CN
China
Prior art keywords
htb
queue
bandwidth
current
state
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
CN201710833948.9A
Other languages
Chinese (zh)
Other versions
CN107682282A (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.)
Beijing Waitong Electronic Technology Co ltd
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Waitong Electronic Technology Co ltd
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software 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 Beijing Waitong Electronic Technology Co ltd, Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Waitong Electronic Technology Co ltd
Priority to CN201710833948.9A priority Critical patent/CN107682282B/en
Publication of CN107682282A publication Critical patent/CN107682282A/en
Application granted granted Critical
Publication of CN107682282B publication Critical patent/CN107682282B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/6215Individual queue per QOS, rate or priority
    • 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/215Flow control; Congestion control using token-bucket
    • 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/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2425Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
    • H04L47/2433Allocation of priorities to traffic types
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/52Queue scheduling by attributing bandwidth to queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority

Landscapes

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

Abstract

The invention discloses a service quality method and network equipment for guaranteeing service bandwidth, which are used for solving the problem that the flow of a high-priority HTB queue cannot obtain high-quality network service. The method comprises the following steps: acquiring an interface state of an interface; determining the queue state of each HTB queue according to the queue priority of each hierarchical token bucket HTB queue in the interface; and according to the interface state and the queue state of each HTB queue, carrying out enqueue and/or dequeue judgment on the data packet.

Description

Service quality method and network equipment for guaranteeing service bandwidth
Technical Field
The present invention relates to the field of network technologies, and in particular, to a method and a network device for guaranteeing service quality of service bandwidth.
Background
QoS (Quality of Service) refers to a network that can provide better Service capability for specified network communication by using various basic technologies, and is a security mechanism for the network to solve the problems of network delay and congestion.
At present, an HTB (hierarchical Token Bucket) algorithm is adopted to realize a dequeue process of QoS, but the existing HTB algorithm causes that the rate is greater than the interface bandwidth when the HTB is dequeued, which causes network card uncertainty to lose packets, and the lost packets may be data packets of a high-priority HTB queue or data packets of a low-priority HTB queue, so that the traffic of the high-priority HTB queue cannot obtain high-quality network service.
Disclosure of Invention
In order to overcome the above-mentioned drawbacks, the technical problem to be solved by the present invention is to provide a quality of service method and a network device for guaranteeing service bandwidth, so as to solve the problem that the traffic of the high priority HTB queue cannot obtain high quality network service.
In order to solve the above technical problem, a method for guaranteeing service quality of service bandwidth in the present invention includes:
acquiring an interface state of an interface;
determining the queue state of each HTB queue according to the queue priority of each hierarchical token bucket HTB queue in the interface;
and according to the interface state and the queue state of each HTB queue, carrying out enqueue and/or dequeue judgment on the data packet.
In order to solve the above technical problem, a network device in the present invention includes a memory and a processor; the memory stores a quality of service computer program of guaranteed traffic bandwidth, which the processor executes to implement the steps of the method as above.
The invention has the following beneficial effects:
according to the method and the network equipment, the interface state of the interface is obtained, the queue state of each HTB queue is determined according to the queue priority of each hierarchical token bucket HTB queue in the interface, and the enqueue and/or dequeue judgment of the data packet is carried out according to the interface state and the queue state of each HTB queue, so that the sum of the guaranteed bandwidths of all HTB queues under the configurable interface is allowed to be larger than the interface bandwidth, the guaranteed bandwidth with high priority can be preferentially guaranteed when all HTB queues have flow and the total flow is larger than the interface bandwidth, the guaranteed bandwidth with low priority is abandoned, the defect of uncertain packet loss of standard Qos under the condition is overcome, and high-quality network service is effectively provided for the flow with high priority.
Drawings
Fig. 1 is a flowchart of a method for guaranteeing quality of service bandwidth according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of data organization in an embodiment of the invention;
fig. 3 is a flowchart of a method for optionally guaranteeing quality of service bandwidth according to an embodiment of the present invention;
FIG. 4 is a flow chart of packet enqueuing in an embodiment of the present invention;
FIG. 5 is a flow chart of the status update of the mirror class in the embodiment of the present invention;
fig. 6 is a flow chart of dequeuing a data packet in an embodiment of the invention.
Detailed Description
In order to solve the problems in the prior art, the present invention provides a method for guaranteeing quality of service bandwidth and a network device, and the following describes the present invention in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
The use of prefixes such as "first," "second," etc. to distinguish between elements is merely intended to facilitate the description of the invention and has no particular meaning in and of themselves.
Example one
As shown in fig. 1, an embodiment of the present invention provides a method for guaranteeing quality of service of a service bandwidth, where the method includes:
s11, acquiring the interface state of the interface;
s12, determining the queue state of each HTB queue according to the queue priority of each hierarchical token bucket HTB queue in the interface;
and S13, according to the interface state and the queue state of each HTB queue, determining the enqueue and/or the dequeue of the data packet.
According to the embodiment of the invention, the interface state of the interface is obtained, the queue state of each HTB queue is determined according to the queue priority of each hierarchical token bucket HTB queue in the interface, and the enqueue and/or dequeue judgment of the data packet is carried out according to the interface state and the queue state of each HTB queue, so that the sum of the guaranteed bandwidths of all HTB queues under the interface is allowed to be configured to be larger than the interface bandwidth, the guaranteed bandwidth of high priority can be preferentially guaranteed, the guaranteed bandwidth of low priority can be abandoned when all HTB queues have flow and the total flow is larger than the interface bandwidth, the defect of uncertain packet loss of standard Qos under the condition is overcome, and high-quality network service is effectively provided for the flow of high priority.
On the basis of the above embodiment, a modification of the above embodiment is further proposed.
In this embodiment of the present invention, optionally, the determining, according to the queue priority of each hierarchical token bucket HTB queue in the interface, the queue state of each HTB queue includes:
determining the current accumulated bandwidth according to the priority of each queue; and/or
Obtaining the guaranteed bandwidth of each HTB queue; and/or
And acquiring the real-time bandwidth of each HTB queue.
Wherein, the determining the current accumulated bandwidth according to the priority of each queue includes:
accumulating the guaranteed bandwidth of each HTB queue according to the priority of each queue and the sequence of the priority from high to low;
when the current HTB queue is accumulated, the sum of the guaranteed bandwidths of the current accumulated HTB queue is the current accumulated bandwidth. Wherein, in the accumulation process, the guaranteed bandwidth of the HTB queue without traffic is not accumulated.
Wherein the interface state comprises an interface bandwidth and a residual bandwidth;
the determining of enqueuing and/or dequeuing of the data packet according to the interface state and the queue state of each HTB queue includes:
judging whether the current accumulated bandwidth is larger than the interface bandwidth or not;
when the residual bandwidth is larger than the guaranteed bandwidth of the current HTB queue, determining whether the residual bandwidth meets the guaranteed bandwidth of the current HTB queue;
if so, allowing the data packet to be enqueued from the current HTB queue, and/or allowing the data packet of the current HTB queue to be dequeued.
Further, after determining whether the remaining bandwidth meets the guaranteed bandwidth of the current HTB queue when the remaining bandwidth is greater than the guaranteed bandwidth, the method further includes:
if not, judging whether the real-time bandwidth of the current HTB queue is larger than the residual bandwidth of the interface or not;
and when the data packet is not larger than the threshold value, allowing the data packet to be enqueued from the current HTB queue, and/or allowing the data packet of the current HTB queue to be dequeued.
Wherein the HTB queue is implemented by an HTB class. That is, a packet is enqueued from the root node of the global offer tree, and a leaf node is dequeued, where each node is an HTB class, and when a deactivation operation is performed on the HTB class of a leaf node, the leaf node is to be taken off the global offer tree, and when an activation operation is performed on the HTB class of a leaf node, the leaf node is to be hung on the global offer tree.
Examples of the present invention are illustrated.
For example, the implementation process of the enqueuing judgment comprises the following steps:
step 101, acquiring interface bandwidth of an interface;
102, acquiring the residual bandwidth of the interface (subtracting the currently actually used bandwidth from the total bandwidth of the interface) in real time;
103, acquiring the guaranteed bandwidth of each HTB type;
step 104, acquiring the real-time bandwidth of each HTB class (the bandwidth actually used by each HTB class currently);
step 105, associating a priority for each HTB type;
and 106, when a data packet is enqueued, accumulating the guaranteed bandwidth of each HTB type according to the sequence of the priority from high to low, wherein when one HTB type is accumulated:
comparing whether the sum of the currently accumulated bandwidths is less than or equal to the interface bandwidth, if so, allowing the data packet of the current HTB type to be enqueued, if so, further judging whether the residual bandwidth of the current interface meets the guaranteed bandwidth of the current type, if so, allowing the data packet of the current HTB type to be enqueued, if not, continuously judging whether the real-time bandwidth of the current HTB type is greater than the residual bandwidth of the current interface, if so, forbidding the data packet of the current HTB type to be enqueued, and if not, allowing the data packet of the current HTB type to be enqueued.
As another example, the dequeue determination may be performed by:
step 201, acquiring interface bandwidth of an interface;
step 202, acquiring the residual bandwidth of the interface (subtracting the currently actually used bandwidth from the total bandwidth of the interface) in real time;
step 203, acquiring the guaranteed bandwidth of each HTB type;
step 204, acquiring the real-time bandwidth of each HTB class (the bandwidth actually used by each HTB class currently);
step 205, associating a priority for each HTB class;
and step 206, when a data packet is dequeued, accumulating the guaranteed bandwidth of each HTB type according to the sequence of the priority from high to low, and accumulating the guaranteed bandwidth to the current HTB type:
and comparing whether the sum of the currently accumulated bandwidths is less than or equal to the interface bandwidth, if so, allowing the dequeue of the data packet of the current HTB type, if so, further judging whether the residual bandwidth of the current interface meets the guaranteed bandwidth of the current type, if so, allowing the dequeue of the data packet of the current HTB type, if not, continuously judging whether the real-time bandwidth of the current HTB type is greater than the residual bandwidth of the current interface, if so, forbidding the dequeue of the data packet of the current HTB type, and if not, allowing the dequeue of the data packet of the current HTB type.
Further, the method further comprises:
respectively creating mirror image HTB classes for the HTB classes corresponding to the HTB queues;
associating the queue priority for each mirror HTB class;
determining the current accumulated bandwidth according to the queue priority of each mirror image HTB type; and/or
Obtaining the guaranteed bandwidth of each HTB queue through each mirror image HTB type; and/or
And acquiring the real-time bandwidth of each HTB queue through each mirror image HTB type.
Before allowing the data packet to be enqueued from the current HTB queue and/or allowing the data packet of the current HTB queue to be dequeued, the method further comprises:
and marking the state of the HTB class corresponding to the current HTB queue as an activated state.
Further, the allowing the data packet to be enqueued from the current HTB queue includes:
when a data packet is ready to be enqueued, refreshing the state of the HTB class corresponding to the current HTB queue;
and when the refreshed state is the active state, allowing the data packet to be enqueued from the current HTB queue.
Further, the allowing dequeues of packets of the current HTB queue includes:
when a data packet in the current HTB queue is ready to be dequeued, refreshing the state of the HTB class corresponding to the current HTB queue;
and when the refreshed state is the active state, allowing the data packet to be dequeued from the current HTB queue.
For example, by creating a mirror image for each HTB class, the simultaneous determination of enqueuing and dequeuing of data packets is achieved, which specifically comprises the following steps:
301, acquiring interface bandwidth of an interface;
step 302, acquiring the residual bandwidth of the interface (subtracting the currently actually used bandwidth from the total bandwidth of the interface) in real time;
303, acquiring the guaranteed bandwidth of each HTB type;
step 304, acquiring the real-time bandwidth of each HTB class (the bandwidth actually used by each HTB class currently);
step 305, creating a mirror image for each HTB type, and associating priority for the mirror image;
and 306, accumulating the guaranteed bandwidth of each HTB mirror class according to the sequence of the priority from high to low, wherein each HTB mirror class is accumulated:
comparing whether the sum of the currently accumulated bandwidths is less than the interface bandwidth, if so, marking the current HTB mirror class as an activated state (the state of not changing the HTB class), if so, further judging whether the residual bandwidth of the current interface meets the guaranteed bandwidth of the current HTB mirror class, if so, marking the current HTB mirror class as an activated state (the state of not changing the HTB class), if not, continuously judging whether the real-time bandwidth of the current HTB mirror class is more than the residual bandwidth of the current interface, if so, deactivating the current HTB mirror class (the state of not changing the HTB class), and if not, marking the current HTB mirror class as an activated state (the state of not changing the HTB class);
step 307, when a data packet is enqueued, refreshing the activation state of each current HTB mirror class, judging whether the HTB mirror class corresponding to the data packet to be enqueued is in the activation state, if so, allowing the data packet to be enqueued, and if not, forbidding the data packet to be enqueued;
and 308, when a data packet is dequeued, judging whether the HTB mirror class corresponding to the data packet to be dequeued is in an activated state according to the activated state of each current HTB mirror class, if so, allowing the data packet to be dequeued, and if not, forbidding the data packet to be dequeued.
Specifically, the data, data structure, and algorithm related to the mirror class scheme are as follows:
1. data:
(1) interface bandwidth of the interface.
(2) Guaranteed bandwidth of configured HTB class.
(3) Configured real-time rate (i.e., real-time bandwidth) of HTB class.
(4) Priority of configured HTB classes.
For the interface bandwidth, a bit of member can be added into a struct net _ device structure in a Linux kernel as bandwidth, and then the application layer command line can configure the interface bandwidth, so that the interface bandwidth data can be acquired.
The guaranteed bandwidth and priority for HTB classes can both be obtained during the configuration of HTB classes.
For the real-time rate of the HTB class, it can be obtained in the kernel data HTB _ class- > rate _ eat of the HTB class.
2. Data structure:
as shown in fig. 2, the data structure implemented is as follows:
(1) interface information unit, manage HTB mirror image class under each interface:
Figure BDA0001409348630000081
(2) management linked lists of HTB mirror classes of different priorities under each interface:
struct list _ head class _ PRIO [ INTERFACE _ NUM ] [ PRIO _ NUM ]; // 8 priority lists under each interface
(3) Mirror class data structure: (the mirror here is a mirror image of the HTB class, extracting the required information from the corresponding HTB class)
Figure BDA0001409348630000082
Figure BDA0001409348630000091
The data is organized as follows:
(1) when qdisc (queuing rule for QoS) for QoS is configured, member information can be populated in the kernel for members of interface _ class _ ptr.
(2) When configuring the HTB type, dynamically applying for the mirror image class _ estimators of each configured HTB type in the kernel, copying information of the HTB type, finding the qdisc of the HTB type according to the parent ID of the HTB type to obtain the information of the interface where the HTB type is located, and finally hanging the HTB type under the linked list corresponding to the priority under the interface _ class _ ptr according to the priority of the HTB type.
After the required data is obtained, a layer of filtering is performed on the enqueue or dequeue of the data packet, and the specific implementation steps are as follows:
as shown in fig. 3, the enqueue judgment and dequeue judgment are filter layers added in enqueue and dequeue of a data packet of Qdisc (queuing rule) of the HTB type, and for the filter layer for enqueue of the data packet, the added point is located in an enqueue function HTB _ enqueue (struct sk _ buff _ skb, struct Qdisc _ sch) of Qdisc of the HTB type, and the filter layer is called Qdisc _ enqueue (skb, cl- > un.leaf.q)) when enqueue is performed in the function; the function realized in the embodiment of the invention is htb _ hoop _ enqueue (struct htb _ class cl, struct sk _ buff _ skb, struct Qdisc) and the function is shown in the specification; replacing a calling point of a qdisc _ enqueue function in HTB _ enqueue by using HTB _ chose _ enqueue (cl, skb, sch)), so as to add a layer of filtering before enqueue, wherein the filtering principle is that the activation states of all mirror classes are updated before enqueue of a data packet, then whether the corresponding mirror class of an HTB class to be enqueued is the activation state is checked, if the corresponding mirror class is the activation state, normal enqueue is allowed, otherwise, the HTB class is deactivated, and the data packet is discarded under a global provided tree digest of an HTB scheduler, as shown in FIG. 4, the HTB _ chose _ enqueue function filtering flow.
The key processing flow is a class _ fork () function, the function is realized by preferentially ensuring the guaranteed bandwidth of a high-priority class and automatically giving up the guaranteed bandwidth of a low-priority class according to the interface bandwidth, if the real-time bandwidth of the interface has surplus and meets the real-time bandwidth requirement of the low priority under the premise of ensuring high-priority and high-quality transmission, the low priority can also transmit a data packet under the real-time surplus bandwidth of the interface, and when the high-priority flow is very large, the low-priority flow is given up to ensure high-quality transmission of the high-priority data. As shown in fig. 5, the flow of implementing the class _ school () function is accomplished by activating or deactivating the flag of the corresponding mirror class _ estimator of the HTB class to be enqueued.
For the filter layer for dequeuing the data packet, as shown in fig. 6, the added point is located in the HTB _ queue _ tree () function, and the filtering principle is to determine whether the mirror class corresponding to the leaf node is activated or not before dequeuing the data packet, and if activated, dequeuing is performed normally, otherwise, dequeuing is not performed, returning to NULL, and allowing the HTB scheduler to select other activated leaf nodes to dequeue, so as to provide high-quality service for the high-priority leaf nodes.
Example two
The embodiment of the invention provides network equipment, which comprises a memory and a processor; the memory stores a quality of service computer program of guaranteed traffic bandwidth, which is executed by the processor to implement the steps of the method according to any of the embodiments.
According to the embodiment of the invention, the interface state of the interface is obtained, the queue state of each HTB queue is determined according to the queue priority of each hierarchical token bucket HTB queue in the interface, and the enqueue and/or dequeue judgment of the data packet is carried out according to the interface state and the queue state of each HTB queue, so that the sum of the guaranteed bandwidths of all HTB queues under the interface is allowed to be configured to be larger than the interface bandwidth, the guaranteed bandwidth of high priority can be preferentially guaranteed, the guaranteed bandwidth of low priority can be abandoned when all HTB queues have flow and the total flow is larger than the interface bandwidth, the defect of uncertain packet loss of standard Qos under the condition is overcome, and high-quality network service is effectively provided for the flow of high priority.
In detail, the processor executes the computer program to realize the steps of:
acquiring an interface state of an interface;
determining the queue state of each HTB queue according to the queue priority of each hierarchical token bucket HTB queue in the interface;
and according to the interface state and the queue state of each HTB queue, carrying out enqueue and/or dequeue judgment on the data packet.
Optionally, the determining the queue state of each HTB queue according to the queue priority of each hierarchical token bucket HTB queue in the interface includes:
determining the current accumulated bandwidth according to the priority of each queue; and/or
Obtaining the guaranteed bandwidth of each HTB queue; and/or
And acquiring the real-time bandwidth of each HTB queue.
Wherein, the determining the current accumulated bandwidth according to the priority of each queue includes:
and accumulating the guaranteed bandwidth of each HTB queue according to the priority of each queue and the sequence of the priority from high to low. Wherein, in the accumulation process, the guaranteed bandwidth of the HTB queue without traffic is not accumulated.
And when the current HTB queue is accumulated, the sum of the guaranteed bandwidths of the current accumulated HTB queue is the current accumulated bandwidth.
Wherein the interface state comprises an interface bandwidth and a residual bandwidth;
further, the determining enqueuing and/or dequeuing of the data packet according to the interface state and the queue state of each HTB queue includes:
judging whether the current accumulated bandwidth is larger than the interface bandwidth or not;
when the residual bandwidth is larger than the guaranteed bandwidth of the current HTB queue, determining whether the residual bandwidth meets the guaranteed bandwidth of the current HTB queue;
if so, allowing the data packet to be enqueued from the current HTB queue, and/or allowing the data packet of the current HTB queue to be dequeued.
When the remaining bandwidth is greater than the guaranteed bandwidth of the current HTB queue, after determining whether the remaining bandwidth meets the guaranteed bandwidth of the current HTB queue, the method further includes:
if not, judging whether the real-time bandwidth of the current HTB queue is larger than the residual bandwidth of the interface or not;
and when the data packet is not larger than the threshold value, allowing the data packet to be enqueued from the current HTB queue, and/or allowing the data packet of the current HTB queue to be dequeued.
Wherein the HTB queue is realized by adopting an HTB type;
the determining the queue state of each HTB queue according to the queue priority of each hierarchical token bucket HTB queue in the interface further comprises:
respectively creating mirror image HTB classes for the HTB classes corresponding to the HTB queues;
associating the queue priority for each mirror HTB class;
determining the current accumulated bandwidth according to the queue priority of each mirror image HTB type; and/or
Obtaining the guaranteed bandwidth of each HTB queue through each mirror image HTB type; and/or
And acquiring the real-time bandwidth of each HTB queue through each mirror image HTB type.
Further, before allowing the data packet to be enqueued from the current HTB queue and/or allowing the data packet of the current HTB queue to be dequeued, the method further includes:
and marking the state of the HTB class corresponding to the current HTB queue as an activated state.
Wherein the allowing the data packet to enqueue from the current HTB queue comprises:
when a data packet is ready to be enqueued, refreshing the state of the HTB class corresponding to the current HTB queue;
and when the refreshed state is the active state, allowing the data packet to be enqueued from the current HTB queue.
Wherein the allowing dequeues of packets from the current HTB queue comprises:
when a data packet in the current HTB queue is ready to be dequeued, refreshing the state of the HTB class corresponding to the current HTB queue;
and when the refreshed state is the active state, allowing the data packet to be dequeued from the current HTB queue.
The embodiment of the invention can be realized by referring to the first embodiment and has the technical effects in the embodiments.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (8)

1. A method for guaranteeing service quality of service bandwidth, the method comprising:
acquiring an interface state of an interface;
determining the queue state of each HTB queue according to the queue priority of each hierarchical token bucket HTB queue in the interface;
according to the interface state and the queue state of each HTB queue, carrying out enqueue and/or dequeue judgment on the data packet;
determining a queue state of each HTB queue according to the queue priority of each hierarchical token bucket HTB queue in the interface, including:
determining the current accumulated bandwidth according to the priority of each queue; and/or
Obtaining the guaranteed bandwidth of each HTB queue; and/or
Acquiring real-time bandwidth of each HTB queue;
the interface state comprises an interface bandwidth and a residual bandwidth;
the determining of enqueuing and/or dequeuing of the data packet according to the interface state and the queue state of each HTB queue includes:
judging whether the current accumulated bandwidth is larger than the interface bandwidth or not;
when the residual bandwidth is larger than the guaranteed bandwidth of the current HTB queue, determining whether the residual bandwidth meets the guaranteed bandwidth of the current HTB queue; if so, allowing the data packet to be enqueued from the current HTB queue, and/or allowing the data packet of the current HTB queue to be dequeued.
2. The method of claim 1, wherein determining a current accumulated bandwidth based on the respective queue priorities comprises:
accumulating the guaranteed bandwidth of each HTB queue according to the priority of each queue and the sequence of the priority from high to low;
when the current HTB queue is accumulated, the sum of the guaranteed bandwidths of the current accumulated HTB queue is the current accumulated bandwidth.
3. The method of claim 1, wherein after determining whether the remaining bandwidth satisfies the guaranteed bandwidth of the current HTB queue when greater than, further comprising:
if not, judging whether the real-time bandwidth of the current HTB queue is larger than the residual bandwidth of the interface or not;
and when the data packet is not larger than the threshold value, allowing the data packet to be enqueued from the current HTB queue, and/or allowing the data packet of the current HTB queue to be dequeued.
4. The method of claim 3, wherein the HTB queue is implemented using an HTB class; the method further comprises the following steps:
respectively creating mirror image HTB classes for the HTB classes corresponding to the HTB queues;
associating the queue priority for each mirror HTB class;
determining the current accumulated bandwidth according to the queue priority of each mirror image HTB type; and/or
Obtaining the guaranteed bandwidth of each HTB queue through each mirror image HTB type; and/or
And acquiring the real-time bandwidth of each HTB queue through each mirror image HTB type.
5. The method of claim 4, wherein prior to allowing enqueuing of packets from a current HTB queue and/or allowing dequeuing of packets from a current HTB queue, further comprising:
and marking the state of the HTB class corresponding to the current HTB queue as an activated state.
6. The method of claim 5, wherein the allowing the data packet to enqueue from the current HTB queue comprises:
when a data packet is ready to be enqueued, refreshing the state of the HTB class corresponding to the current HTB queue;
and when the refreshed state is the active state, allowing the data packet to be enqueued from the current HTB queue.
7. The method of claim 5, wherein said allowing dequeues of packets from a current HTB queue comprises:
when a data packet in the current HTB queue is ready to be dequeued, refreshing the state of the HTB class corresponding to the current HTB queue;
and when the refreshed state is the active state, allowing the data packet to be dequeued from the current HTB queue.
8. A network device, comprising a memory and a processor; the memory stores a quality of service computer program of guaranteed traffic bandwidth, which is executed by the processor to implement the steps of the method of any of claims 1-7.
CN201710833948.9A 2017-09-15 2017-09-15 Service quality method and network equipment for guaranteeing service bandwidth Active CN107682282B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710833948.9A CN107682282B (en) 2017-09-15 2017-09-15 Service quality method and network equipment for guaranteeing service bandwidth

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710833948.9A CN107682282B (en) 2017-09-15 2017-09-15 Service quality method and network equipment for guaranteeing service bandwidth

Publications (2)

Publication Number Publication Date
CN107682282A CN107682282A (en) 2018-02-09
CN107682282B true CN107682282B (en) 2021-04-06

Family

ID=61137104

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710833948.9A Active CN107682282B (en) 2017-09-15 2017-09-15 Service quality method and network equipment for guaranteeing service bandwidth

Country Status (1)

Country Link
CN (1) CN107682282B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113328957B (en) * 2021-05-18 2023-05-23 深圳Tcl新技术有限公司 Flow control method and device and electronic equipment
CN113285886B (en) * 2021-06-11 2021-10-15 北京天融信网络安全技术有限公司 Bandwidth allocation method and device, electronic equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611924A (en) * 2012-03-02 2012-07-25 何震宇 Flow control method and system of video cloud platform
CN103346976A (en) * 2013-07-10 2013-10-09 深圳市磊科实业有限公司 Bandwidth fair control method based on HTB and achieving system thereof
CN106533982A (en) * 2016-11-14 2017-03-22 西安电子科技大学 Dynamic queue scheduling device and method based on bandwidth borrowing
CN106789721A (en) * 2017-03-24 2017-05-31 深圳市吉祥腾达科技有限公司 A kind of intelligent QOS method and system based on token bucket

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8238346B2 (en) * 2009-07-09 2012-08-07 The Boeing Company Queuing architectures for orthogonal requirements in quality of service (QoS)

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611924A (en) * 2012-03-02 2012-07-25 何震宇 Flow control method and system of video cloud platform
CN103346976A (en) * 2013-07-10 2013-10-09 深圳市磊科实业有限公司 Bandwidth fair control method based on HTB and achieving system thereof
CN106533982A (en) * 2016-11-14 2017-03-22 西安电子科技大学 Dynamic queue scheduling device and method based on bandwidth borrowing
CN106789721A (en) * 2017-03-24 2017-05-31 深圳市吉祥腾达科技有限公司 A kind of intelligent QOS method and system based on token bucket

Also Published As

Publication number Publication date
CN107682282A (en) 2018-02-09

Similar Documents

Publication Publication Date Title
US10326713B2 (en) Data enqueuing method, data dequeuing method, and queue management circuit
EP1774714B1 (en) Hierarchal scheduler with multiple scheduling lanes
KR101468833B1 (en) Hierarchical profiled scheduling and shaping
CN107959636B (en) Method and device for sending BGP (Border gateway protocol) message
EP2466824B1 (en) Service scheduling method and device
US8149708B2 (en) Dynamically switching streams of packets among dedicated and shared queues
CN106789721B (en) Intelligent QOS method and system based on token bucket
US10425347B2 (en) Scheduling of packets in network devices
US8144588B1 (en) Scalable resource management in distributed environment
EP3588880B1 (en) Method, device, and computer program for predicting packet lifetime in a computing device
US20050068798A1 (en) Committed access rate (CAR) system architecture
US20070140282A1 (en) Managing on-chip queues in switched fabric networks
CN109391555B (en) Message scheduling method and device and communication equipment
CN107682282B (en) Service quality method and network equipment for guaranteeing service bandwidth
CN112968845B (en) Bandwidth management method, device, equipment and machine-readable storage medium
US7385987B1 (en) Scheduling system and method for multi-level class hierarchy
CN111638986A (en) QoS queue scheduling method, device, system and readable storage medium
CN107005487B (en) System and method for supporting efficient Virtual Output Queue (VOQ) resource utilization in networked devices
CN113765796A (en) Flow forwarding control method and device
CN113572705A (en) High-speed network active queue scheduling method based on controllable time delay
CN111277513B (en) PQ queue capacity expansion realization method, device, equipment and storage medium
CN112311678B (en) Method and device for realizing message distribution
Lee et al. Delay analysis of an M/G/1/K priority queueing system with push-out scheme
KR100757194B1 (en) A Fair Packet Scheduling Method with a High Resource Utilization and Low Implementation Complexity
Amaradasa et al. Accelerated simulation of a GPS scheduler using traffic aggregation

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