CN107493241B - Token distribution method and device - Google Patents

Token distribution method and device Download PDF

Info

Publication number
CN107493241B
CN107493241B CN201610416279.0A CN201610416279A CN107493241B CN 107493241 B CN107493241 B CN 107493241B CN 201610416279 A CN201610416279 A CN 201610416279A CN 107493241 B CN107493241 B CN 107493241B
Authority
CN
China
Prior art keywords
tokens
key
token bucket
service
services
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
CN201610416279.0A
Other languages
Chinese (zh)
Other versions
CN107493241A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201610416279.0A priority Critical patent/CN107493241B/en
Publication of CN107493241A publication Critical patent/CN107493241A/en
Application granted granted Critical
Publication of CN107493241B publication Critical patent/CN107493241B/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

Abstract

The embodiment of the invention provides a token distribution method and a token distribution device, wherein the number of tokens required to be consumed by each service is acquired, and the service at least comprises a key service; obtaining the number of tokens in a current token bucket; when the number of tokens to be consumed by the key service is larger than the number of tokens in the current token bucket, all tokens in the current token bucket are allocated to the key service, and the part which is not consumed by the key service is allocated after the number of tokens in the token bucket is updated and the key service is forwarded through the main link.

Description

Token distribution method and device
Technical Field
The present invention relates to the field of communications, and in particular, to a token allocation method and apparatus.
Background
When transmitting traffic data in a network, in order to prevent network congestion, a conventional token bucket algorithm is usually used to limit the traffic flowing out of the network, so that the traffic is sent out at a relatively uniform speed. A fixed-size token bucket may itself continually add tokens at a constant rate, each token in the token bucket representing a byte. If tokens are not consumed or are consumed less than the rate of generation, tokens are continually incremented until the bucket is filled, tokens added later overflow from the bucket, and finally the maximum number of tokens that can be held in the bucket never exceeds the size of the bucket. When traffic is allocated, the control mechanism of the conventional token bucket is to discard the traffic or continue to send the traffic outside the traffic limit. By adopting the scheme, the network resources are not reasonably utilized, and the problems that the service cannot be transmitted or the packet is lost are caused.
In view of the above problems, an effective method for ensuring normal service transmission, avoiding packet loss, and reasonably using network resources is proposed, which is a technical problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The embodiments of the present invention mainly solve the technical problem of providing a token allocation method and apparatus, so as to solve the problems in the prior art that a service cannot be transmitted or a packet is lost, and a network resource is unreasonable in use.
To solve the foregoing technical problem, an embodiment of the present invention provides a token allocation method, including:
acquiring the number of tokens required to be consumed by each service, wherein the service at least comprises a key service;
obtaining the number of tokens in a current token bucket;
and under the condition that the number of tokens required to be consumed by the key service is larger than the number of tokens in the current token bucket, distributing all tokens in the current token bucket to the key service, and distributing the tokens in the current token bucket when the number of tokens in the current token bucket is not enough to be consumed by the key service is updated, and forwarding the key service through the main link.
To solve the foregoing technical problem, an embodiment of the present invention provides a token assignment apparatus, including:
the acquisition module is used for acquiring the number of tokens required to be consumed by each service, and the services at least comprise key services; obtaining the number of tokens in the current token bucket;
and the processing module is used for distributing all tokens in the current token bucket to the key services under the condition that the number of the tokens required to be consumed by the key services is larger than the number of the tokens in the current token bucket, distributing the tokens in the current token bucket after the number of the tokens in the token bucket is updated when the number of the tokens required to be consumed by the key services is smaller than the number of the tokens in the current token bucket, and forwarding the key services through the main link.
In order to solve the foregoing technical problem, an embodiment of the present invention further provides a computer storage medium, where computer-executable instructions are stored in the computer storage medium, and the computer-executable instructions are used to execute the token distribution method.
The invention has the beneficial effects that:
according to the token distribution method and the token distribution device provided by the embodiment of the invention, the number of tokens required to be consumed by each service is obtained, and the service at least comprises a key service; obtaining the number of tokens in a current token bucket; when the number of tokens to be consumed by the key service is larger than the number of tokens in the current token bucket, all tokens in the current token bucket are allocated to the key service, and the part which is not consumed by the key service is allocated after the number of tokens in the token bucket is updated and the key service is forwarded through the main link.
Drawings
Fig. 1 is a flowchart of a token allocation method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a token distribution apparatus according to a second embodiment of the present invention.
Detailed Description
The following describes embodiments of the present invention in further detail with reference to the accompanying drawings.
Example one
In order to avoid the problems that the service cannot be transmitted or the packet is lost and the network resource is not reasonably utilized, the embodiment provides a token allocation method, please refer to fig. 1, which includes the following steps:
s101: and acquiring the number of tokens required to be consumed by each arrived service, wherein the service at least comprises a key service.
The key services include services such as VoIP (Voice over Internet Protocol), IPTV (Internet Protocol Television), and the like. In addition to being a critical service, a service may also include both a critical service and a non-critical service, and the non-critical service includes an Internet service and the like.
Before acquiring the number of tokens to be consumed by each service arriving, the method may further include: the arriving service is identified as being a critical service or comprising both critical and non-critical services.
S102: the number of tokens in the current token bucket is obtained.
The fixed token bucket can automatically and continuously add tokens at a constant rate, and each token in the token bucket represents one byte. If the token is not consumed or the consumed speed is less than the generated speed, the number of tokens is increased continuously until the token bucket is filled up, the tokens added later overflow from the token bucket, and finally the maximum number of tokens which can be stored in the token bucket never exceeds the size of the token bucket.
Before obtaining the number of tokens in the current token bucket, the method further comprises the following steps: and judging whether the time of the current data packet of the service reaching the token bucket and the time of the last data packet reaching the token bucket are greater than a set threshold value, for example, the set threshold value is 1 millisecond, if so, updating the number of tokens in the token bucket, and the updated number of tokens in the token bucket is the number of tokens in the current token bucket in S102. The number of tokens to be added to the token bucket may be determined according to the size of the time difference, for example, if the time difference is 2 milliseconds, 200 tokens are added to the token bucket. It should be understood that if the time difference between the current packet and the last packet is less than a certain set threshold, for example, the set threshold is 1 ms, it is not necessary to wait until the token bucket updates the number of tokens in the current token bucket, and if the number of tokens is enough for the current packet, the token is directly assigned to the current packet.
In order to ensure that the quantity of tokens in the token bucket is enough, the method for adding the tokens into the token bucket comprises at least one of the following methods:
the first method is as follows: judging whether the time of the current data packet of the service reaching the token bucket and the time of the last data packet reaching the token bucket are greater than a set threshold value or not, if so, adding tokens into the token bucket;
the second method comprises the following steps: tokens are added to the token bucket at a constant rate.
S103: and judging whether the number of tokens required to be consumed by the key service is larger than the number of tokens in the current token bucket, if so, entering S104, and if not, entering S105.
S104: and distributing all tokens in the current token bucket to the key services, distributing the parts which are not consumed by the key services after the number of the tokens in the token bucket is updated, and forwarding the key services through the main link.
Since the key service belongs to the service with higher priority and cannot be discarded, when the number of tokens to be consumed by the key service is greater than the number of tokens in the token bucket, the tokens to be consumed by the key service can be subtracted even if the current tokens in the token bucket are insufficient, the token bucket can have a red word as a negative number, and the lower limit is the negative value of the token bucket size.
The specific treatment process comprises the following steps: and when the service is a key service, all the tokens in the current token bucket are allocated to the key service. And after all the tokens are distributed, the token bucket is in a red word. The rest key services which are not distributed to the token currently wait for the updating of the number of the tokens in the token bucket, and distribute the updated tokens to the rest key services; the number of the distributed tokens is equal to the number of the tokens consumed by the rest key services, so that all the key services can be distributed to the tokens, all the key services can be forwarded through the main link, the key services cannot be lost, and network resources can be reasonably utilized. The main link includes a DSL (Digital Subscriber Line) link.
The token bucket algorithm can mark the color of the data packet according to the data flow, wherein the mark green does not exceed the rate, and the mark red is marked on the part exceeding the rate. Because the DSL link is used as the main link, the DSL negotiation rate or the reference rate of the token bucket based on the specified rate threshold is generally used, and the reference rate is used as the judgment basis for indicating green and red.
The key service belongs to the service with higher priority and can not be discarded, so the key service can not be subjected to color marking, tunnel encapsulation is not needed, and the key service is directly forwarded through a DSL link, thereby ensuring that the key service is not lost.
When the services simultaneously comprise key services and non-key services and the number of tokens consumed by the key services is larger than the number of tokens in the token bucket, the key services are processed according to the processing process. And after all the tokens are distributed, the token bucket is in a red word. As for the non-critical service, the token is not consumed, the number of tokens in the token bucket is not required to be updated, all the non-critical services are directly marked with red, and the non-critical services are transmitted through an auxiliary link after being subjected to tunnel encapsulation, so that network resources can be reasonably utilized, wherein the auxiliary link comprises an LTE (Long Term Evolution) link.
S105: and judging whether the services also comprise non-critical services, if not, entering S106, and if so, entering S107.
S106: distributing the tokens to the key services, wherein the quantity of the distributed tokens is equal to the quantity of the tokens consumed by the key services; and forward critical traffic over the primary link.
And when the service is a key service and the number of tokens required to be consumed by the key service is less than the number of tokens in the token bucket, distributing the tokens to the key service, wherein the number of the distributed tokens is equal to the number of the tokens required to be consumed by the key service. The key service belongs to the service with higher priority and can not be discarded, so the key service can not be subjected to color marking, tunnel encapsulation is not needed, and the key service is directly forwarded through the main link, thereby ensuring that the key service is not lost. The primary link comprises a DSL link.
S107: and judging whether the number of tokens which are required to be consumed by both the key service and the non-key service is larger than the number of tokens in the current token bucket, if so, entering S108, and if not, entering S109.
S108: preferentially distributing the number of tokens to be consumed by the key service to the key service, and forwarding the key service through a main link; distributing the number of the rest tokens in the current token bucket to non-critical services, and forwarding the non-critical services distributed to the tokens through a main link; and the part which is not enough for the consumption of the residual non-critical service is not distributed, and the non-critical service which is not distributed to the token is forwarded through the auxiliary link.
When the services comprise key services and non-key services, the number of tokens required to be consumed by the key services is smaller than the number of tokens in the current token bucket, and the number of tokens required to be consumed by the key services and the non-key services is larger than the number of tokens in the current token bucket, the number of tokens required to be consumed by the key services is preferentially distributed to the key services because the key services belong to services with higher priority and cannot be discarded, and the key services are forwarded through a main link so as to ensure the transmission of the key services. The key service can not be marked with color, does not need to be encapsulated by a tunnel, and can be directly forwarded through a DSL link.
Since the number of tokens to be consumed by the critical service is less than the number of tokens in the current token bucket, the tokens remain after the allocation of the tokens to the critical service.
And then all the residual token numbers in the current token bucket are distributed to non-critical services, the non-critical services distributed to the tokens are marked as green, tunnel encapsulation is carried out, and then forwarding is carried out through a main link, wherein the main link comprises a DSL link.
And after all the tokens are distributed, the token bucket is in a red word. And the part which is not consumed by the rest non-key service is not distributed, namely the non-key service which is not distributed to the token is not distributed any more, the non-key service which is not distributed to the token is marked as red, tunnel encapsulation is carried out, and then forwarding is carried out through an auxiliary link, wherein the auxiliary link comprises an LTE link, so that network resources can be reasonably utilized.
S109: and distributing the number of tokens to be consumed from the current token bucket to the key services and the non-key services, and forwarding the key services and the non-key services through the main link.
If the services comprise key services and non-key services, the number of tokens required to be consumed by the key services is less than the number of tokens in the current token bucket, and the number of tokens required to be consumed by the key services and the non-key services is less than the number of tokens in the current token bucket; distributing the number of tokens to be consumed from the current token bucket to the key services and the non-key services, and forwarding the key services and the non-key services through the main link. The key service is not marked with color, tunnel encapsulation is not needed, and forwarding can be directly carried out through a DSL link. Non-critical traffic is labeled green, tunneled, and then forwarded over the DSL link.
The key services of some operators are all systems which are already networked and mature under the DSL link before, so the key services cannot be sent out from the LTE link. The problem that key services cannot be forwarded through a DSL link and are forwarded through an LTE link to cause that the key services cannot be delivered or packet loss in the prior art is solved.
The embodiment further illustrates a specific example, and takes a user multi-service scenario as an example, where IPTV, VoIP, and Internet services are simultaneously developed, and an uplink includes an ADSL (Asymmetric Digital Subscriber Line) link and an LTE link, and the implementation process is described in detail.
Firstly, presetting needed information, such as a token adding rate, a token conversion table, a preset tunnel encapsulation rule and the like in a token bucket according to ADSL negotiation rate. Wherein the number of current tokens in the token bucket is determined by ADSL negotiation rate. The preset tunnel encapsulation rule is to tunnel encapsulate the Internet service, the IPTV service and the VoIP service are not tunnel encapsulated, and for the Internet service, the local side device needs to tunnel encapsulate in order to distinguish whether the DSL link or the LTE link. The token conversion table includes the size of the service and the number of tokens to be consumed.
Then starting IPTV and VoIP services, inquiring the number of tokens required to be consumed by the IPTV and VoIP services from the token conversion table according to the size of the IPTV and VoIP services, and then judging that the number of tokens required to be consumed by the IPTV and VoIP services is less than the number of tokens in the token bucket; distributing tokens in the token bucket to IPTV and VoIP services, wherein the quantity of the distributed tokens is equal to the quantity of the tokens consumed by the IPTV and VoIP services, forwarding the IPTV and VoIP services through an ADSL link, and the IPTV and VoIP services are not marked and not encapsulated by a tunnel; and detecting the consumption of the number of tokens in the current token bucket in real time, wherein the tokens are consumed in the token bucket and the deficit does not appear.
Then, the Internet service is added, and the data flow is gradually increased until the negotiation rate of the ADSL is exceeded, namely, the number of the tokens which are required to be consumed by the IPTV, VoIP and Internet services is inquired from the token conversion table according to the size of the IPTV, VoIP and Internet services, and then the number of the tokens which are required to be consumed by the IPTV, VoIP and Internet services is judged to exceed the number of the tokens in the current token bucket, so that the fact that the token bucket has a red word is observed, the IPTV and VoIP services are still forwarded from the ADSL link without marking colors and are not encapsulated by a tunnel. A portion of the Internet traffic, which is labeled green, forwarded from the ADSL link, and encapsulated in ADSL tunnel format, has tokens assigned to it. Another part of the Internet traffic is marked red, forwarded from the LTE link, encapsulated into LTE tunnel format, and this part of the Internet traffic is not assigned a token.
Then, the data flow of the Internet service is gradually reduced, and it can be observed that after a certain time, the number of tokens which are required to be consumed by the IPTV service, the VoIP service and the Internet service is less than the number of tokens in the current token bucket, and the condition that the token bucket is not in a word-deficit state exists, the IPTV service, the VoIP service and the Internet service can be distributed to the tokens and are all forwarded through an ADSL link, and the IPTV service and the VoIP service are not packaged in a tunnel, and the Internet service is packaged in a tunnel.
According to the scheme of the embodiment, on the premise of not influencing IPTV and VoIP services, the Internet service is routed, the Internet service is encapsulated through different tunnels, and a reasonable link is selected for forwarding, so that network resources are reasonably used.
When the link is congested, the method of this embodiment, based on the occurrence of the critical deficit of the token bucket, realizes shunting of the overloaded Internet service data to the LTE link, and ensures that the Internet service data stream is not discarded due to the limitation of the DSL bandwidth when the link is congested. The LTE link is generally charged according to flow, and the present embodiment is an effective decision charging scheme by using the rate based on the data packet as the decision criterion.
According to the token allocation method provided by the embodiment, the number of tokens required to be consumed by each service is acquired, and the service at least comprises key services; obtaining the number of tokens in a current token bucket; when the number of tokens to be consumed by the key service is larger than the number of tokens in the current token bucket, all tokens in the current token bucket are allocated to the key service, and the part which is not consumed by the key service is allocated after the number of tokens in the token bucket is updated and the key service is forwarded through the main link.
Example two
In order to avoid the problem that the service cannot be transmitted or the packet is lost, the present embodiment provides a token allocation apparatus, please refer to fig. 2, which includes:
an obtaining module 201, configured to obtain the number of tokens that need to be consumed by each service that arrives, where the service at least includes a key service; and obtaining the number of tokens in the current token bucket.
The key services include services such as VoIP and IPTV. In addition to being a critical service, a service may also include both a critical service and a non-critical service, and the non-critical service includes an Internet service and the like.
Before acquiring the number of tokens to be consumed by each service arriving, the method may further include: the arriving service is identified as being a critical service or comprising both critical and non-critical services.
The processing module 202 is configured to, when the number of tokens that the key service needs to consume is greater than the number of tokens in the current token bucket, allocate all tokens in the current token bucket to the key service, and when the number of tokens in the token bucket is not consumed, wait for the update of the number of tokens in the token bucket to allocate the tokens, and forward the key service through the main link.
The fixed token bucket can automatically and continuously add tokens at a constant rate, and each token in the token bucket represents one byte. If the token is not consumed or the consumed speed is less than the generated speed, the number of tokens is increased continuously until the token bucket is filled up, the tokens added later overflow from the token bucket, and finally the maximum number of tokens which can be stored in the token bucket never exceeds the size of the token bucket.
Further comprising: an updating module 203, configured to update the number of tokens in the token bucket if a time distance from a current packet of the service to the token bucket to a time when a previous packet arrives at the token bucket is greater than a set threshold, for example, the set threshold is 1 millisecond, before the obtaining module 201 obtains the number of tokens in the current token bucket. The updated number of tokens in the token bucket is the number of tokens in the current token bucket acquired by the acquisition module 201. The number of tokens to be added to the token bucket may be determined according to the size of the time difference, for example, if the time difference is 2 milliseconds, 200 tokens are added to the token bucket. It should be understood that if the time difference between the current packet and the previous packet is less than a certain set threshold, for example, the set threshold is 1 ms, the processing module 202 does not wait until the token bucket updates the number of tokens in the current token bucket, and if the number of tokens is enough for the current packet, the processing module directly assigns the token to the current packet.
In order to ensure that the quantity of tokens in the token bucket is enough, the method for adding the tokens into the token bucket comprises at least one of the following methods:
the first method is as follows: judging whether the time of the current data packet of the service reaching the token bucket and the time of the last data packet reaching the token bucket are greater than a set threshold value or not, if so, adding tokens into the token bucket;
the second method comprises the following steps: tokens are added to the token bucket at a constant rate.
Since the key service belongs to the service with higher priority and cannot be discarded, when the number of tokens to be consumed by the key service is greater than the number of tokens in the token bucket, the tokens to be consumed by the key service can be subtracted even if the current tokens in the token bucket are insufficient, the token bucket can have a red word as a negative number, and the lower limit is the negative value of the token bucket size.
The specific processing procedure of the processing module 202 is as follows: and when the service is a key service, all the tokens in the current token bucket are allocated to the key service. And after all the tokens are distributed, the token bucket is in a red word. The rest key services which are not distributed to the token currently wait for the updating of the number of the tokens in the token bucket, and distribute the updated tokens to the rest key services; the number of the distributed tokens is equal to the number of the tokens consumed by the rest key services, so that all the key services can be distributed to the tokens, all the key services can be forwarded through the main link, the key services cannot be lost, and network resources can be reasonably utilized. Wherein the primary link comprises a DSL link.
The token bucket algorithm can mark the color of the data packet according to the data flow, wherein the mark green does not exceed the rate, and the mark red is marked on the part exceeding the rate. Because the DSL link is used as the main link, the DSL negotiation rate or the reference rate of the token bucket based on the specified rate threshold is generally used, and the reference rate is used as the judgment basis for indicating green and red.
The key service belongs to the service with higher priority and can not be discarded, so the key service can not be subjected to color marking, tunnel encapsulation is not needed, and the key service is directly forwarded through a DSL link, thereby ensuring that the key service is not lost.
When the service includes both critical service and non-critical service, and the number of tokens to be consumed by the critical service is greater than the number of tokens in the token bucket, the processing module 202 processes the critical service according to the above processing procedure. And after all the tokens are distributed, the token bucket is in a red word. As for the non-critical services, tokens do not need to be consumed, the number of tokens in the token bucket does not need to be updated, all the non-critical services are directly marked with red, and the non-critical services are transmitted through an auxiliary link after being subjected to tunnel encapsulation, so that network resources can be reasonably utilized, and the auxiliary link comprises an LTE link.
The processing module 202 is configured to: if the service only comprises the key service and the number of tokens required to be consumed by the key service is less than the number of tokens in the current token bucket, distributing the tokens to the key service, wherein the number of the distributed tokens is equal to the number of the tokens required to be consumed by the key service; and forward critical traffic over the primary link. The key service belongs to the service with higher priority and can not be discarded, so the key service can not be subjected to color marking, tunnel encapsulation is not needed, and the key service is directly forwarded through the main link, thereby ensuring that the key service is not lost. The primary link comprises a DSL link.
The processing module 202 is configured to: if the services comprise key services and non-key services, the number of tokens required to be consumed by the key services is less than the number of tokens in the current token bucket, and the number of tokens required to be consumed by the key services and the non-key services is greater than the number of tokens in the current token bucket; the key service belongs to the service with higher priority and can not be discarded, so the token number consumed by the key service is preferentially distributed to the key service, and the key service is forwarded through the main link to ensure the transmission of the key service; the key service can not be marked with color, does not need to be encapsulated by a tunnel, and can be directly forwarded through a DSL link.
Since the number of tokens to be consumed by the critical service is less than the number of tokens in the current token bucket, the tokens remain after the allocation of the tokens to the critical service. And distributing the number of the remaining tokens in the current token bucket to non-critical services, marking the non-critical services distributed to the tokens as green, performing tunnel encapsulation, and then forwarding through a main link, wherein the main link comprises a DSL link.
And after all the tokens are distributed, the token bucket is in a red word. And the part which is not consumed by the rest non-key service is not distributed, namely the non-key service which is not distributed to the token is not distributed any more, the non-key service which is not distributed to the token is marked as red, tunnel encapsulation is carried out, and then forwarding is carried out through an auxiliary link, wherein the auxiliary link comprises an LTE link, so that network resources can be reasonably utilized.
The processing module 202 is configured to: if the services comprise key services and non-key services, the number of tokens required to be consumed by the key services is less than the number of tokens in the current token bucket, and the number of tokens required to be consumed by the key services and the non-key services is less than the number of tokens in the current token bucket; distributing the number of tokens to be consumed from the current token bucket to the key services and the non-key services, and forwarding the key services and the non-key services through the main link. The key service is not marked with color, tunnel encapsulation is not needed, and forwarding can be directly carried out through a DSL link. Non-critical traffic is labeled green, tunneled, and then forwarded over the DSL link.
The key services of some operators are all systems which are already networked and mature under the DSL link before, so the key services cannot be sent out from the LTE link. The problem that key services cannot be forwarded through a DSL link and are forwarded through an LTE link to cause that the key services cannot be delivered or packet loss in the prior art is solved.
The embodiment further illustrates a specific example, which takes a user multi-service scenario as an example, where IPTV, VoIP, and Internet services are simultaneously developed, and an uplink includes an ADSL link and an LTE link, which is specifically as follows:
firstly, presetting needed information, such as a token adding rate, a token conversion table, a preset tunnel encapsulation rule and the like in a token bucket according to ADSL negotiation rate. Wherein the number of current tokens in the token bucket is determined by ADSL negotiation rate. The preset tunnel encapsulation rule is to tunnel encapsulate the Internet service, the IPTV service and the VoIP service are not tunnel encapsulated, and for the Internet service, the local side device needs to tunnel encapsulate in order to distinguish whether the DSL link or the LTE link. The token conversion table includes the size of the service and the number of tokens to be consumed.
Then, IPTV and VoIP services are started, the acquisition module 201 inquires the number of tokens required to be consumed by the IPTV and VoIP services from the token conversion table according to the size of the IPTV and VoIP services, if the number of the tokens required to be consumed by the IPTV and VoIP services is smaller than the number of the tokens in the token bucket, the processing module 202 allocates the tokens in the token bucket to the IPTV and VoIP services, the number of the allocated tokens is equal to the number of the tokens required to be consumed by the IPTV and VoIP services, the IPTV and VoIP services are forwarded through an ADSL link, and the IPTV and VoIP services are not marked and are not encapsulated by a tunnel; and detecting the consumption of the number of tokens in the current token bucket in real time, wherein the tokens are consumed in the token bucket and the deficit does not appear.
Then, the Internet service is added, and the data flow is gradually increased until the ADSL negotiation rate is exceeded, that is, the obtaining module 201 queries the number of tokens that are required to be consumed by the IPTV, VoIP, and Internet services from the token conversion table according to the size of the IPTV, VoIP, and Internet services, and if the number of tokens that are required to be consumed by the IPTV, VoIP, and Internet services exceeds the number of tokens in the current token bucket, it is observed that a red word appears in the token bucket, and the processing module 202 forwards the IPTV and VoIP services from the ADSL link, without marking color, and without being encapsulated by a tunnel. A portion of the Internet traffic, which is labeled green, forwarded from the ADSL link, and encapsulated in ADSL tunnel format, has tokens assigned to it. Another part of the Internet traffic is marked red, forwarded from the LTE link, encapsulated into LTE tunnel format, and this part of the Internet traffic is not assigned a token.
Then, the data flow of the Internet service is gradually reduced, it can be observed that after a certain time, the number of tokens which are required to be consumed by the IPTV, VoIP and Internet services is smaller than the number of tokens in the current token bucket, and there is no condition that the token bucket is a red word, the processing module 202 allocates tokens to the IPTV, VoIP and Internet services, and the IPTV, VoIP and Internet services are all forwarded through ADSL links, and the IPTV, VoIP services have no tunnel encapsulation, and the Internet services have tunnel encapsulation.
According to the scheme of the embodiment, on the premise of not influencing IPTV and VoIP services, the Internet service is routed, the Internet service is encapsulated through different tunnels, and a reasonable link is selected for forwarding, so that network resources are reasonably used.
According to the token allocation apparatus provided by the embodiment, the number of tokens to be consumed by each service that arrives is obtained by the obtaining module 201, the service at least includes a key service, and the number of tokens in the current token bucket is obtained; when the number of tokens to be consumed by the key service is greater than the number of tokens in the current token bucket, the processing module 202 allocates all tokens in the current token bucket to the key service, and the portion that is not consumed by the key service is allocated after waiting for the update of the number of tokens in the token bucket, and forwards the key service through the main link. By adopting the scheme, all key services can be distributed to the tokens, and the key services are forwarded through the main link, so that the key services are not lost, and network resources can be reasonably utilized.
There is also provided in another embodiment a computer storage medium having computer-executable instructions stored therein for performing the token assignment method of any one of the embodiments.
It will be apparent to those skilled in the art that the modules or steps of the above-described embodiments of the present invention may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed over a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored on a storage medium (ROM/RAM, magnetic disk, optical disk) and executed by a computing device, and in some cases, the steps shown or described may be executed out of order from that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The foregoing is a more detailed description of embodiments of the present invention, and the present invention is not to be considered limited to such descriptions. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.

