CN113938439B - Port queue scheduling method based on timer and electronic equipment - Google Patents

Port queue scheduling method based on timer and electronic equipment Download PDF

Info

Publication number
CN113938439B
CN113938439B CN202111238259.6A CN202111238259A CN113938439B CN 113938439 B CN113938439 B CN 113938439B CN 202111238259 A CN202111238259 A CN 202111238259A CN 113938439 B CN113938439 B CN 113938439B
Authority
CN
China
Prior art keywords
queue
timer
token
scheduling
tokens
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
CN202111238259.6A
Other languages
Chinese (zh)
Other versions
CN113938439A (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.)
Shenzhen Forward Industrial Co Ltd
Original Assignee
Shenzhen Forward Industrial 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 Shenzhen Forward Industrial Co Ltd filed Critical Shenzhen Forward Industrial Co Ltd
Priority to CN202111238259.6A priority Critical patent/CN113938439B/en
Publication of CN113938439A publication Critical patent/CN113938439A/en
Application granted granted Critical
Publication of CN113938439B publication Critical patent/CN113938439B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/6295Queue scheduling characterised by scheduling criteria using multiple queues, one for each individual QoS, connection, flow 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/50Queue scheduling
    • H04L47/56Queue scheduling implementing delay-aware scheduling
    • H04L47/562Attaching a time tag to queues

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 port queue scheduling method and electronic equipment based on a timer, wherein the method comprises the steps of sending a message to a port, and confirming the type of the message entering a queue based on priority distribution; initializing a timer according to the instant value of the last time of running the timer mechanism; based on the order of the queue types, port queues are scheduled through a timer to supplement tokens; scheduling message enqueues and dequeues based on the queue type of the message and the scheduled token; in the dequeuing process, nodes in the queue linked list are circularly scheduled, and the queues are dequeued according to the weight ratio, so that port queue scheduling is completed. The invention provides queuing mechanisms of different types for each port, thereby realizing more accurate dequeuing and enqueuing scheduling and token supplementing scheduling and improving the service quality scheduling performance of the network equipment; through the cooperation of the timer and various queues, the requirements of the flow mixing aspect required by the converged network are ensured.

Description

