CN112805971A - Traffic shaping method and related equipment - Google Patents

Traffic shaping method and related equipment Download PDF

Info

Publication number
CN112805971A
CN112805971A CN201980065232.6A CN201980065232A CN112805971A CN 112805971 A CN112805971 A CN 112805971A CN 201980065232 A CN201980065232 A CN 201980065232A CN 112805971 A CN112805971 A CN 112805971A
Authority
CN
China
Prior art keywords
token
bucket
period
port
scheduling
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.)
Granted
Application number
CN201980065232.6A
Other languages
Chinese (zh)
Other versions
CN112805971B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN112805971A publication Critical patent/CN112805971A/en
Application granted granted Critical
Publication of CN112805971B publication Critical patent/CN112805971B/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/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/22Traffic shaping

Landscapes

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

Abstract

The embodiment of the application provides a traffic shaping method and related equipment, wherein the method comprises the following steps: the method comprises the steps that equipment obtains a scheduling period of a scheduler and a bucket filling period of a token bucket, wherein the clock period number contained in the bucket filling period of the token bucket is equal to the clock period number contained in the scheduling period of the scheduler; the device schedules X output ports of the device according to the scheduling period and fills the token bucket according to the bucket filling period, wherein the number of clock periods occupied by a first port in the scheduling period is in positive correlation with the proportion occupied by the bandwidth of the first port in the total output bandwidth of the device, the first port is any one of the output ports of the device, and X is a positive integer greater than or equal to 1. By adopting the embodiment of the application, the implementation cost can be obviously reduced.

Description