Claims (8)

1. A token assignment method, comprising:
acquiring the number of tokens required to be consumed by each service, wherein the service at least comprises a key service;
obtaining the number of tokens in a current token bucket;
when the number of tokens to be consumed by the key service is larger than the number of tokens in the current token bucket, distributing all the tokens in the current token bucket to the key service, and when the number of tokens in the current token bucket is less than the number of tokens consumed by the key service, distributing the tokens after waiting for updating the number of tokens in the token bucket, and forwarding the key service through a main link;
before the obtaining of the number of tokens in the current token bucket, the method further includes:
under the condition that the time difference value of the time when the current data packet of the service reaches the token bucket and the time when the last data packet reaches the token bucket is greater than a set threshold value, updating the number of the tokens in the token bucket; and determining the number of the tokens added into the token bucket according to the time difference.
2. The token assignment method of claim 1, further comprising: when the services comprise the key services and the non-key services, the number of tokens required to be consumed by the key services is less than the number of tokens in the current token bucket, and the number of tokens required to be consumed by the key services and the non-key services is less than the number of tokens in the current token bucket;
distributing the number of tokens to be consumed from the current token bucket to the key services and the non-key services, and forwarding the key services and the non-key services through the main link.
3. The token assignment method of claim 1, further comprising: under the condition that the services comprise the key services and the non-key services, the number of tokens required to be consumed by the key services is less than the number of tokens in the current token bucket, and the number of tokens required to be consumed by the key services and the non-key services is greater than the number of tokens in the current token bucket;
preferentially distributing the number of tokens to be consumed by the key service to the key service, and forwarding the key service through the main link;
distributing the number of the remaining tokens in the current token bucket to the non-critical service, and forwarding the non-critical service distributed to the tokens through the main link;
and if the part is not enough to be consumed by the rest of the non-critical service, not distributing the part, and forwarding the non-critical service which is not distributed to the token through an auxiliary link.
4. The token assignment method of claim 3, wherein the primary link comprises a digital subscriber line link and the secondary link comprises a long term evolution link.
5. A token assignment apparatus, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring the number of tokens required to be consumed by each service, and the service at least comprises key services; obtaining the number of tokens in the current token bucket;
the processing module is used for distributing all the tokens in the current token bucket to the key services under the condition that the number of the tokens required to be consumed by the key services is larger than the number of the tokens in the current token bucket, and distributing the tokens when the number of the tokens in the current token bucket is less than the number of the tokens consumed by the key services after the number of the tokens in the token bucket is updated, and forwarding the key services through a main link;
wherein the apparatus further comprises: the updating module is used for updating the number of the tokens in the token bucket under the condition that the time difference value of the time of the current data packet of the service reaching the token bucket and the time of the data packet reaching the token bucket is greater than a set threshold value; and determining the number of the tokens added into the token bucket according to the time difference.
6. The token assignment apparatus of claim 5, wherein the processing module is to: when the services comprise the key services and the non-key services, the number of tokens required to be consumed by the key services is less than the number of tokens in the current token bucket, and the number of tokens required to be consumed by the key services and the non-key services is less than the number of tokens in the current token bucket; distributing the number of tokens to be consumed from the current token bucket to the key services and the non-key services, and forwarding the key services and the non-key services through the main link.
7. The token assignment apparatus of claim 5, wherein the processing module is to: under the condition that the services comprise the key services and the non-key services, the number of tokens required to be consumed by the key services is less than the number of tokens in the current token bucket, and the number of tokens required to be consumed by the key services and the non-key services is greater than the number of tokens in the current token bucket;
preferentially distributing the number of tokens to be consumed by the key service to the key service, and forwarding the key service through the main link;
distributing the number of the remaining tokens in the current token bucket to the non-critical service, and forwarding the non-critical service distributed to the tokens through the main link;
and if the part is not enough to be consumed by the rest of the non-critical service, not distributing the part, and forwarding the non-critical service which is not distributed to the token through an auxiliary link.
8. The token assignment apparatus of claim 7, wherein the primary link comprises a digital subscriber line link and the secondary link comprises a long term evolution link.
CN201610416279.0A 2016-06-13 2016-06-13 Token distribution method and device Active CN107493241B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610416279.0A CN107493241B (en) 2016-06-13 2016-06-13 Token distribution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610416279.0A CN107493241B (en) 2016-06-13 2016-06-13 Token distribution method and device