Port queue scheduling method based on timer and electronic equipment
Technical Field
The invention relates to the technical field of data network communication, in particular to a port queue scheduling method based on a timer and electronic equipment.
Background
Among all mechanisms of the QoS toolset, congestion management tools provide the most important role at the application service level. Congestion management tools, i.e. queuing tools. During the time when the outgoing interface is congested with traffic, packets accumulated on one interface are queued up using the congestion management function, and based on the priority assigned to the packets and the queuing mechanism configured for that interface, the packets can be sent out in a scheduled order.
Single queuing mechanisms have serious drawbacks in handling the traffic mix required for converged networks, either by handling data fairly or by prioritizing real-time applications such as voice, and not efficiently handling both types of traffic. The congestion management QoS function provides several types of queuing protocols, including PQ, WFQ, and LPQ, each of which can specify the creation of an unequal number of queues, and can provide a certain degree of variability in traffic and the sending order of traffic, but cannot guarantee the requirements in terms of traffic mixing required by the converged network.
Disclosure of Invention
Aiming at the defects in the prior art, the port queue scheduling method based on the timer and the electronic equipment provided by the invention solve the problem that the prior art cannot guarantee the requirements of flow mixing required by a converged network.
In order to achieve the aim of the invention, the invention adopts the following technical scheme:
the port queue scheduling method based on the timer comprises the following steps:
s1, sending a message to a port, and confirming the type of the message entering a queue based on priority distribution;
s2, initializing a timer based on an instant value according to a timer mechanism operated last time;
s3, based on the sequence of the queue types, replenishing tokens through a timer scheduling port queue;
s4, arranging message enqueuing and dequeuing based on the queue type of the message and the scheduled token;
and S5, in the dequeuing process, circularly scheduling nodes in the queue linked list, dequeuing the queues according to the weight ratio, and completing port queue scheduling.
Further, the specific method of step S2 is as follows:
s2-1, dividing a timer into five levels, wherein the first level distributes 256 token buckets according to 1 time unit, and the second level to the fifth level distribute 64 token buckets;
s2-2, hanging the timer on a timer linked list of a first stage according to the position of a token bucket corresponding to the 8-bit binary low instantaneous value of the timer mechanism operated last time, so as to obtain the timer linked list of the first stage;
according to the position of the token bucket corresponding to the 9 th bit to the 14 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a timer linked list of a second stage to obtain a timer linked list of the second stage;
according to the position of the token bucket corresponding to the 15 th bit to the 20 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a timer linked list of a third stage to obtain the timer linked list of the third stage;
according to the position of the token bucket corresponding to the 21 st bit to the 26 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a fourth-stage timer linked list to obtain a fourth-stage timer linked list;
and according to the corresponding token bucket position from the 27 th bit to the 32 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a timer linked list of a fifth stage to obtain the timer linked list of the fifth stage, and finishing initialization.
Further, the specific method of step S3 is as follows:
s3-1, updating PIR requirements of a PQ queue when a timer dispatches to a token bucket subordinate to a certain port;
s3-2, obtaining the shaping rate of the PQ queue, calculating an update interval, and calculating the number of tokens updated by the PQ queue each time through the update interval;
s3-3, calculating the token bucket depth of the PQ queue according to the maximum transmission unit of the port; wherein the token bucket depth of the PQ queue is not less than 2 times of the number of updated tokens at a time;
s3-4, judging whether the number of tokens in the PQ queue is smaller than the token bucket depth of the PQ queue, if so, calculating the difference value of the number of tokens in the PQ queue and the token bucket depth as a token to be supplemented by the PQ queue, and entering a step S3-5; otherwise, not supplementing the token, and entering a step S3-6;
s3-5, judging whether the number of tokens to be supplemented is larger than the number of the remaining tokens updated at the time of the port, if so, using all the remaining tokens for supplementing the PQ queue, ending the scheduling of the port queue at the time, and waiting for the next scheduling of the timer; otherwise, the PQ queue token is supplemented, the quantity supplemented at the time is subtracted from the rest token updated at the time of the port, and the step S3-6 is carried out;
s3-6, judging whether residual tokens exist, if yes, counting the number and total weight of WFQ queues needing to be added with the tokens, and entering a step S3-7; otherwise, waiting for the next token scheduling of the timer;
s3-7, calculating the token bucket depth of the current WFQ queue, judging whether the number of tokens in the current WFQ queue is smaller than the token bucket depth of the WFQ queue, if so, calculating the difference value of the token bucket depth and the token bucket depth as the token to be supplemented by the current WFQ queue, and entering the step S3-8; otherwise, not supplementing the token, and entering step S3-9;
s3-8, judging whether the current WFQ queue needs to update tokens, if so, multiplying the current WFQ queue by the number of the remaining tokens according to the ratio of the weight value of the current WFQ queue to the current total weight value to obtain the number of the tokens which are updated and supplemented by the current WFQ queue, subtracting the weight of the current WFQ queue from the current total weight to obtain a new total weight value, and subtracting the number of the tokens which are supplemented by the current WFQ queue from the number of the remaining tokens; otherwise, entering a step S3-9;
s3-9, judging whether to continuously update the WFQ queue tokens, if so, recalculating and supplementing the WFQ queue tokens according to the new total weight value until the token scheduling of all the WFQ queues is completed, and entering into step S3-10; otherwise, directly entering the step S3-10;
s3-10, judging whether residual tokens exist, if yes, counting the number of the LPQ queues, and equally distributing the current residual token number of the port to the LPQ queues to finish token scheduling of the LPQ queues by a timer; otherwise, waiting for the next token scheduling by the timer.
Further, the specific method for calculating the number of tokens updated by the PQ queue each time according to the update interval in step S3-2 is as follows:
s3-2-1, judging whether the shaping rate is greater than 1Gbps, and if so, updating the interval to be 1; otherwise, enter step S3-2-2;
s3-2-2, judging whether the shaping rate is more than or equal to 51.2Mbps and less than or equal to 1Gbps, and if so, updating the interval to be 2; otherwise, entering a step S3-2-3;
s3-2-3, obtaining the minimum added token byte and the scheduling times per second, multiplying the minimum added token byte and the scheduling times per second, dividing the multiplied value by the shaping rate, and obtaining an updating interval;
s3-2-4, according to the formula:
the token number Tok of each update of the PQ queue is obtained.
Further, the specific method of step S3-3 is as follows:
according to the formula:
MBS=MTU×8×2 10
obtaining a token bucket depth MBS of the PQ queue; where MTU is the maximum transmission unit.
Further, in step S3, timer interrupt is performed when the timer scheduling port queue supplements the token, 256 timers in the first-stage timer linked list are traversed during interrupt, and if the number of timers in the first-stage timer linked list is insufficient, timer supplement is performed from the later-stage timer linked list in sequence until the interrupt is ended.
Further, the specific method in step S4 is as follows:
s4-1, judging whether the queue type of the message is a PQ queue, if so, entering a step S4-2; otherwise, entering a step S4-3;
s4-2, judging whether the number of the remaining tokens in the queue is insufficient, if yes, directly discarding the message; otherwise, the corresponding token number is consumed, the message is sent out from the port, and the message dequeuing is completed;
s4-3, judging whether the queue type of the message is a WFQ queue or an LPQ queue, if so, entering a step S4-4; otherwise, directly discarding the message;
s4-4, judging whether to wait for a timer to schedule a new token for a token bucket of the queue, if so, sending out the message from the port after supplementing the token, namely completing the dequeuing of the message; otherwise, the message is cached in the queue, and the message enqueuing is completed.
There is provided a timer-based port queue scheduling electronic device, the device comprising:
a memory storing executable instructions; and
a processor configured to execute the executable instructions in the memory to implement a timer-based port queue scheduling method.
The beneficial effects of the invention are as follows:
1. different types of queuing mechanisms are provided for each port, so that more accurate dequeuing and enqueuing scheduling and token supplementing scheduling are realized, and the scheduling performance of QoS (quality of service) of network equipment can be improved;
2. through the cooperation of the timer and various queues, the requirements of the flow mixing aspect required by the converged network are ensured.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is an organizational chart of a timer;
FIG. 3 is a diagram of a timer scheduling architecture;
fig. 4 is a diagram of a port queue scheduling system.
Detailed Description
The following description of the embodiments of the present invention is provided to facilitate understanding of the present invention by those skilled in the art, but it should be understood that the present invention is not limited to the scope of the embodiments, and all the inventions which make use of the inventive concept are protected by the spirit and scope of the present invention as defined and defined in the appended claims to those skilled in the art.
As shown in fig. 1, the port queue scheduling method based on the timer comprises the following steps:
s1, sending a message to a port, and confirming the type of the message entering a queue based on priority distribution;
s2, initializing a timer based on an instant value according to a timer mechanism operated last time;
s3, based on the sequence of the queue types, replenishing tokens through a timer scheduling port queue;
s4, arranging message enqueuing and dequeuing based on the queue type of the message and the scheduled token;
and S5, in the dequeuing process, circularly scheduling nodes in the queue linked list, dequeuing the queues according to the weight ratio, and completing port queue scheduling.
As shown in fig. 2, the specific method in step S2 is as follows:
s2-1, dividing a timer into five levels, wherein the first level distributes 256 token buckets according to 1 time unit, and the second level to the fifth level distribute 64 token buckets;
s2-2, hanging the timer on a timer linked list of a first stage according to the position of a token bucket corresponding to the 8-bit binary low instantaneous value of the timer mechanism operated last time, so as to obtain the timer linked list of the first stage;
according to the position of the token bucket corresponding to the 9 th bit to the 14 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a timer linked list of a second stage to obtain a timer linked list of the second stage;
according to the position of the token bucket corresponding to the 15 th bit to the 20 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a timer linked list of a third stage to obtain the timer linked list of the third stage;
according to the position of the token bucket corresponding to the 21 st bit to the 26 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a fourth-stage timer linked list to obtain a fourth-stage timer linked list;
and according to the corresponding token bucket position from the 27 th bit to the 32 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a timer linked list of a fifth stage to obtain the timer linked list of the fifth stage, and finishing initialization.
Bits represent Bits of the timer, for a total of 32 Bits; expires indicates the expiration value, tv1 indicates the first stage of the timer, tv2 indicates the second stage of the timer, tv3 indicates the third stage of the timer, tv4 indicates the fourth stage of the timer, tv5 indicates the fifth stage of the timer.
As shown in fig. 3, the specific method in step S3 is as follows:
s3-1, updating PIR requirements of a PQ queue (priority queue) when a timer dispatches to a token bucket subordinate to a certain port;
s3-2, obtaining the shaping rate of the PQ queue, calculating an update interval, and calculating the number of tokens updated by the PQ queue each time through the update interval;
s3-3, calculating the token bucket depth of the PQ queue according to the maximum transmission unit of the port; wherein the token bucket depth of the PQ queue is not less than 2 times of the number of updated tokens at a time;
s3-4, judging whether the number of tokens in the PQ queue is smaller than the token bucket depth of the PQ queue, if so, calculating the difference value of the number of tokens in the PQ queue and the token bucket depth as a token to be supplemented by the PQ queue, and entering a step S3-5; otherwise, not supplementing the token, and entering a step S3-6;
s3-5, judging whether the number of tokens to be supplemented is larger than the number of the remaining tokens updated at the time of the port, if so, using all the remaining tokens for supplementing the PQ queue, ending the scheduling of the port queue at the time, and waiting for the next scheduling of the timer; otherwise, the PQ queue token is supplemented, the quantity supplemented at the time is subtracted from the rest token updated at the time of the port, and the step S3-6 is carried out;
s3-6, judging whether residual tokens exist, if yes, counting the number and total weight of WFQ queues (weighted fair queues) needing to be added with the tokens, and entering a step S3-7; otherwise, waiting for the next token scheduling of the timer;
s3-7, calculating the token bucket depth of the current WFQ queue, judging whether the number of tokens in the current WFQ queue is smaller than the token bucket depth of the WFQ queue, if so, calculating the difference value of the token bucket depth and the token bucket depth as the token to be supplemented by the current WFQ queue, and entering the step S3-8; otherwise, not supplementing the token, and entering step S3-9;
s3-8, judging whether the current WFQ queue needs to update tokens, if so, multiplying the current WFQ queue by the number of the remaining tokens according to the ratio of the weight value of the current WFQ queue to the current total weight value to obtain the number of the tokens which are updated and supplemented by the current WFQ queue, subtracting the weight of the current WFQ queue from the current total weight to obtain a new total weight value, and subtracting the number of the tokens which are supplemented by the current WFQ queue from the number of the remaining tokens; otherwise, entering a step S3-9;
s3-9, judging whether to continuously update the WFQ queue tokens, if so, recalculating and supplementing the WFQ queue tokens according to the new total weight value until the token scheduling of all the WFQ queues is completed, and entering into step S3-10; otherwise, directly entering the step S3-10;
s3-10, judging whether residual tokens exist, if yes, counting the number of the LPQ queues (low priority queues), and equally distributing the current number of the residual tokens of the ports to the LPQ queues to finish token scheduling of the LPQ queues by a timer; otherwise, waiting for the next token scheduling by the timer.
The specific method for calculating the number of tokens updated each time by the PQ queue through the update interval in the step S3-2 is as follows:
s3-2-1, judging whether the shaping rate is greater than 1Gbps, and if so, updating the interval to be 1; otherwise, enter step S3-2-2;
s3-2-2, judging whether the shaping rate is more than or equal to 51.2Mbps and less than or equal to 1Gbps, and if so, updating the interval to be 2; otherwise, entering a step S3-2-3;
s3-2-3, obtaining the minimum added token byte and the scheduling times per second, multiplying the minimum added token byte and the scheduling times per second, dividing the multiplied value by the shaping rate, and obtaining an updating interval;
s3-2-4, according to the formula:
the token number Tok of each update of the PQ queue is obtained.
The specific method of the step S3-3 is as follows:
according to the formula:
MBS=MTU×8×2 10
obtaining a token bucket depth MBS of the PQ queue; where MTU is the maximum transmission unit.
And (3) performing timing interruption when the timer scheduling port queue supplements tokens in the step (S3), traversing 256 timers in the first-stage timer linked list during interruption, and if the number of the timers in the first-stage timer linked list is insufficient, sequentially supplementing the timers from the later-stage timer linked list until the interruption is ended.
Step S3, timer scheduling port queue supplementing token will generate timer interrupt, when the interrupt is performed, traversing 256 timers in a first-stage timer linked list, supplementing a batch of timers from a second-stage timer linked list to the first-stage linked list after the interrupt is completed, and supplementing the timers from a third-stage timer linked list if the second-stage linked list is empty, and so on until the interrupt is finished; when the next time the timer schedules an interrupt, only the timer in the timer linked list of the first stage is traversed.
As shown in fig. 4, the specific method in step S4 is as follows:
s4-1, judging whether the queue type of the message is a PQ queue, if so, entering a step S4-2; otherwise, entering a step S4-3;
s4-2, judging whether the number of the remaining tokens in the queue is insufficient, if yes, directly discarding the message; otherwise, the corresponding token number is consumed, the message is sent out from the port, and the message dequeuing is completed;
s4-3, judging whether the queue type of the message is a WFQ queue or an LPQ queue, if so, entering a step S4-4; otherwise, directly discarding the message;
s4-4, judging whether to wait for a timer to schedule a new token for a token bucket of the queue, if so, sending out the message from the port after supplementing the token, namely completing the dequeuing of the message; otherwise, the message is cached in the queue, and the message enqueuing is completed.
The port queue scheduling electronic device based on the timer comprises:
a memory storing executable instructions; and
a processor configured to execute the executable instructions in the memory to implement a timer-based port queue scheduling method.
The invention provides queuing mechanisms of different types for each port, thereby realizing more accurate dequeuing and enqueuing scheduling and token supplementing scheduling, and improving the scheduling performance of QoS (quality of service) of network equipment; through the cooperation of the timer and various queues, the requirements of the flow mixing aspect required by the converged network are ensured.