Traffic shaping method and related equipment Technical Field
The present invention relates to the field of communications technologies, and in particular, to a traffic shaping method and a related device.
Background
In a data transmission scenario, since the sending capability/bandwidth of an output port is limited, the scheduler needs to ensure that the average bandwidth of the scheduled data cannot exceed the bearer bandwidth of the output port. The method mainly includes two parts, on one hand, a scheduler is used for scheduling respective data to be transmitted to an output port according to a specific rule (such as a calendar (calendar) algorithm, a Weighted Round Robin (WRR) algorithm, a Weighted Fair Queuing (WFQ), and the like). Taking a calendar as an example, the specification of output port scheduling generally uses time division multiplexing scheduling, and the basic principle is that a user configures a calendar table in advance, wherein the scheduling result of each scheduling is directly configured in advance, each data in a data structure is polled directly according to a working clock cycle during working, if other conditions are met (such as the following flow shaping condition is met), the scheduling result is obtained directly, otherwise, the scheduling result is invalidated, and next data is polled continuously in the next clock cycle.
Another aspect is to control the data output bandwidth of each port queue using traffic shaping. There are various ways in which the industry has incorporated traffic shaping, typically by using a token bucket mechanism to limit the sending of data, and the basic principle of token passing is shown in fig. 1A and 1B. When the data flow needs to be output, the quantity of tokens which is equivalent to the data size is taken out from the token bucket according to the data size for transmitting the data. That is, to have data transmitted, it must be guaranteed that there are enough tokens in the token bucket, and if there are not enough tokens, the data will be discarded or buffered. This can limit the data flow to be less than or equal to the speed of token generation, thereby achieving the purpose of flow limitation. According to the mechanism of token bucket, the average bandwidth of data transmission is equal to the speed of filling the bucket, and the bucket depth of the token bucket is the maximum transmission burst size. The current scheme of filling more token buckets is to fill the buckets regularly.
The basic principle of the timed bucket filling is that the filling time of each token bucket is fixed, and different bandwidth is realized by configuring different numbers of tokens for filling the bucket. Implementing this algorithm requires introducing at least the following data structure: the number of tokens in the current token bucket, the unit time filling value, the time count for judging the filling time and the maximum bucket depth of the token bucket. Considering that there are multiple ports in a device, it is logical that multiple ports each set a respective token bucket control bandwidth. A typical design is to share a token bucket circuit, store data structures of different ports at different addresses of a memory (e.g., static random-access memory (SRAM)), and perform time-division multiplexing to perform bucket filling and bucket locking operations (i.e., operations for deducting tokens from the token bucket). At the moment, the bucket filling period needs to be larger than the number of the ports, and each token bucket is filled at most once in each bucket filling period, so that bucket filling requirements of different ports cannot be time-conflicted. The typical value of the bucket filling period is that the bucket filling period is equal to min { port number r, 2^ q }, where q is a value satisfying 2^ q > r.
In the mechanism of regularly filling the bucket, the logical bucket corresponding to each output port can be filled once only by interval bucket filling periods, so that more tokens need to be filled in each bucket filling period in order to meet the requirement that the average bandwidth of data transmission is not too small. And too many tokens are filled at one time, which causes the bucket depth to be increased, thereby resulting in higher implementation cost, and how to reasonably fill the bucket to reduce the implementation cost is a technical problem being researched by a person skilled in the art.
Disclosure of Invention
The embodiment of the invention discloses a traffic shaping method and related equipment, which can obviously reduce the implementation cost.
In a first aspect, an embodiment of the present application provides a traffic shaping method, where the method includes:
the method comprises the steps that equipment obtains a scheduling period of a scheduler and a bucket filling period of a token bucket, wherein the clock period number contained in the bucket filling period of the token bucket is equal to the clock period number contained in the scheduling period of the scheduler;
the device schedules X output ports of the device according to the scheduling period and fills the token bucket according to the bucket filling period, wherein the number of clock periods occupied by a first port in the scheduling period is in positive correlation with the proportion occupied by the bandwidth of the first port in the total output bandwidth of the device, the first port is any one of the output ports of the device, and X is a positive integer greater than or equal to 1.
By executing the method, the scheduling period of the scheduler and the bucket filling period of the token bucket are set to be the same, so that the speed of scheduling data is matched with the speed of filling the token bucket, and the token bucket does not need to be configured with larger bucket depth, and on one hand, the implementation cost of configuring the larger bucket depth is reduced; on the other hand, the flow burst is reduced, and the transmission performance of the equipment is improved.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the scheduling, by the device, X output ports of the device according to the scheduling period and performing bucket filling on the token bucket according to the bucket filling period includes:
configuring token parameters for the first port, wherein the token parameters comprise a first token parameter, the first token parameter comprises a remaining token quantity K, a first token quantity n1 and a flag bit parameter, and the flag bit parameter is used for marking one clock cycle in the h clock cycles; the initial value of the remaining token amount is equal to the total token amount m;
scheduling the first port when the first port is scheduled in turn in the scheduling period, and judging whether the current clock period is the clock period marked by the marking bit in the token parameter;
if not, filling the token bucket with the first token amount n1 and updating the remaining token amount K in the token parameters, wherein the updated remaining token amount is equal to the remaining token amount before updating minus the first token amount n 1;
if yes, filling the current token quantity K into the token bucket, and initializing the residual token quantity K in the token parameters to the total token quantity m.
In this implementation manner, only the remaining token quantity K, the first token quantity n1, and the flag parameter need to be configured for the first port, and it is not necessary to separately configure each clock cycle corresponding to the first port, which reduces the complexity of configuration.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the token parameters further include a second token parameter, where the second token parameter includes a remaining token quantity K, a first token quantity n1, and a flag bit parameter, where an initial value of the remaining token quantity K in the second token is different from an initial value of the remaining token quantity K in the first token, and the first token quantity n1 in the second token is different from the first token quantity n1 in the first token; the first token parameter is used as a basis for filling token buckets with tokens when the bandwidth of the first port is not changed, and the second token parameter is used as a basis for filling token buckets with tokens after the bandwidth of the first port is changed.
In this implementation, multiple sets of parameters are configured when token parameters are configured, because port bandwidth may change, if scheduling and bucket filling are performed according to the configuration before the change after the change, problems may occur, and if configuration is performed temporarily after the change, some delay may be caused, that is, scheduling and bucket filling cannot be performed immediately after the port bandwidth changes. The alternative scheme pre-estimates what change may occur to the port, and then a set of standby token parameters, namely a second token parameter, is pre-configured according to the change, wherein the type of the parameter in the second token parameter is the same as that of the first token parameter, namely the specific value may be different, and the parameter in the second token parameter can meet the scheduling and bucket filling requirements after the bandwidth of the port is changed.
With reference to the first aspect or any one of the foregoing possible implementation manners of the first aspect, in a third possible implementation manner of the first aspect, the scheduling, by the device, X output ports of the device according to the scheduling period and bucket filling, by the device, the token bucket according to the bucket filling period includes:
mapping a numerical value for representing the magnitude of the token quantity for each clock cycle in the scheduling cycle; wherein the sum of the values corresponding to the h clock cycles is equal to the total token amount m;
and scheduling the first port in the h clock cycles in the scheduling cycle, and filling the token bucket according to the value corresponding to each clock cycle in the h clock cycles.
In the implementation mode, a numerical value is mapped for each clock cycle in the scheduling cycle in advance, the buckets are filled according to the numerical value corresponding to the clock cycle when the buckets are scheduled and filled to each clock cycle in the following process, and the numerical values in the clock cycles are independent from each other, so that the buckets in other clock cycles in the following process cannot be influenced even if an accident occurs in any clock cycle.
In a second aspect, an embodiment of the present application provides a traffic shaping device, where the device includes a physical unit, a scheduler, and X output ports, where X is a positive integer greater than or equal to 1, where:
the processing unit is used for acquiring a scheduling period of the scheduler and a bucket filling period of a token bucket, wherein the clock period contained in the bucket filling period of the token bucket is equal to the clock period contained in the scheduling period of the scheduler;
and the scheduler is used for scheduling the X output ports according to the scheduling period and filling the token bucket according to the bucket filling period, wherein the number of clock periods occupied by the first port in the scheduling period is positively correlated with the proportion of the bandwidth of the first port in the total output bandwidth of the equipment, and the first port is any one of the X output ports.
By operating the above units, the scheduling period of the scheduler and the bucket filling period of the token bucket are set to be the same, so that the speed of scheduling data is matched with the speed of filling the token bucket, and therefore the token bucket does not need to be configured with a larger bucket depth, on one hand, the implementation cost of configuring the larger bucket depth is reduced, specifically, as the scheduling period and the bucket filling period of the token bucket are set to be the same, bucket buckling and bucket filling occur simultaneously in each clock period, and therefore the bucket buckling and bucket filling can be combined into one read and write instead of one read and write for each bucket buckling and bucket filling, the read and write complexity is remarkably reduced, namely, the cache performance requirement on the used memory is reduced; on the other hand, the flow burst is reduced, and the transmission performance of the equipment is improved.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the scheduler is configured to schedule the X output ports according to the scheduling period and fill the token bucket according to the bucket filling period, and includes:
configuring token parameters for the first port, wherein the token parameters comprise a first token parameter, the first token parameter comprises a remaining token quantity K, a first token quantity n1 and a flag bit parameter, and the flag bit parameter is used for marking one clock cycle in the h clock cycles; the initial value of the remaining token amount is equal to the total token amount m;
scheduling the first port when the first port is scheduled in turn in the scheduling period, and judging whether the current clock period is the clock period marked by the marking bit in the token parameter;
if not, filling the token bucket with the first token amount n1 and updating the remaining token amount K in the token parameters, wherein the updated remaining token amount is equal to the remaining token amount before updating minus the first token amount n 1;
if yes, filling the current token quantity K into the token bucket, and initializing the residual token quantity K in the token parameters to the total token quantity m.
In this implementation manner, only the remaining token quantity K, the first token quantity n1, and the flag parameter need to be configured for the first port, and it is not necessary to separately configure each clock cycle corresponding to the first port, which reduces the complexity of configuration.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the token parameters further include a second token parameter, where the second token parameter includes a remaining token quantity K, a first token quantity n1, and a flag bit parameter, where an initial value of the remaining token quantity K in the second token is different from an initial value of the remaining token quantity K in the first token, and the first token quantity n1 in the second token is different from the first token quantity n1 in the first token; the first token parameter is used as a basis for filling token buckets with tokens when the bandwidth of the first port is not changed, and the second token parameter is used as a basis for filling token buckets with tokens after the bandwidth of the first port is changed.
In this implementation, multiple sets of parameters are configured when token parameters are configured, because port bandwidth may change, if scheduling and bucket filling are performed according to the configuration before the change after the change, problems may occur, and if configuration is performed temporarily after the change, some delay may be caused, that is, scheduling and bucket filling cannot be performed immediately after the port bandwidth changes. The alternative scheme pre-estimates what change may occur to the port, and then a set of standby token parameters, namely a second token parameter, is pre-configured according to the change, wherein the type of the parameter in the second token parameter is the same as that of the first token parameter, namely the specific value may be different, and the parameter in the second token parameter can meet the scheduling and bucket filling requirements after the bandwidth of the port is changed.
With reference to the second aspect, or any one of the foregoing possible implementations of the second aspect, in a third possible implementation of the second aspect, the scheduler is configured to schedule the X output ports according to the scheduling period and fill the token buckets according to the bucket filling period, and includes:
mapping a numerical value for representing the magnitude of the token quantity for each clock cycle in the scheduling cycle; wherein the sum of the values corresponding to the h clock cycles is equal to the total token amount m;
and scheduling the first port in the h clock cycles in the scheduling cycle, and filling the token bucket according to the value corresponding to each clock cycle in the h clock cycles.
In the implementation mode, a numerical value is mapped for each clock cycle in the scheduling cycle in advance, the buckets are filled according to the numerical value corresponding to the clock cycle when the buckets are scheduled and filled to each clock cycle in the following process, and the numerical values in the clock cycles are independent from each other, so that the buckets in other clock cycles in the following process cannot be influenced even if an accident occurs in any clock cycle.
With reference to the first aspect, or any one of the foregoing possible implementations of the first aspect, or the second aspect, or any one of the foregoing possible implementations of the second aspect, in an optional implementation, a bucket filling period of the token bucket is synchronized with a scheduling period of the scheduler. It can be understood that, this can make the scheduling (accompanied by bucket buckling) and bucket filling height match, i.e. completing the scheduling once and also completing the bucket filling once in each clock cycle, and can reduce the bucket depth to the maximum extent.
With reference to the first aspect, or any one of the foregoing possible implementations of the first aspect, or the second aspect, or any one of the foregoing possible implementations of the second aspect, in an optional implementation, the number h of clock cycles occupied by the first port in the scheduling period satisfies the following formula:
Figure PCTCN2019070594-APPB-000001
where H is the number of clock cycles included in the scheduling cycle, S1 is the bandwidth of the first port, and S is the total output bandwidth.
In the implementation mode, the scheduling period occupied by the first port is determined according to the ratio of the bandwidth of the first port to the total output bandwidth, and by adopting the mode, the number of clock periods occupied by each output port during scheduling can be matched with the actual requirement of the bandwidth of each output port as much as possible, and the output ports are relatively balanced, so that the whole bandwidth requirement is met to the maximum extent.
With reference to the first aspect, or any one of the foregoing possible implementations of the first aspect, or the second aspect, or any one of the foregoing possible implementations of the second aspect, in an optional implementation, a total token amount m for filling a bucket into the token bucket in h clock cycles that the first port is scheduled to go through satisfies the following formula:
m=s1*H/f
wherein f is the operating clock frequency of the device.
In the implementation mode, the total token quantity of the first port required to fill the bucket in the scheduling period is determined according to the bandwidth of the first port, and by adopting the mode, the token quantity of each output port filled in the bucket in the scheduling process is matched with the actual bandwidth requirement of the output port as much as possible, and the output ports are relatively balanced, so that the overall bandwidth requirement is met to the maximum extent.
With reference to the first aspect, or any one of the foregoing possible implementations of the first aspect, or the second aspect, or any one of the foregoing possible implementations of the second aspect, in an optional implementation, the number of clock cycles H included in the scheduling period satisfies the following formula:
Figure PCTCN2019070594-APPB-000002
wherein S is a total output bandwidth of the device, t is a least common divisor of bandwidths of the output ports of the device, p is a total number of ports of the output ports of the device, and f is a working clock frequency of the device.
In the implementation mode, the first term in the formula reduces the bandwidth waste of the output port as much as possible, the second term ensures that each port has a scheduling opportunity in each scheduling period, and the third term ensures that the token quantity of each bucket filling is an integer, so that the implementation can be realized through a simple circuit, namely the implementation cost is reduced.
In a third aspect, embodiments of the present application provide an apparatus that includes a processor, a memory device, an output device, and a motherboard, where the devices are connected to the motherboard by a bus or by soldering or other electrical connection, and the output device includes a scheduler. The processor controls the output device for traffic shaping and scheduling by calling a program stored in the memory.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored therein program instructions that, when executed on a processor, implement the method described in the first aspect, or any possible implementation manner of the first aspect.
Drawings
FIG. 1A is a schematic diagram of a token bucket according to an embodiment of the present invention;
FIG. 1B is a schematic diagram of another token bucket provided by an embodiment of the invention;
fig. 2 is a schematic flow chart of data stream transmission according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of scheduling and shaping a data stream according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a traffic shaping device according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating a traffic shaping method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another traffic shaping device according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described below with reference to the drawings.
The invention is applied to network equipment which mainly completes the functions of transmission, processing and the like of network data frames. Taking a network switching device (e.g., a switch, a router, etc.) as an example, as shown in fig. 2, the network switching device needs to complete functions of data receiving and inputting, forwarding, switching, traffic management, traffic outputting, etc. In the "output" link of data, a typical flow is shown in fig. 3, and specifically, considering that a data packet has a length that is longer or shorter, and a device has a plurality of output ports with different rates at the same time, it is necessary to slice a longer data packet according to the bit width of the data processed inside the device, and then enter different output port queues according to different outlets, during which scheduling shaping is also involved in the port queues. Accordingly, slice data is uniformly transmitted to each output port by the scheduler according to the bandwidth of each output port, and finally the data is compiled into data frames (namely, outlet framing) meeting the output port protocol by the transmitting circuit of the output port so as to be transmitted to the downstream. The embodiment of the application provides a traffic shaping method, which is mainly used for optimizing a scheduling shaping link in fig. 3.
Referring to fig. 4, fig. 4 is a device 40 according to an embodiment of the present invention, where the device 40 may perform data transmission, and the flow shown in fig. 2 and fig. 3 needs to be executed when data transmission is performed. The device 40 includes a processor 401, a memory device 402, a Random Access Memory (RAM) 403, an output device 404, an input device 405, and a motherboard 406, wherein the various devices are connected to the motherboard 406 by a bus or by soldering or other point connections.
The memory device 402 includes, but is not limited to, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM), and the memory device 402 is used for related instructions and data.
The RAM403 is used to buffer data used in the traffic shaping and scheduling process, for example, in the egress framing stage shown in fig. 3, there is a frame data buffer, and the data can be buffered in the RAM.
The output component 404 is configured to perform traffic scheduling and traffic shaping operations under the control of the processor 401, and optionally, the output component may include a scheduler, and a scheduling algorithm used by the scheduler may be configured in the scheduler and also configured in the processor 401;
the input component 405 is used to receive externally transmitted data under the control of the processor 401.
The processor 401 may be one or more Central Processing Units (CPUs), or one or more Field Programmable Gate Arrays (FPGAs), or one or more Application Specific Integrated Circuits (ASICs), and in the case that the processor 401 is a CPU, the CPU may be a single core CPU or a multi-core CPU. The processor 401 is used to read the program codes stored in the storage device 402 and the RAM to control the operations of the respective devices, for example, to control the data input and data output of the output module 404 and the input module 405.
Optionally, the device 40 may further comprise a user interface 407, and the user interface 407 may be used to access a keyboard, a mouse, a touch screen, etc. to support user interaction with the device 40.
A more detailed description of the traffic shaping performed by the device 40 can be found in relation to the method embodiment shown in fig. 5.
Referring to fig. 5, fig. 5 is a flow shaping method according to an embodiment of the present invention, where the method may be implemented based on the apparatus shown in fig. 4, and may also be implemented based on other architectures, where the method includes, but is not limited to, the following steps:
step S501: the device obtains a scheduling period of the scheduler and a bucket filling period of the token bucket.
Specifically, taking the use of a time division multiplexing (tdm) CALENDAR scheduler as an example, usually one scheduling cycle contains a fixed clock cycle or multiple clock cycles, and the scheduler can perform scheduling once per clock cycle, for example, if the scheduling cycle contains 3 clock cycles, the scheduler can perform scheduling 3 times in the scheduling cycle. Similarly, a bucket filling period comprises one or more clock cycles, wherein a token bucket may be filled once per clock cycle, for example, if the bucket filling period comprises 4 clock cycles, 4 times of bucket filling may be performed on the token bucket in the bucket filling period. For a device with multiple output ports, multiple times of scheduling in a scheduling period are correspondingly allocated to multiple ports, and similarly, multiple times of bucket filling are also correspondingly allocated to token buckets of multiple ports.
In the embodiment of the present application, the bucket filling period of the token bucket includes a number of clock cycles equal to a number of clock cycles included in the scheduling period of the scheduler, and is collectively referred to as a logic cycle. For example, if the bucket filling period of the token bucket is 3 clock cycles, the scheduling period of the scheduler is also 3 clock cycles, and if the scheduling period of the scheduler is 10 clock cycles, the bucket filling period of the token bucket is also 10 clock cycles. Optionally, in the embodiment of the present application, the scheduling logic cycle is synchronized with the bucket filling logic cycle, and the distribution results of each clock cycle corresponding to each output port in the logic cycle are also synchronized, that is, each clock cycle in the logic cycle corresponds to the scheduling of a certain specific port, and each scheduling is accompanied with bucket filling, after the distribution strategy of multiple scheduling opportunities of a calendar scheduling for a certain port in multiple clock cycles in the logic cycle is uniformly distributed, the token buckets are uniformly filled, and the token scheduling dequeues are also uniform, so that the bucket depth can be reduced to the maximum extent, and thus the traffic burst is reduced. For example, the first clock cycle of the scheduling period and the first clock cycle of the bucket filling period are the same clock cycle, the last clock cycle of the scheduling period and the last clock cycle of the bucket filling period are the same clock cycle, and the rest is similar to the above.
It should be noted that the number of clock cycles included in the bucket filling period and the scheduling period in the embodiment of the present application is not an arbitrary period, but a certain condition needs to be satisfied, and several conditions are listed in formula 1 below for easy understanding.
Figure PCTCN2019070594-APPB-000003
In formula 1, H represents the number of clock cycles included in a scheduling cycle, S represents the total output bandwidth of the device, t is the least common divisor of the bandwidths of the output ports of the device, p is the total number of ports of the output ports of the device, and f is the operating clock frequency of the device.
The first term in equation 1 indicates that the scheduling period is greater than or equal to the total output bandwidth/minimum port granularity, it being understood that the minimum port granularity is equal to t × 1G. For example, if the total output bandwidth of the device is 1200G and the bandwidth size of the output port supported by the device is N × 5G, the smallest common divisor of the bandwidths of the output ports is 5, i.e., the minimum port granularity is 5G, so that the scheduling period needs to be greater than or equal to 240 (i.e., 240 clock cycles) according to the requirement of the first item. For another example, if the total output bandwidth of the device is 1200G, and the bandwidth size of the output port supported by the device is 5G, and the device starts to step according to the 1G granularity, the least common divisor of the bandwidths of the output ports is 1, that is, the minimum port granularity is 1G, so that the scheduling period needs to be greater than or equal to 1200 according to the requirement of the first item. N is a positive integer. This first term reduces bandwidth waste at the output port as much as possible.
The second term in equation 1 indicates that the scheduling period contains a number of clock cycles that is greater than or equal to the total number of ports of the output port of the device. For example, when the total number of ports is 10, the scheduling period is at least 10 (i.e., 10 clock cycles), so that it can be guaranteed that each port has one scheduling opportunity (one clock cycle corresponds to one scheduling opportunity) in each scheduling period.
The third term in equation 1 indicates that the bucket filling period is to satisfy the token bucket filling requirement of 1G precision. For example, if the total output bandwidth of the device is 1200G and the operating clock of the device is 1.2GHz, if the bandwidth of L × 1G needs to be configured accurately, an optional bucket filling period is 1350, and the value of each bucket filling is L × 1125 bits at this time, if the period is slightly larger or slightly smaller than 1350, it cannot be guaranteed that the value of each bucket filling is an integer, and the circuit is difficult to implement. Similarly, if the bandwidth of L × 1G needs to be configured accurately, and the bucket filling period is selected to be 12, then the value of each bucket filling is L × 10bit, where 10 is an integer, so as to meet the precision requirement, and therefore, setting the bucket filling period to be 12 can meet the requirement of the third item.
Optionally, the scheduling period in this embodiment of the application needs to satisfy one or more of the three conditions in equation 1, for example, all three conditions are satisfied, and if the three conditions are to be satisfied, the foregoing example is also used to illustrate that the scheduling period 1350 may satisfy the three conditions, and the scheduling period 1206 may also satisfy the three conditions. It should be noted that, since the number of clock cycles included in the scheduling period in the embodiment of the present application is equal to the number of clock cycles included in the bucket filling period, if the scheduling period satisfies the above three requirements, the bucket filling period also satisfies the above three requirements.
There are many ways for the device to obtain the bucket filling period and the scheduling period, for example, in one scheme, the device automatically calculates the scheduling period and the bucket filling period according to the above conditions, and in another scheme, the device manually calculates the scheduling period and the bucket filling period according to the above conditions and then configures the scheduling period and the bucket filling period on the device. Of course, other solutions exist, which are not illustrated here.
Step S502: and the equipment schedules an output port of the equipment according to the scheduling period and fills the token bucket according to the bucket filling period.
Specifically, the number of clock cycles occupied by the first port in the scheduling cycle is in positive correlation with the proportion of the bandwidth of the first port in the total output bandwidth of the device, and the first port is any one of the output ports of the device. Optionally, if the device has only the first port, the bandwidth of the first port is equal to the total output bandwidth of the device, and the first port occupies all clock cycles in the scheduling period.
In an alternative scheme, the number h of clock cycles occupied by the first port in the scheduling cycle satisfies formula 2:
Figure PCTCN2019070594-APPB-000004
where H is the number of clock cycles included in the scheduling cycle, S1 is the bandwidth of the first port, and S is the total output bandwidth.
For example, assume that the total output bandwidth of the device is 1200G, which is made up of 10 × 100G +20 × 10G. I.e., 10 ports of 100G bandwidth and 20 ports of 10G bandwidth, and the scheduling period is 1350.
Then the number h of clock cycles occupying the scheduling cycle per port of 100G bandwidth is:
Figure PCTCN2019070594-APPB-000005
then the number h of clock cycles occupied by each port with 10G bandwidth in the scheduling cycle is:
Figure PCTCN2019070594-APPB-000006
in summary, the sum of the clock cycles occupied by these 30 ports must not exceed one scheduling cycle. According to the above example, each 100G bandwidth port occupies 112 clock cycles and each 10G bandwidth port occupies 11 clock cycles during scheduling period 1350, and each port occupies 11 clock cycles during the clock cycles used for scheduling data for the port.
In the above, the clock cycle h occupied by each port in the scheduling cycle is introduced, and in the clock cycle h, the token bucket also needs to be filled, and the token amount of the filled token bucket needs to satisfy the corresponding condition, which is exemplified by taking the first port as an example below. Optionally, in h clock cycles that the first port is scheduled to go through, a total token amount m for filling the token bucket satisfies formula 3:
m-s 1H/f formula 3
In equation 3, f is the operating clock frequency of the device, s1 is the bandwidth of the first port, and H is the scheduling period.
For example, if the bandwidth s1 of the first port is 100G, the scheduling period of the scheduler is 1350, and f is 1.2GHz, the total number m of tokens to fill the token bucket is 112500 bits within 112 clock cycles that the first port has undergone scheduling. For example, during 11 of the 112 clock cycles, each clock cycle fills the bucket with 1000 bits, and during 1 clock cycle except for the 111 clock cycles, the bucket with 1500 bits.
For example, if the bandwidth s1 of the first port is 10G, the scheduling period of the scheduler is 1350, and f is 1.2GHz, the total number m of tokens to fill the token bucket in 11 clock cycles that the first port has undergone scheduling is 11250 bit. For example, during 10 of the 11 clock cycles, each clock cycle fills a bucket 1016bit and during 1 clock cycle other than the 10 clock cycles fills a bucket 1090 bit.
The first port is taken as an example to describe the clock period h occupied by each output port in the scheduling period and the total token amount m to be filled in the bucket in the clock period occupied by each port. Based on this, the first port is taken as an example to explain how to schedule and fill the bucket.
In an alternative scheduling and bucket filling scheme, first, a device configures token parameters for the first port, where the token parameters include a first token parameter, where the first token parameter includes a remaining token quantity K, a first token quantity n1, and a flag bit parameter, and the flag bit parameter is used to flag one clock cycle within the h clock cycles; the initial value of the remaining token amount is equal to the total token amount m. Then, scheduling the first port when the first port is scheduled in turn in the scheduling period, and judging whether the current clock period is the clock period marked by the marking bit in the token parameter; if not, filling the token bucket with the first token amount n1 and updating the remaining token amount K in the token parameters, wherein the updated remaining token amount is equal to the remaining token amount before updating minus the first token amount n 1; if yes, filling the current token quantity K into the token bucket, and initializing the residual token quantity K in the token parameters to the total token quantity m. It is understood that the first token quantity n1 is a preset integer, and the integer can be as close as possible to m/h. By adopting the mode, the first port only needs to be configured with the residual token quantity K, the first token quantity n1 and the marking parameters, and each corresponding clock cycle of the first port does not need to be configured independently, so that the configuration complexity is reduced, the flow is simple to realize, and hardware and software resources can be saved.
It can be understood that, after the token parameter is configured according to the first step, each subsequent scheduling period is scheduled according to the token parameter, and it is not necessary to configure each scheduling period.
Optionally, the token parameters further include a second token parameter, wherein the second token parameter includes a remaining token quantity K, a first token quantity n1 and a flag bit parameter, wherein an initial value of the remaining token quantity K in the second token is different from an initial value of the remaining token quantity K in the first token, and the first token quantity n1 in the second token is different from the first token quantity n1 in the first token; the first token parameter is used as a basis for filling token buckets with tokens when the bandwidth of the first port is not changed, and the second token parameter is used as a basis for filling token buckets with tokens after the bandwidth of the first port is changed. That is, multiple sets of parameters are configured when token parameters are configured, because port bandwidth may change, if scheduling and bucket filling are performed according to the configuration before the change after the change, problems may occur, and if the configuration is performed temporarily after the change, some time delay may be caused, that is, scheduling and bucket filling cannot be performed immediately after the port bandwidth changes. The alternative scheme pre-estimates what change may occur to the port, and then a set of standby token parameters, namely a second token parameter, is pre-configured according to the change, wherein the type of the parameter in the second token parameter is the same as that of the first token parameter, namely the specific value may be different, and the parameter in the second token parameter can meet the scheduling and bucket filling requirements after the bandwidth of the port is changed.
In yet another alternative scheduling and bucket filling scheme, first, the device maps a value for characterizing the token amount for each clock cycle in the scheduling cycle; and the sum of the numerical values corresponding to the h clock cycles is equal to the total token amount m. Then, the device schedules the first port in the h clock cycles in the scheduling cycle, and fills the token bucket according to the value corresponding to each clock cycle in the h clock cycles.
For example, if the total amount of tokens required to fill the bucket in h scheduling periods corresponding to the first port is 100 bits, and the h clock periods include the 1 st, 3 rd, 6 th and 10 th clock periods in the scheduling periods, the value 20 may be mapped to the 1 st clock period in the scheduling period in advance, the value 30 may be mapped to the 3 rd clock period, the value 40 may be mapped to the 6 th clock period, and the value 10 may be mapped to the 10 th clock period, that is, the sum of the values mapped to the 4 clock periods is 100. Subsequently, when the 1 st clock cycle of the scheduling cycle is scheduled, 20-bit tokens are filled according to the mapped numerical value 20, when the 3 rd clock cycle of the scheduling cycle is scheduled, 30-bit tokens are filled according to the mapped numerical value 30, when the 6 th clock cycle of the scheduling cycle is scheduled, 40-bit tokens are filled according to the mapped numerical value 40, and when the 10 th clock cycle of the scheduling cycle is scheduled, 10-bit tokens are filled according to the mapped numerical value 10.
In the method described in fig. 5, the scheduling period of the scheduler and the bucket filling period of the token bucket are set to be the same, so that the speed of scheduling data matches the speed of filling the token bucket, and therefore the token bucket does not need to be configured with a larger bucket depth, on one hand, the implementation cost of configuring the larger bucket depth is reduced, and specifically, since the scheduling period and the bucket filling period of the token bucket are set to be the same, bucket locking and bucket filling occur simultaneously in each clock period, and therefore the bucket locking and bucket filling can be combined into one read and write instead of one read and write for each bucket locking and bucket filling, and the read and write complexity is significantly reduced, that is, the requirement on the caching performance of the used memory is reduced; on the other hand, the flow burst is reduced, and the transmission performance of the equipment is improved.
The method of embodiments of the present invention is set forth above in detail and the apparatus of embodiments of the present invention is provided below. The above describes the device from the perspective of hardware structure, and the following describes the device from the perspective of software function according to functional modules.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a traffic shaping device 60 according to an embodiment of the present invention, where the traffic shaping device 60 may include a processing unit 601, a scheduler 602, and X output ports 603 (fig. 6 illustrates that three output ports 603 are taken as an example), where:
the processing unit 601 is configured to obtain a scheduling period of the scheduler 602 and a bucket filling period of a token bucket, where the clock period included in the bucket filling period of the token bucket is equal to the clock period included in the scheduling period of the scheduler; the processing unit 601 may be one or more processors, which may be a central processing unit CPU, or a field programmable gate array FPGA, or an application specific integrated circuit ASIC, etc.
The scheduler 602 is configured to schedule the X output ports according to the scheduling period and fill the token bucket according to the bucket filling period, where a clock period number occupied by a first port in the scheduling period is positively correlated with a proportion occupied by a bandwidth of the first port in a total output bandwidth of the device, the first port is any one of the output ports of the device, and X is a positive integer greater than or equal to 1.
The X output ports may be X physical data transmission circuits, or X logical data transmission circuits obtained by logically dividing one physical data transmission circuit.
By operating the above units, the scheduling period of the scheduler and the bucket filling period of the token bucket are set to be the same, so that the speed of scheduling data is matched with the speed of filling the token bucket, and therefore the token bucket does not need to be configured with a larger bucket depth, on one hand, the implementation cost of configuring the larger bucket depth is reduced, specifically, as the scheduling period and the bucket filling period of the token bucket are set to be the same, bucket buckling and bucket filling occur simultaneously in each clock period, and therefore the bucket buckling and bucket filling can be combined into one read and write instead of one read and write for each bucket buckling and bucket filling, the read and write complexity is remarkably reduced, namely, the cache performance requirement on the used memory is reduced; on the other hand, the flow burst is reduced, and the transmission performance of the equipment is improved.
In one possible implementation manner, the scheduler is configured to schedule the X output ports according to the scheduling period and fill the token bucket according to the bucket filling period, and includes:
configuring token parameters for the first port, wherein the token parameters comprise a first token parameter, the first token parameter comprises a remaining token quantity K, a first token quantity n1 and a flag bit parameter, and the flag bit parameter is used for marking one clock cycle in the h clock cycles; the initial value of the remaining token amount is equal to the total token amount m;
scheduling the first port when the first port is scheduled in turn in the scheduling period, and judging whether the current clock period is the clock period marked by the marking bit in the token parameter;
if not, filling the token bucket with the first token amount n1 and updating the remaining token amount K in the token parameters, wherein the updated remaining token amount is equal to the remaining token amount before updating minus the first token amount n 1;
if yes, filling the current token quantity K into the token bucket, and initializing the residual token quantity K in the token parameters to the total token quantity m.
In this implementation manner, only the remaining token quantity K, the first token quantity n1, and the flag parameter need to be configured for the first port, and it is not necessary to separately configure each clock cycle corresponding to the first port, which reduces the complexity of configuration.
In a further possible implementation, the token parameters further include a second token parameter, wherein the second token parameter includes a remaining token quantity K, a first token quantity n1, and a flag bit parameter, wherein an initial value of the remaining token quantity K in the second token is different from an initial value of the remaining token quantity K in the first token, and the first token quantity n1 in the second token is different from the first token quantity n1 in the first token; the first token parameter is used as a basis for filling token buckets with tokens when the bandwidth of the first port is not changed, and the second token parameter is used as a basis for filling token buckets with tokens after the bandwidth of the first port is changed.
In this implementation, multiple sets of parameters are configured when token parameters are configured, because port bandwidth may change, if scheduling and bucket filling are performed according to the configuration before the change after the change, problems may occur, and if configuration is performed temporarily after the change, some delay may be caused, that is, scheduling and bucket filling cannot be performed immediately after the port bandwidth changes. The alternative scheme pre-estimates what change may occur to the port, and then a set of standby token parameters, namely a second token parameter, is pre-configured according to the change, wherein the type of the parameter in the second token parameter is the same as that of the first token parameter, namely the specific value may be different, and the parameter in the second token parameter can meet the scheduling and bucket filling requirements after the bandwidth of the port is changed.
In another possible implementation manner, the scheduler is configured to schedule the X output ports according to the scheduling period and fill the token bucket according to the bucket filling period, and includes:
mapping a numerical value for representing the magnitude of the token quantity for each clock cycle in the scheduling cycle; wherein the sum of the values corresponding to the h clock cycles is equal to the total token amount m;
and scheduling the first port in the h clock cycles in the scheduling cycle, and filling the token bucket according to the value corresponding to each clock cycle in the h clock cycles.
In the implementation mode, a numerical value is mapped for each clock cycle in the scheduling cycle in advance, the buckets are filled according to the numerical value corresponding to the clock cycle when the buckets are scheduled and filled to each clock cycle in the following process, and the numerical values in the clock cycles are independent from each other, so that the buckets in other clock cycles in the following process cannot be influenced even if an accident occurs in any clock cycle.
In yet another possible implementation, the bucket filling period of the token bucket is synchronized with the scheduling period of the scheduler. It can be understood that, this can make the scheduling (accompanied by bucket buckling) and bucket filling height match, i.e. completing the scheduling once and also completing the bucket filling once in each clock cycle, and can reduce the bucket depth to the maximum extent.
In yet another possible implementation manner, the number h of clock cycles occupied by the first port in the scheduling cycle satisfies the following formula:
Figure PCTCN2019070594-APPB-000007
where H is the number of clock cycles included in the scheduling cycle, S1 is the bandwidth of the first port, and S is the total output bandwidth.
In the implementation mode, the scheduling period occupied by the first port is determined according to the ratio of the bandwidth of the first port to the total output bandwidth, and by adopting the mode, the number of clock periods occupied by each output port during scheduling can be matched with the actual requirement of the bandwidth of each output port as much as possible, and the output ports are relatively balanced, so that the whole bandwidth requirement is met to the maximum extent.
In yet another possible implementation manner, the total number m of tokens to fill the token bucket in h clock cycles that the first port is scheduled to go through satisfies the following formula:
m=s1*H/f
wherein f is the operating clock frequency of the device.
In the implementation mode, the total token quantity of the first port required to fill the bucket in the scheduling period is determined according to the bandwidth of the first port, and by adopting the mode, the token quantity of each output port filled in the bucket in the scheduling process is matched with the actual bandwidth requirement of the output port as much as possible, and the output ports are relatively balanced, so that the overall bandwidth requirement is met to the maximum extent.
In yet another alternative implementation, the scheduling period includes a number H of clock periods that satisfies the following equation:
Figure PCTCN2019070594-APPB-000008
wherein S is a total output bandwidth of the device, t is a least common divisor of bandwidths of the output ports of the device, p is a total number of ports of the output ports of the device, and f is a working clock frequency of the device.
In the implementation mode, the first term in the formula reduces the bandwidth waste of the output port as much as possible, the second term ensures that each port has a scheduling opportunity in each scheduling period, and the third term ensures that the token quantity of each bucket filling is an integer, so that the implementation can be realized through a simple circuit, namely the implementation cost is reduced.
It should be noted that the implementation and beneficial effects of each unit can also correspond to the corresponding description of the method embodiment shown in fig. 4.
The embodiment of the invention also provides a chip system, which comprises at least one processor, a memory and an interface circuit, wherein the memory, the transceiver and the at least one processor are interconnected through lines, and instructions are stored in the at least one memory; the instructions, when executed by the processor, implement the method flow shown in fig. 5.
An embodiment of the present invention further provides a computer-readable storage medium, in which instructions are stored, and when the computer-readable storage medium is executed on a processor, the method flow shown in fig. 5 is implemented.
Embodiments of the present invention further provide a computer program product, where when the computer program product runs on a processor, the method flow shown in fig. 5 is implemented.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer readable storage medium, and when executed, may include the processes of the above N method embodiments. And the aforementioned storage medium includes: n kinds of media capable of storing program codes, such as ROM or RAM, magnetic disk or optical disk.