Publications (2)

Publication Number Publication Date
CN107493241A CN107493241A (en) 2017-12-19
CN107493241B true CN107493241B (en) 2022-04-12

Family

ID=60642942

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610416279.0A Active CN107493241B (en) 2016-06-13 2016-06-13 Token distribution method and device

Country Status (1)

Country Link
CN (1) CN107493241B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110545246B (en) * 2018-05-29 2023-12-08 北京京东尚科信息技术有限公司 Token bucket-based current limiting method, device and computer readable medium
CN114095444B (en) * 2020-07-15 2023-11-10 中移物联网有限公司 Current limiting method and device and electronic equipment
CN114745682B (en) * 2022-02-28 2023-08-18 联想(北京)有限公司 Processing method and control plane network element
CN114979012A (en) * 2022-05-31 2022-08-30 济南浪潮数据技术有限公司 Network flow current limiting method, system, device and computer storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7457313B2 (en) * 2000-09-25 2008-11-25 General Instrument Corporation Hierarchical prioritized round robin (HPRR) scheduling
CN101621457A (en) * 2008-07-01 2010-01-06 大唐移动通信设备有限公司 Multi-service scheduling method and system
CN101959236A (en) * 2009-07-13 2011-01-26 大唐移动通信设备有限公司 Traffic control method and device
CN102843775A (en) * 2012-09-11 2012-12-26 福建星网锐捷网络有限公司 Dispatching method, dispatching device and network equipment
CN102932272A (en) * 2012-11-23 2013-02-13 迈普通信技术股份有限公司 Message forwarding method and forwarding device based on flow capacity
CN104079499A (en) * 2014-07-18 2014-10-01 福建星网锐捷网络有限公司 Message processing method and device based on token buckets
CN104125006A (en) * 2014-07-28 2014-10-29 大连大学 Satellite communication network bandwidth distributing method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100396009C (en) * 2006-02-23 2008-06-18 华为技术有限公司 Method and system for control bandwidth
CN101360049B (en) * 2008-09-23 2011-02-09 福建星网锐捷网络有限公司 Packet forwarding method and apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7457313B2 (en) * 2000-09-25 2008-11-25 General Instrument Corporation Hierarchical prioritized round robin (HPRR) scheduling
CN101621457A (en) * 2008-07-01 2010-01-06 大唐移动通信设备有限公司 Multi-service scheduling method and system
CN101959236A (en) * 2009-07-13 2011-01-26 大唐移动通信设备有限公司 Traffic control method and device
CN102843775A (en) * 2012-09-11 2012-12-26 福建星网锐捷网络有限公司 Dispatching method, dispatching device and network equipment
CN102932272A (en) * 2012-11-23 2013-02-13 迈普通信技术股份有限公司 Message forwarding method and forwarding device based on flow capacity
CN104079499A (en) * 2014-07-18 2014-10-01 福建星网锐捷网络有限公司 Message processing method and device based on token buckets
CN104125006A (en) * 2014-07-28 2014-10-29 大连大学 Satellite communication network bandwidth distributing method