Claims (5)

1. The port queue scheduling method based on the timer is characterized by comprising the following steps:
s1, sending a message to a port, and confirming the type of the message entering a queue based on priority distribution;
s2, initializing a timer according to the instant value of the timer mechanism operated last time; the method comprises the following steps:
s2-1, dividing a timer into five levels, wherein the first level distributes 256 token buckets according to 1 time unit, and the second level to the fifth level distribute 64 token buckets;
s2-2, hanging the timer on a timer linked list of a first stage according to the position of a token bucket corresponding to the 8-bit binary low instantaneous value of the timer mechanism operated last time, so as to obtain the timer linked list of the first stage;
according to the position of the token bucket corresponding to the 9 th bit to the 14 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a timer linked list of a second stage to obtain a timer linked list of the second stage;
according to the position of the token bucket corresponding to the 15 th bit to the 20 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a timer linked list of a third stage to obtain the timer linked list of the third stage;
according to the position of the token bucket corresponding to the 21 st bit to the 26 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a fourth-stage timer linked list to obtain a fourth-stage timer linked list;
according to the position of the token bucket corresponding to the 27 th bit to the 32 th bit of the instantaneous value binary system of the last time of running the timer mechanism, hanging the timer on a timer linked list of a fifth stage to obtain the timer linked list of the fifth stage, and finishing initialization;
s3, based on the sequence of the queue types, replenishing tokens through a timer scheduling port queue; the method comprises the following steps:
s3-1, updating PIR requirements of a PQ queue when a timer dispatches to a token bucket subordinate to a certain port;
s3-2, obtaining the shaping rate of the PQ queue, calculating an update interval, and calculating the number of tokens updated by the PQ queue each time through the update interval;
s3-3, calculating the token bucket depth of the PQ queue according to the maximum transmission unit of the port; wherein the token bucket depth of the PQ queue is not less than 2 times of the number of updated tokens at a time;
s3-4, judging whether the number of tokens in the PQ queue is smaller than the token bucket depth of the PQ queue, if so, calculating the difference value of the number of tokens in the PQ queue and the token bucket depth as a token to be supplemented by the PQ queue, and entering a step S3-5; otherwise, not supplementing the token, and entering a step S3-6;
s3-5, judging whether the number of tokens to be supplemented is larger than the number of the remaining tokens updated at the time of the port, if so, using all the remaining tokens for supplementing the PQ queue, ending the scheduling of the port queue at the time, and waiting for the next scheduling of the timer; otherwise, the PQ queue token is supplemented, the quantity supplemented at the time is subtracted from the rest token updated at the time of the port, and the step S3-6 is carried out;
s3-6, judging whether residual tokens exist, if yes, counting the number and total weight of WFQ queues needing to be added with the tokens, and entering a step S3-7; otherwise, waiting for the next token scheduling of the timer;
s3-7, calculating the token bucket depth of the current WFQ queue, judging whether the number of tokens in the current WFQ queue is smaller than the token bucket depth of the WFQ queue, if so, calculating the difference value of the token bucket depth and the token bucket depth as the token to be supplemented by the current WFQ queue, and entering the step S3-8; otherwise, not supplementing the token, and entering step S3-9;
s3-8, judging whether the current WFQ queue needs to update tokens, if so, multiplying the current WFQ queue by the number of the remaining tokens according to the ratio of the weight value of the current WFQ queue to the current total weight value to obtain the number of the tokens which are updated and supplemented by the current WFQ queue, subtracting the weight of the current WFQ queue from the current total weight to obtain a new total weight value, and subtracting the number of the tokens which are supplemented by the current WFQ queue from the number of the remaining tokens; otherwise, entering a step S3-9;
s3-9, judging whether to continuously update the WFQ queue tokens, if so, recalculating and supplementing the WFQ queue tokens according to the new total weight value until the token scheduling of all the WFQ queues is completed, and entering into step S3-10; otherwise, directly entering the step S3-10;
s3-10, judging whether residual tokens exist, if yes, counting the number of the LPQ queues, and equally distributing the current residual token number of the port to the LPQ queues to finish token scheduling of the LPQ queues by a timer; otherwise, waiting for the next token scheduling of the timer;
s4, arranging message enqueuing and dequeuing based on the queue type of the message and the scheduled token; the method comprises the following steps:
s4-1, judging whether the queue type of the message is a PQ queue, if so, entering a step S4-2; otherwise, entering a step S4-3;
s4-2, judging whether the number of the remaining tokens in the queue is insufficient, if yes, directly discarding the message; otherwise, the corresponding token number is consumed, the message is sent out from the port, and the message dequeuing is completed;
s4-3, judging whether the queue type of the message is a WFQ queue or an LPQ queue, if so, entering a step S4-4; otherwise, directly discarding the message;
s4-4, judging whether to wait for a timer to schedule a new token for a token bucket of the queue, if so, sending out the message from the port after supplementing the token, namely completing the dequeuing of the message; otherwise, caching the message in a queue to finish message enqueuing;
and S5, in the dequeuing process, circularly scheduling nodes in the queue linked list, dequeuing the queues according to the weight ratio, and completing port queue scheduling.
2. The port queue scheduling method based on the timer according to claim 1, wherein the specific method for calculating the number of tokens of each update of the PQ queue by the update interval in step S3-2 is as follows:
s3-2-1, judging whether the shaping rate is greater than 1Gbps, and if so, updating the interval to be 1; otherwise, enter step S3-2-2;
s3-2-2, judging whether the shaping rate is more than or equal to 51.2Mbps and less than or equal to 1Gbps, and if so, updating the interval to be 2; otherwise, entering a step S3-2-3;
s3-2-3, obtaining the minimum added token byte and the scheduling times per second, multiplying the minimum added token byte and the scheduling times per second, dividing the multiplied value by the shaping rate, and obtaining an updating interval;
s3-2-4, according to the formula:
the token number Tok of each update of the PQ queue is obtained.
3. The method for scheduling port queues based on the timer according to claim 1, wherein the specific method of step S3-3 is as follows:
according to the formula:
MBS=MTU×8×2 10
obtaining a token bucket depth MBS of the PQ queue; where MTU is the maximum transmission unit.
4. The timer-based port queue scheduling method according to claim 1, wherein in step S3, timer interrupt is performed when the timer scheduling port queue supplements the token, 256 timers in the first-stage timer linked list are traversed during the interrupt, and if the number of timers in the first-stage timer linked list is insufficient, timer supplementation is performed from the later-stage timer linked list in sequence until the interrupt is ended.
5. A timer-based port queue scheduling electronic device, the device comprising:
a memory storing executable instructions; and
a processor configured to execute executable instructions in the memory to implement the method of any of claims 1-4.
CN202111238259.6A 2021-10-25 2021-10-25 Port queue scheduling method based on timer and electronic equipment Active CN113938439B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111238259.6A CN113938439B (en) 2021-10-25 2021-10-25 Port queue scheduling method based on timer and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111238259.6A CN113938439B (en) 2021-10-25 2021-10-25 Port queue scheduling method based on timer and electronic equipment