Claims (17)

  1. A method of traffic shaping, comprising:
    the method comprises the steps that equipment obtains a scheduling period of a scheduler and a bucket filling period of a token bucket, wherein the clock period number contained in the bucket filling period of the token bucket is equal to the clock period number contained in the scheduling period of the scheduler;
    the device schedules X output ports of the device according to the scheduling period and fills the token bucket according to the bucket filling period, wherein the number of clock periods occupied by a first port in the scheduling period is in positive correlation with the proportion of the bandwidth of the first port in the total output bandwidth of the device, the first port is any one of the X output ports, and X is a positive integer greater than or equal to 1.
  2. The method of claim 1, wherein a bucket filling period of the token bucket is synchronized with a scheduling period of the scheduler.
  3. The method according to claim 1 or 2, wherein the number h of clock cycles occupied by the first port in the scheduling period satisfies the following formula:
    Figure PCTCN2019070594-APPB-100001
    where H is the number of clock cycles included in the scheduling cycle, S1 is the bandwidth of the first port, and S is the total output bandwidth.
  4. The method of claim 3, wherein a total number of tokens m to fill the token bucket for the h clock cycles over which the first port is scheduled satisfies the following equation:
    m=s1*H/f
    wherein f is the operating clock frequency of the device.
  5. The method of claim 4, wherein the device schedules X output ports of the device according to the scheduling period and buckets the token buckets according to the bucket filling period, comprising:
    configuring token parameters for the first port, wherein the token parameters comprise a first token parameter, the first token parameter comprises a remaining token quantity K, a first token quantity n1 and a flag bit parameter, and the flag bit parameter is used for marking one clock cycle in the h clock cycles; the initial value of the remaining token amount is equal to the total token amount m;
    scheduling the first port when the first port is scheduled in turn in the scheduling period, and judging whether the current clock period is the clock period marked by the marking bit in the token parameter;
    if not, filling the token bucket with the first token amount n1 and updating the remaining token amount K in the token parameters, wherein the updated remaining token amount is equal to the remaining token amount before updating minus the first token amount n 1;
    if yes, filling the current token quantity K into the token bucket, and initializing the residual token quantity K in the token parameters to the total token quantity m.
  6. The method of claim 5, wherein the token parameters further comprise a second token parameter, wherein the second token parameter comprises a remaining token quantity K, a first token quantity n1, and a flag bit parameter, wherein the remaining token quantity K in the second token has an initial value that is different from the initial value of the remaining token quantity K in the first token, and wherein the first token quantity n1 in the second token is different from the first token quantity n1 in the first token; the first token parameter is used as a basis for filling token buckets with tokens when the bandwidth of the first port is not changed, and the second token parameter is used as a basis for filling token buckets with tokens after the bandwidth of the first port is changed.
  7. The method of claim 4, wherein the device schedules X output ports of the device according to the scheduling period and buckets the token buckets according to the bucket filling period, comprising:
    mapping a numerical value for representing the magnitude of the token quantity for each clock cycle in the scheduling cycle; wherein the sum of the values corresponding to the h clock cycles is equal to the total token amount m;
    and scheduling the first port in the h clock cycles in the scheduling cycle, and filling the token bucket according to the value corresponding to each clock cycle in the h clock cycles.
  8. The method according to any of claims 1-7, wherein the scheduling period comprises a number H of clock periods satisfying the following formula:
    Figure PCTCN2019070594-APPB-100002
    wherein S is a total output bandwidth of the device, t is a least common divisor of bandwidths of the output ports of the device, p is a total number of ports of the output ports of the device, and f is a working clock frequency of the device.
  9. A traffic shaping device comprising a processing unit, a scheduler, and X output ports, X being a positive integer greater than or equal to 1, wherein:
    the processing unit is configured to obtain a scheduling period of the scheduler and a bucket filling period of a token bucket, where a clock period included in the bucket filling period of the token bucket is equal to a clock period included in the scheduling period of the scheduler;
    the scheduler is configured to schedule the X output ports according to the scheduling period and fill the token bucket according to the bucket filling period, where a clock period number occupied by the first port in the scheduling period is in positive correlation with a proportion occupied by a bandwidth of the first port in a total output bandwidth of the device, and the first port is any one of the X output ports.
  10. The apparatus of claim 9, wherein a bucket filling period of the token bucket is synchronized with a scheduling period of the scheduler.
  11. The apparatus according to claim 9 or 10, wherein the number h of clock cycles occupied by the first port in the scheduling period satisfies the following formula:
    Figure PCTCN2019070594-APPB-100003
    where H is the number of clock cycles included in the scheduling cycle, S1 is the bandwidth of the first port, and S is the total output bandwidth.
  12. The apparatus of claim 11, wherein a total number of tokens m to fill the token bucket for the h clock cycles over which the first port is scheduled satisfies the following equation:
    m=s1*H/f
    wherein f is the operating clock frequency of the device.
  13. The apparatus of claim 12, wherein the scheduler is configured to schedule the X output ports according to the scheduling period and to fill the token bucket according to the bucket filling period, and wherein the scheduler is configured to:
    configuring token parameters for the first port, wherein the token parameters comprise a first token parameter, the first token parameter comprises a remaining token quantity K, a first token quantity n1 and a flag bit parameter, and the flag bit parameter is used for marking one clock cycle in the h clock cycles; the initial value of the remaining token amount is equal to the total token amount m;
    scheduling the first port when the first port is scheduled in turn in the scheduling period, and judging whether the current clock period is the clock period marked by the marking bit in the token parameter;
    if not, filling the token bucket with the first token amount n1 and updating the remaining token amount K in the token parameters, wherein the updated remaining token amount is equal to the remaining token amount before updating minus the first token amount n 1;
    if yes, filling the current token quantity K into the token bucket, and initializing the residual token quantity K in the token parameters to the total token quantity m.
  14. The apparatus of claim 13, wherein the token parameters further comprise a second token parameter, wherein the second token parameter comprises a remaining token quantity K, a first token quantity n1, and a flag bit parameter, wherein the initial value of the remaining token quantity K in the second token is different from the initial value of the remaining token quantity K in the first token, and wherein the first token quantity n1 in the second token is different from the first token quantity n1 in the first token; the first token parameter is used as a basis for filling token buckets with tokens when the bandwidth of the first port is not changed, and the second token parameter is used as a basis for filling token buckets with tokens after the bandwidth of the first port is changed.
  15. The apparatus of claim 12, wherein the scheduler is configured to schedule the X output ports according to the scheduling period and to fill the token bucket according to the bucket filling period, and wherein the scheduler is configured to:
    mapping a numerical value for representing the magnitude of the token quantity for each clock cycle in the scheduling cycle; wherein the sum of the values corresponding to the h clock cycles is equal to the total token amount m;
    and scheduling the first port in the h clock cycles in the scheduling cycle, and filling the token bucket according to the value corresponding to each clock cycle in the h clock cycles.
  16. The apparatus according to any of claims 9-15, wherein the scheduling period comprises a number H of clock periods satisfying the following formula:
    Figure PCTCN2019070594-APPB-100004
    wherein S is a total output bandwidth of the device, t is a least common divisor of bandwidths of the output ports of the device, p is a total number of ports of the output ports of the device, and f is a working clock frequency of the device.
  17. A computer-readable storage medium, in which program instructions are stored, which, when run on a processor, implement the method of any one of claims 1-8.