Also Published As

Publication number Publication date
CN107493241A (en) 2017-12-19

Similar Documents

Publication Publication Date Title
CN107493241B (en) Token distribution method and device
US7756026B2 (en) Providing a quality of service for various classes of service for transfer of electronic data packets
CN110121867B (en) Method for transmitting data packet, sending equipment and receiving equipment
US8908522B2 (en) Transmission rate control
US20110222406A1 (en) Method And Device For Enabling Indication Of Congestion In A Telecommunications Network
US10225195B2 (en) Telecommunication systems and methods using dynamic shaping for allocating network bandwidth
US8553708B2 (en) Bandwith allocation method and routing device
RU2427091C2 (en) Device and method for speed limit-based flow control for mstp device
WO2016105010A1 (en) Method and device for providing transmission differentiation in mobile communication system
US11695702B2 (en) Packet forwarding apparatus, method and program
CN102449956A (en) Method, apparatus and device for adjusting resource delegation in network
WO2021147368A1 (en) Method and apparatus for adjusting service level, device, system and storage medium
CN112152863B (en) Distributed bandwidth allocation method and device
CN101212467B (en) MPLS network service scheduling method
EP2767046B1 (en) Optimised packet delivery across a transport network
US20150195209A1 (en) Congestion Notification in a Network
CN106921588B (en) Flow control method, device and equipment
JP5546220B2 (en) Communication system and bandwidth allocation control method
EP1978682B1 (en) QoS CONTROL METHOD AND SYSTEM
CN103988459B (en) In the method optimized towards run time in packet mobile wireless transmission of data message
WO2016093648A1 (en) Method and device for controlling congestion in mobile communication system
CN109756936B (en) Stream mapping method, stream receiving method, network device and terminal
KR20170111455A (en) WIRED/WIRELESS INTEGRATED NETWORK APPLIED MAPPING METHOD FOR QoS GUARANTEE AND UPSTREAM DATA TRASMISSION METHOD
US20120057605A1 (en) Bandwidth Control Method and Bandwidth Control Device
JP4536047B2 (en) Admission control apparatus and method

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