Publications (2)

Publication Number Publication Date
CN113938439A CN113938439A (en) 2022-01-14
CN113938439B true CN113938439B (en) 2023-12-15

Family

ID=79283934

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111238259.6A Active CN113938439B (en) 2021-10-25 2021-10-25 Port queue scheduling method based on timer and electronic equipment

Country Status (1)

Country Link
CN (1) CN113938439B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114679421A (en) * 2022-04-19 2022-06-28 深圳市吉祥腾达科技有限公司 Queue scheduling method and system based on user data flow priority
CN116346739B (en) * 2023-03-31 2023-12-05 南京金阵微电子技术有限公司 Multi-queue scheduling method, system, circuit and chip

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1466334A (en) * 2002-06-12 2004-01-07 ��Ϊ�������޹�˾ Method for controlling message transmitting spped rate in router interface
US7350208B1 (en) * 2002-12-31 2008-03-25 Cisco Technology, Inc. Method and apparatus for scheduling using a resource variable decreased by amounts corresponding to the efficiency of the resource
CN101447943A (en) * 2008-12-26 2009-06-03 杭州华三通信技术有限公司 Queue scheduling system and method
CN102624625A (en) * 2012-03-13 2012-08-01 网经科技(苏州)有限公司 QoS (Quality of Service) fair scheduling method for large amount of users
CN104734989A (en) * 2013-12-23 2015-06-24 腾讯数码(天津)有限公司 Data transmission flow scheduling method and system based on token buckets
CN106789721A (en) * 2017-03-24 2017-05-31 深圳市吉祥腾达科技有限公司 A kind of intelligent QOS method and system based on token bucket

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8130648B2 (en) * 2006-01-04 2012-03-06 Broadcom Corporation Hierarchical queue shaping
JP4988766B2 (en) * 2006-12-22 2012-08-01 インターナショナル・ビジネス・マシーンズ・コーポレーション Message hub device, program, and method
US9450881B2 (en) * 2013-07-09 2016-09-20 Intel Corporation Method and system for traffic metering to limit a received packet rate

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1466334A (en) * 2002-06-12 2004-01-07 ��Ϊ�������޹�˾ Method for controlling message transmitting spped rate in router interface
US7350208B1 (en) * 2002-12-31 2008-03-25 Cisco Technology, Inc. Method and apparatus for scheduling using a resource variable decreased by amounts corresponding to the efficiency of the resource
CN101447943A (en) * 2008-12-26 2009-06-03 杭州华三通信技术有限公司 Queue scheduling system and method
CN102624625A (en) * 2012-03-13 2012-08-01 网经科技(苏州)有限公司 QoS (Quality of Service) fair scheduling method for large amount of users
CN104734989A (en) * 2013-12-23 2015-06-24 腾讯数码(天津)有限公司 Data transmission flow scheduling method and system based on token buckets
CN106789721A (en) * 2017-03-24 2017-05-31 深圳市吉祥腾达科技有限公司 A kind of intelligent QOS method and system based on token bucket

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Neda N.Navidy;Reza Sedghi.A new approach for WiMAX multi-hop network & token bucket packet scheduling algorithm.2012 2nd International Conference on Consumer Electronicas,Communications and Networks.2012,全文. *
自适应路由与队列调度策略控制技术研究与实现;罗章庆;中国优秀硕士学位论文数据库;全文 *