CN201980065232.6A 2019-01-07 2019-01-07 Traffic shaping method and related equipment Active CN112805971B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/070594 WO2020142867A1 (en) 2019-01-07 2019-01-07 Traffic shaping method and related device

Publications (2)

Publication Number Publication Date
CN112805971A true CN112805971A (en) 2021-05-14
CN112805971B CN112805971B (en) 2022-07-12

Family

ID=71520649

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980065232.6A Active CN112805971B (en) 2019-01-07 2019-01-07 Traffic shaping method and related equipment

Country Status (2)

Country Link
CN (1) CN112805971B (en)
WO (1) WO2020142867A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113422736A (en) * 2021-06-16 2021-09-21 中移(杭州)信息技术有限公司 Request management method, device, equipment and program product based on token bucket
CN115378879A (en) * 2022-08-22 2022-11-22 Oppo广东移动通信有限公司 Data control method and related device
CN117041162A (en) * 2023-10-09 2023-11-10 芯耀辉科技有限公司 Traffic shaping method and device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113645148B (en) * 2021-07-01 2024-04-05 裕太微电子股份有限公司 Traffic shaper token updating system and method for time-sensitive network
CN113810307A (en) * 2021-10-11 2021-12-17 上海微盟企业发展有限公司 Data flow control method, system and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140112147A1 (en) * 2012-10-19 2014-04-24 Broadcom Corporation Refresh mechanism for a token bucket
CN104753809A (en) * 2013-12-25 2015-07-01 深圳市中兴微电子技术有限公司 Method and device for adding token into traffic shaping
CN105024942A (en) * 2015-05-29 2015-11-04 桂林电子科技大学 Dynamic flow monitoring method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100080331A1 (en) * 2008-09-26 2010-04-01 Qualcomm Incorporated Method and apparatus for integrated clock mismatch compensation and packet loss concealment
CN105656800A (en) * 2014-12-05 2016-06-08 中兴通讯股份有限公司 Method and device for transmitting message
FR3044188B1 (en) * 2015-11-25 2017-12-22 Kalray FLOW LIMITER OF TYPE "BUCKET BUCKET"

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140112147A1 (en) * 2012-10-19 2014-04-24 Broadcom Corporation Refresh mechanism for a token bucket
CN104753809A (en) * 2013-12-25 2015-07-01 深圳市中兴微电子技术有限公司 Method and device for adding token into traffic shaping
CN105024942A (en) * 2015-05-29 2015-11-04 桂林电子科技大学 Dynamic flow monitoring method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113422736A (en) * 2021-06-16 2021-09-21 中移(杭州)信息技术有限公司 Request management method, device, equipment and program product based on token bucket
CN113422736B (en) * 2021-06-16 2022-06-14 中移(杭州)信息技术有限公司 Request management method, device, equipment and storage medium based on token bucket
CN115378879A (en) * 2022-08-22 2022-11-22 Oppo广东移动通信有限公司 Data control method and related device
CN117041162A (en) * 2023-10-09 2023-11-10 芯耀辉科技有限公司 Traffic shaping method and device
CN117041162B (en) * 2023-10-09 2024-02-09 芯耀辉科技有限公司 Traffic shaping method and device

Also Published As

Publication number Publication date
CN112805971B (en) 2022-07-12
WO2020142867A1 (en) 2020-07-16

Similar Documents

Publication Publication Date Title
CN112805971B (en) Traffic shaping method and related equipment
EP1774714B1 (en) Hierarchal scheduler with multiple scheduling lanes
EP1854248B1 (en) Method and system for shaping traffic in a parallel queuing hierarchy
Huang et al. Virtual channels planning for networks-on-chip
US20080273545A1 (en) Channel service manager with priority queuing
US7843940B2 (en) Filling token buckets of schedule entries
US20160142341A1 (en) Packet scheduling using hierarchical scheduling process
Groß et al. A hardware/software co-design approach for Ethernet controllers to support time-triggered traffic in the upcoming IEEE TSN standards
EP2754050B1 (en) A method and apparatus for storing data
WO2017032075A1 (en) Quality of service multiplexing method and device, and computer storage medium
Tawk et al. Optimal scheduling and delay analysis for AFDX end-systems
AU2012395740B2 (en) Wireless backhaul system
Benacer et al. A high-speed traffic manager architecture for flow-based networking
US7599381B2 (en) Scheduling eligible entries using an approximated finish delay identified for an entry based on an associated speed group
Benacer et al. Design of a low latency 40 Gb/s flow-based traffic manager using high-level synthesis
Geetha et al. Modeling and analysis of bandwidth allocation in IEEE 802.16 MAC: A stochastic reward net approach
Sudev et al. Network-on-chip packet prioritisation based on instantaneous slack awareness
EP2947831B1 (en) Hierarchical scheduler for deterministic networking
Berejuck et al. Evaluation of silicon consumption for a connectionless network-on-chip
WO2016000326A1 (en) Method and apparatus for scheduling user queue and computer storage medium
CN109862044B (en) Conversion device, network equipment and data transmission method
Salah et al. FPGA Hardware Implementation and Evaluation of a Micro-Network Architecture for Multi-Core Systems
CN117041162B (en) Traffic shaping method and device
Sanlı et al. Hardware design and implementation of packet fair queuing algorithms for the quality of service support in the high-speed internet
Berejuck Network-on-Chip with load balancing based on interleave of flits technique

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