Also Published As

Publication number Publication date
CN113938439A (en) 2022-01-14

Similar Documents

Publication Publication Date Title
CN113938439B (en) Port queue scheduling method based on timer and electronic equipment
US6674718B1 (en) Unified method and system for scheduling and discarding packets in computer networks
CN106789721B (en) Intelligent QOS method and system based on token bucket
EP0986221B1 (en) Port scheduler and method for scheduling service providing guarantees and hierarchical rate limiting with or without overbooking capability
US8000247B2 (en) Bandwidth management apparatus
JP4338285B2 (en) Packet scheduling method and apparatus
CN107483363B (en) Layered weighted polling scheduling device and method
JP2959540B2 (en) Node device
WO2002062013A2 (en) Methods and systems providing fair queuing and priority scheduling to enhance quality of service in a network
JPH1084383A (en) Packet scheduling equipment and packet transfer method
CN101964758A (en) Differentiated service-based queue scheduling method
US7447155B2 (en) Guaranteed service in a data network
NZ531355A (en) Distributed transmission of traffic flows in communication networks
CN109327406B (en) Method for guaranteeing service quality of service queue data packet of differential queue
CN107800643A (en) Message forwarding method and device
KR20120055946A (en) Method and apparatus for packet scheduling based on allocating fair bandwidth
Domżał Intelligent routing in congested approximate flow-aware networks
WO2001039467A1 (en) Method and system for controlling transmission of packets in computer networks
Domzal et al. Approximate flow-aware networking
EP1694012A1 (en) Method and apparatus for monitoring and improving performance of a queuing scheduler
Iatrou et al. A dynamic regulation and scheduling scheme for real-time traffic management
Chen et al. Packet Scheduling Algorithm Based on Priority Adjustment in Wireless Sensor Networks
JPH11298523A (en) Packet scheduling method
Da-gang A new adaptive BLUE algorithm
Nandhini Improved round robin queue management algorithm for elastic and inelastic traffic flows

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