WO2017161967A1 - Method of monitoring data traffic in packets per second, device, and computer storage medium - Google Patents

Method of monitoring data traffic in packets per second, device, and computer storage medium Download PDF

Info

Publication number
WO2017161967A1
WO2017161967A1 PCT/CN2017/072869 CN2017072869W WO2017161967A1 WO 2017161967 A1 WO2017161967 A1 WO 2017161967A1 CN 2017072869 W CN2017072869 W CN 2017072869W WO 2017161967 A1 WO2017161967 A1 WO 2017161967A1
Authority
WO
WIPO (PCT)
Prior art keywords
token
tokens
data packet
target service
current data
Prior art date
Application number
PCT/CN2017/072869
Other languages
French (fr)
Chinese (zh)
Inventor
胡学权
Original Assignee
深圳市中兴微电子技术有限公司
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 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2017161967A1 publication Critical patent/WO2017161967A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0888Throughput
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic

Definitions

  • the present invention relates to a traffic policing technology in the field of communication technologies, and in particular, to a packet per second (pps, packet per second) traffic policing method, apparatus, and computer storage medium.
  • IPTV interactive network television
  • VoIP Voice over Internet Protocol
  • video conferencing video conferencing
  • QoS quality of service
  • CAR Committed Access Rate
  • the total number of bytes allowed to be accessed by the user is limited, for example, the maximum download speed of the limited user is 10 Mbps/s; (2) the total number of data packets allowed to be accessed by the user. It is limited, for example, to limit the number of packets sent by users per second to less than 100.
  • the existing communication network separately sets two sets of traffic policing devices: bit per second (bps, bits per second) traffic policing device, that is, how many bits are allowed per second, bps traffic policing device Corresponding to the above requirement (1); pps traffic policing device, that is, how many data packets are allowed per second, the pps traffic policing device corresponds to the above requirement (2).
  • bit per second (bps, bits per second) traffic policing device that is, how many bits are allowed per second
  • bps traffic policing device Corresponding to the above requirement (1)
  • pps traffic policing device that is, how many data packets are allowed per second
  • the pps traffic policing device corresponds to the above requirement (2).
  • the traffic policing device includes: a token generator 101, a token bucket 102, a token discriminating module 103, and a token update module 104.
  • the token generator 101 is configured to add a token to the token bucket at a predetermined rate. For example, if the network allows the user to send 5 Mbps of data traffic and 32 tokens represent 1 bit, the token generator 101 will be at a rate of 5 M*32 tokens per second, which is smaller than the second.
  • the token is added to the token bucket at a constant speed; the token bucket 102 contains two parameters, one is the remaining token, indicating how many bytes of data packets can be sent, and the other is the token bucket.
  • Depth the token generated by the token generator 101 will be accumulated in the token bucket 102. When the accumulation is greater than the depth of the token bucket, the token will overflow, preventing the token from accumulating in a large amount of time without the packet, and then A large number of data packets have arrived at a time. Since the tokens have accumulated a lot, at this time, all the data packets will be sent out, which will have a huge impact on the network.
  • the tokens cannot be accumulated indefinitely, but when accumulated to a certain value, the order is added. Card is considered as none Token; the token discriminating module 103, when the data packet arrives, determines whether the remaining tokens in the token bucket 102 are sufficient for the data packet to pass, and if the token is sufficient, the data packet passes, otherwise the data packet is discarded; the token update module 104. After the data packet is passed, the token in the token bucket 102 is subtracted from the number of tokens corresponding to the data packet; based on the bps traffic policing device, the total number of bytes (user traffic) for allowing the user to access is implemented. A packet that is limited to a data traffic that is allowed to be sent by the user, which is preset by the traffic policing device, will be discarded.
  • the existing pps traffic policing technology is prone to cause traffic bursts of communication devices, which cannot guarantee the packet loss rate of services and affect the service quality of services.
  • the embodiments of the present invention are directed to providing a packet per second traffic monitoring method, apparatus, and computer storage medium, which are expected to reduce the probability of occurrence of traffic bursts and improve service quality.
  • the embodiment of the invention provides a packet per second traffic monitoring method, including:
  • the embodiment of the invention further provides a packet per second traffic monitoring device, including:
  • Adding a module configured to determine a token addition rate according to the obtained number of tokens to be forwarded for each packet of a preset length and an agreed traffic rate of the target service, and a uniform rate according to the token addition rate Add a token to the card storage module;
  • the response module is configured to: in response to the forwarding request of the current data packet of the target service, determine that the current number of tokens in the token storage module meets a preset condition, and forward the current data packet of the target service, and The number of tokens that need to be consumed to forward the current data packet of the target service is deleted from the token storage module.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the packet per second traffic monitoring method.
  • the set value is used to configure the number of packets allowed to pass, and the number of packets that each packet will be allowed to pass is reduced by one.
  • the number of packets allowed to pass per second is converted into a token addition rate, and tokens are added to the token storage module uniformly according to the token addition rate, and each packet is from the token storage module.
  • FIG. 1 is a schematic diagram of a working principle of a bps traffic monitoring device
  • FIG. 2 is a schematic diagram showing the working principle of another pps flow monitoring device
  • FIG. 3 is a schematic flowchart of a first method for monitoring traffic per second according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart of a second method for monitoring traffic per second according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a first packet per second traffic monitoring apparatus according to an embodiment of the present disclosure
  • FIG. 6 is a schematic structural diagram of a second packet per second traffic monitoring apparatus according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of a third packet per second traffic monitoring apparatus according to an embodiment of the present invention.
  • an implementation manner of the pps traffic policing technology is to configure the number of allowed packets to be set at the beginning of each second.
  • the pps traffic policing device 201 decrements the number of packets allowed to pass until the number of allowed packets is zero, that is, the number of packets that have passed in one second is determined to be greater than the set value, thus, The incoming packets of the remaining time of 1 second will be completely discarded by the pps traffic policing device 201; this has the following problems: a) If a large number of data packets come from the start time per second, so that the preceding data packets are passed in a large amount, The traffic of the communication equipment is relatively large; b) the probability of passing the data packet starting every second is far greater than that of the subsequent data packet, and the communication equipment generally expects the same type of data packet, and the packet loss rate is relatively balanced.
  • the traffic policing device can be implemented in various manners, for example, implementing all components of the traffic policing device in a network device such as a network processor or a router (for example, the traffic policing device can be integrated into the foregoing network device) Or, the components in the traffic policing device are implemented in a coupled manner on the network device side described above.
  • This embodiment describes a method for advertised traffic per second packet, which can be applied to the following scenarios: It is desirable to reduce the traffic burst and improve the service quality of the service while implementing the pps traffic policing function. Be explained.
  • the packet per second traffic monitoring method described in this embodiment includes the following steps:
  • Step 301 Determine a token addition rate according to the obtained number of tokens consumed for forwarding a data packet of a preset length and an agreed traffic rate of the target service.
  • the traffic policing device pre-acquires the number of tokens that need to be consumed for forwarding a data packet of a preset length; the preset length is a fixed value; optionally, each forwarding is performed.
  • the implementation of the number of tokens to be consumed by the preset length packet may include any of the following methods:
  • the traffic policing device acquires the number of tokens that need to be consumed for each bit of data to be forwarded, and determines a preset length for each forwarding based on the preset length and the number of tokens that need to be consumed for each data that is forwarded by one bit.
  • the number of tokens that the packet needs to consume for example, the traffic policing device calculates the product of the preset length and the number of tokens consumed per data of one bit of forwarding, and determines the product value as a preset for each forwarding.
  • the number of tokens that need to be consumed by the length of the data packet for example, suppose that the number of tokens consumed per data for forwarding one bit is 32, and the preset length of the data packet is 64 bits, each time a predetermined length is forwarded
  • the number of tokens that a packet needs to consume is 2048 (that is, 32*64).
  • Mode 2 configured in advance in the traffic policing device, required to forward a predetermined length of data packets The number of tokens to consume.
  • the traffic policing device calculates a product of the number of tokens consumed per forwarded packet of a preset length and the agreed traffic rate of the target service based on the number of tokens required to retrieve each packet of a predetermined length.
  • the product value is determined as the token addition rate; for example, if the number of tokens required to forward a predetermined length of data packet is 2048, and the agreed traffic rate (pps regulatory requirement) of the target service is 100 pps, the token
  • the rate of the addition is equal to 204800 (that is, 2048*100), and the unit of the token addition rate may be the token per second.
  • the agreed traffic rate of the target service may be the committed information rate (CIR, Committed Information Rate) of the target service or exceed the information rate ( EIR, Excess Information Rate, etc.; the agreed traffic rate of the target service can be configured in advance in the traffic policing device.
  • CIR Committed Information Rate
  • EIR Excess Information Rate
  • Step 302 Add a token to the token storage module according to the token addition rate.
  • the traffic policing device puts 204,800 tokens into the token storage module every second; it should be noted that the traffic policing device needs to go every second.
  • the number of tokens added in the token storage module is not added in one time. Instead, the tokens are added to the token storage module in a time-division manner. For example, the traffic policing device goes to the token storage module each time. The number of added tokens is 102,400.
  • the token storage module can be a token bucket.
  • the token added by the traffic policing device to the token storage module is accumulated in the token storage module, that is, the number of remaining tokens in the token storage module, when the traffic policing device determines that the number of remaining tokens in the token storage module exceeds When the depth of the token storage module is exceeded, the token overflows.
  • the traffic policing device treats the exceeded token as an invalid token, preventing the occurrence of the token, that is, the token is accumulated in a large amount of time when no packet needs to be forwarded, and then At the moment of receiving, a large number of data packets need to be forwarded. At this time, since the token has accumulated a lot, at this time, all the data packets are sent out, and the data will be set.
  • the tokens in the token storage module cannot be accumulated indefinitely, but when accumulated to a certain value (for example, the depth of the token storage module), the token that continues to be added is regarded as an invalid token.
  • Step 303 Respond to the forwarding request of the current data packet of the target service, and determine that the remaining number of tokens in the token storage module meets the preset condition, and forward the current data packet of the target service.
  • the traffic policing device receives the forwarding request of the current data packet of the target service, or the traffic policing device determines the token storage module according to the current data packet of the current data packet of the target service for the current data packet of the home target service that reaches the specified device port. If the number of remaining tokens in the token meets the preset condition, if the current packet of the target service is forwarded, if the number of remaining tokens in the token storage module does not satisfy the preset condition, the current traffic rate of the target service exceeds The agreed traffic rate (pps supervision requirement) of the target service.
  • the traffic policing device considers the current data packet of the target service as an overrun, and discards or caches the current data packet of the target service; here, the traffic policing device can The limited data packet is buffered, and the data packet buffered by the overrun is forwarded when the number of remaining tokens in the token storage module is determined to meet the preset condition; the traffic policing device may also pre-borrow the order from the token storage module.
  • the card forwards the overrun packet;
  • the feature information of the packet may include the length of the packet, the QoS class , Data such as information home service; alternatively, the length of the current packet data service may be equal to a target preset length; alternatively, the length of each of the target traffic packet are equal to a preset length.
  • Step 304 Delete, from the token storage module, the number of tokens that need to be consumed to forward the current data packet of the target service.
  • the traffic policing device converts the number of data packets allowed to pass per second into a token addition rate, and adds a token to the token storage module in a time-average manner according to the token addition rate, and each data packet is ordered from the token.
  • the token used in the card storage module to delete the forwarded data packet Because the token is added to the token storage module based on the token addition rate in a time-based manner, it can avoid the traffic burst at the start time per second and ensure the packet loss ratio of the same type of data packet. Balance, so, can reduce business traffic bursts and improve business service quality.
  • the embodiment is based on the first embodiment.
  • the preset condition in the embodiment includes: whether the number of remaining tokens in the token storage module is greater than the number of tokens to be consumed by the current data packet of the forwarding destination service.
  • the packet per second traffic monitoring method described in this embodiment includes the following steps:
  • Step 401 The traffic policing device determines the token adding rate according to the obtained number of tokens consumed for forwarding a preset length of data packet and the agreed traffic rate of the target service.
  • Step 402 Add a token to the token storage module according to the token addition rate.
  • Step 403 When receiving the current data packet of the target service, determine the current data of the forwarding target service based on the number of tokens that need to be consumed for each data packet that is forwarded by a preset length, and the length of the current data packet of the target service. The number of tokens that the package needs to consume.
  • the traffic policing device when receiving the current data packet of the target service, the traffic policing device first determines the length of the current data packet according to the feature information of the current data packet of the target service.
  • Step 404 Determine whether the number of remaining tokens in the token storage module is greater than the number of tokens needed to forward the current data packet of the target service. If yes, go to step 406; otherwise, go to step 405.
  • Step 405 Discard or cache the current data packet of the target service; then, the process ends.
  • Step 406 Forward the current data packet of the target service.
  • Step 407 Delete, from the token storage module, the number of tokens that need to be consumed to forward the current data packet of the target service.
  • the present embodiment describes a packet-per-second traffic policing device, which proposes a solution for the following scenarios: the existing traffic policing technologies respectively set two sets of traffic policing devices to implement traffic policing requirements. It takes up more logic resources and increases the design complexity of the chip in traffic supervision.
  • the packet-per-second traffic policing device described in this embodiment is actually used to multiplex and improve the existing bps traffic policing device.
  • the improved bps traffic policing device can be used to implement the technical solution in the foregoing embodiment. The processing of this case will be explained.
  • an optional structural diagram of a packet per second traffic monitoring device includes: a token generator 501, a token bucket 502, a token discriminating module 503, and an The card update module 504; it should be noted that the packet per second traffic monitoring device can implement bps traffic through the cooperation and cooperation of the token generator 501, the token bucket 502, the token discriminating module 503, and the token update module 504.
  • the functions of the modules are enhanced, specifically ,
  • the rate at which the token generator 501 adds a token to the token bucket 502 is associated with the number of data packets. It is assumed that the number of tokens consumed for forwarding a predetermined length of data packet is 10000, pps The regulatory requirement (e.g., the agreed traffic rate of the target service) is 100 pps, and the token generator 501 needs to add a token to the token bucket 502 at a constant rate of 100*10000 tokens per second.
  • a token bucket 502 for storing a token added by the token generator 501; the token bucket 502 has at least two parameters: a remaining token number, a bucket depth (a depth of the token bucket), wherein the remaining The number of tokens is used to evaluate (calculate) how many packets the scheduler can send; if the bucket is deep, if the number of tokens remaining in the token bucket is greater than the bucket depth, the token is discarded, where the bucket is deep, indicating that burst data is allowed. The number of packets, assuming that a burst of up to 50 packets is allowed, the token bucket depth is set to 50*10000.
  • the token discriminating module 503 is configured to determine, when the data packet arrives, whether the number of remaining tokens in the token bucket 502 is greater than or equal to the number of tokens (10000) consumed to forward a data packet, if the remaining tokens If the number is greater than or equal to 10000, the packet is forwarded, otherwise the packet is discarded.
  • the token update module 504 is configured to: after the data packet passes, subtract the token corresponding to the data packet from the token in the token bucket 502, indicating that a data packet has been forwarded, for example, the token bucket.
  • the number of tokens in 502 is reduced by 10,000.
  • the invention adopts the following technical solutions: the first step: using the leaky bucket (token bucket) for bps supervision; the second step: if the leaky bucket needs to be used for pps supervision, each packet passes through the leaky bucket and is fixed. The length is judged and deducted.
  • this embodiment avoids designing a pps supervision module separately, and only needs to improve the existing bps traffic policing device, so that the improved bps traffic policing module can support both the bps traffic policing requirement and the pps traffic.
  • the regulatory requirements enable efficient reuse of the bps traffic policing module, reducing the module design area and complexity, saving logic resources for traffic policing, and reducing the design complexity of the chip in traffic policing.
  • implementing pps The traffic policing function can reduce traffic bursts and improve service quality.
  • the present embodiment is directed to the foregoing traffic policing device.
  • the traffic policing device may be used to perform the traffic policing method according to the embodiment of the present invention.
  • the traffic policing device may be specifically configured for implementing the embodiment of the present invention.
  • the device may also be built in the network device, and the network device may include a network processor and a router. Referring to FIG. 6, the traffic policing device described in this embodiment includes:
  • the adding module 601 is configured to determine a token adding rate according to the obtained number of tokens to be used for forwarding a predetermined length of data packets and an agreed traffic rate of the target service, and Adding a token to the token storage module at a uniform rate;
  • the response module 602 is configured to: in response to the forwarding request of the current data packet of the target service, determine that the remaining number of tokens in the token storage module meets the preset condition, forward the current data packet of the target service, and the slave token storage module The number of tokens that need to be consumed to delete the current packet of the forwarding destination service.
  • the traffic policing device converts the number of data packets allowed to pass per second into a token addition rate, and adds a token to the token storage module in a time-average manner according to the token addition rate, and each data packet is ordered from the token.
  • the number of tokens that need to be consumed in the card storage module to delete the forwarding packet. Since the token is added to the token storage module in a time-uniform manner based on the token addition rate, the traffic at the start time per second can be avoided. To ensure that the packet loss rate of the same type of data packets is relatively balanced, thus reducing traffic bursts and improving service quality.
  • the response module 602 is configured to forward the current data packet of the target service when the number of remaining tokens in the token storage module is greater than or equal to the number of tokens consumed by the current data packet of the forwarding target service.
  • the response module 602 is further configured to: when the number of remaining tokens in the token storage module is less than the number of tokens consumed by the current data packet of the forwarding destination service, discard or cache the current data packet of the target service.
  • the response module 602 is further configured to determine that the excess token is invalid when the number of remaining tokens in the token storage module exceeds the depth of the token storage module.
  • the response module 602 is further configured to: determine, according to the obtained number of tokens to be used for forwarding a data packet of a preset length, and the length of the current data packet of the target service, determine a current data packet of the forwarding target service. The number of tokens that need to be consumed.
  • the traffic policing device described in this embodiment also includes the adding module 601 and the response module 602 in FIG. 6, and the functional modules also have the corresponding functions described in the fourth embodiment.
  • the traffic policing device described in this embodiment further includes:
  • the obtaining module 603 is configured to obtain the number of tokens that need to be consumed for each bit of data to be forwarded, and determine a preset length for each preset based on the preset length and the number of tokens to be retrieved for each bit of data to be forwarded. The number of tokens that the packet needs to consume.
  • the foregoing adding module 601, the response module 602, and the obtaining module 603 may all be programmable by a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field device located in a network device.
  • CPU central processing unit
  • MPU microprocessor
  • DSP digital signal processor
  • FPGA Gate array
  • the embodiment of the present invention provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the packet per second traffic monitoring method provided by any one of the foregoing embodiments.
  • the method as shown in Figures 3 and/or 4 can be used.
  • the computer storage medium may be a non-transitory storage medium; the embodiment describes a computer readable medium, which may be a ROM (eg, a read only memory, a FLASH memory, a transfer device, etc.), a magnetic storage medium (eg, a magnetic tape, Disk drive, etc.), optical storage media (eg, CD-ROM, DVD-ROM, paper card, paper tape, etc.) and other well-known types of program memory; computer-readable media stores computer-executable instructions when executing instructions Causing at least one processor to perform the following operations:
  • the method before determining the token addition rate according to the obtained number of tokens to be forwarded for each preset length of the data packet and the agreed traffic rate of the target service, the method further includes:
  • the number of tokens to be consumed per forwarded packet of a predetermined length is determined based on the preset length and the number of tokens required to retrieve each bit of data.
  • forwarding the current data packet of the target service including:
  • the current data packet of the target service is forwarded when it is determined that the number of remaining tokens in the token storage module is greater than or equal to the number of tokens consumed by the current data packet of the forwarding destination service.
  • the method further includes: when determining that the number of remaining tokens in the token storage module is less than the number of tokens consumed by the current data packet of the forwarding destination service, discarding or caching the current data packet of the target service.
  • the method further includes: determining that the excess token is invalid when the number of remaining tokens in the token storage module exceeds the depth of the token storage module.
  • the method before deleting the number of tokens that need to be consumed by forwarding the current data packet of the target service from the token storage module, the method further includes: the number of tokens to be consumed per forwarded data packet of a preset length based on the obtained And the length of the current data packet of the target service, and determine the number of tokens that need to be consumed to forward the current data packet of the target service.
  • the traffic policing device converts the number of data packets allowed to pass per second into a token addition rate, and adds a token to the token storage module in a uniform manner according to the token addition rate, one for each
  • the packet removes the number of tokens that need to be consumed to forward the packet from the token storage module. Since the token is added to the token storage module in a time-uniform manner based on the token addition rate, it can be avoided in every second.
  • the traffic burst at the start time ensures that the packet loss rate of the same type of data packet is relatively balanced, thus reducing service traffic bursts and improving service quality.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

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

Abstract

The invention discloses a method of monitoring data traffic in packets per second, and a device. The method comprises: determining, according to a number of tokens used for forwarding an obtained data packet having a preconfigured data length, and according to a committed data rate of a target service, a token addition rate; uniformly adding, according to the token addition rate, tokens into a token storage module; in response to a forwarding request for forwarding the current data packet of the target service, when it is determined that a remaining number of tokens in the token storage module satisfies a preconfigured condition, forwarding the current data packet of the target service; and deleting from the token storage module the number of tokens required for forwarding the current data packet of the target service. The invention can be implemented to reduce surge in the service traffic, increasing service quality.

Description

包每秒流量监管方法、装置和计算机存储介质Packet per second traffic monitoring method, device and computer storage medium 技术领域Technical field
本发明涉及通信技术领域的流量监管技术,尤其涉及一种包每秒(pps,package per second)流量监管方法、装置和计算机存储介质。The present invention relates to a traffic policing technology in the field of communication technologies, and in particular, to a packet per second (pps, packet per second) traffic policing method, apparatus, and computer storage medium.
背景技术Background technique
随着网络应用的不断发展,新型业务的不断推出,例如交互式网络电视(IPTV)、网络电话(VoIP,Voice over Internet Protocol)、视频会议等非传统数据通信业务,对网络的服务质量(QoS,Quality of Service)提出了更高的时延、丢包率和抖动控制要求;随着通信网络的用户越来越多,对于网络资源的竞争也越来越激烈,为满足用户对于不同应用的差异化QoS的需求,通常采用流量监管技术控制用户业务的流量;流量监管通常使用承诺访问速率(CAR,Committed Access Rate)来限制进入或流出网络的业务连接的流量与突发数据,流量监管至少有如下两个方面的需求:(1)对允许用户访问的总字节数进行限定,例如,限定用户的最大下载速度为10Mbps/s;(2)对允许用户访问的总的数据包个数进行限定,比如限定用户每秒发送的数据包在100个以内。With the continuous development of network applications, new services are continuously introduced, such as interactive network television (IPTV), VoIP (Voice over Internet Protocol), video conferencing and other non-traditional data communication services, and the quality of service (QoS) Quality of Service proposes higher latency, packet loss rate and jitter control requirements; as more and more users of communication networks, competition for network resources becomes more and more fierce, in order to satisfy users for different applications. Traffic policing technology is used to control the traffic of user services. Traffic policing usually uses the Committed Access Rate (CAR) to limit the traffic and burst data of service connections entering or leaving the network. There are two requirements: (1) the total number of bytes allowed to be accessed by the user is limited, for example, the maximum download speed of the limited user is 10 Mbps/s; (2) the total number of data packets allowed to be accessed by the user. It is limited, for example, to limit the number of packets sent by users per second to less than 100.
为了实现流量监管的上述两种不同需求,现有通信网络分别设置两套流量监管装置:比特每秒(bps,bits per second)流量监管装置,即每秒允许通过多少个比特,bps流量监管装置对应于上述的需求(1);pps流量监管装置,即每秒允许通过多少个数据包,pps流量监管装置对应于上述的需求(2)。In order to achieve the above two different requirements of traffic policing, the existing communication network separately sets two sets of traffic policing devices: bit per second (bps, bits per second) traffic policing device, that is, how many bits are allowed per second, bps traffic policing device Corresponding to the above requirement (1); pps traffic policing device, that is, how many data packets are allowed per second, the pps traffic policing device corresponds to the above requirement (2).
参见图1示出的bps流量监管装置的工作原理示意图,图1示出的bps 流量监管装置包括:令牌发生器101、令牌桶102、令牌判别模块103及令牌更新模块104;其中,令牌发生器101用于按照预定的速率向令牌桶里面添加令牌,举个例子来说,假设网络允许用户发送的数据流量为5Mbps,且32个令牌代表1bit,则令牌发生器101就以每秒种5M*32个令牌的速度,在比秒更小的时间单元里,匀速的向令牌桶添加令牌;令牌桶102,里面包含2个参数,一个是剩余令牌,指示还可以发送多少字节的数据包,另一个是令牌桶的深度,令牌发生器101产生的令牌会在令牌桶102中累计,当累计大于令牌桶的深度时,令牌会溢出,防止在没有数据包的时间里令牌大量累积,然后下一时刻来了大量的数据包,由于令牌已经积累很多,这时候将数据包全部发出去,将对网络进行巨大冲击,所以令牌不能无限累积,而是累积到一定值时,添加的令牌被视为无效令牌;令牌判别模块103,当数据包到达时,判断令牌桶102里的剩余令牌是否足够数据包通过,如果令牌足够,则数据包通过,否则数据包丢弃;令牌更新模块104,当数据包通过后,要将令牌桶102里的令牌减去与数据包对应的令牌数;基于该bps流量监管装置,实现对允许用户访问的总字节数(用户流量)进行限定,大于流量监管装置预设的允许用户发送的数据流量的数据包,将会被丢弃。Referring to the working principle of the bps traffic policing device shown in FIG. 1, the bps shown in FIG. The traffic policing device includes: a token generator 101, a token bucket 102, a token discriminating module 103, and a token update module 104. The token generator 101 is configured to add a token to the token bucket at a predetermined rate. For example, if the network allows the user to send 5 Mbps of data traffic and 32 tokens represent 1 bit, the token generator 101 will be at a rate of 5 M*32 tokens per second, which is smaller than the second. In the time unit, the token is added to the token bucket at a constant speed; the token bucket 102 contains two parameters, one is the remaining token, indicating how many bytes of data packets can be sent, and the other is the token bucket. Depth, the token generated by the token generator 101 will be accumulated in the token bucket 102. When the accumulation is greater than the depth of the token bucket, the token will overflow, preventing the token from accumulating in a large amount of time without the packet, and then A large number of data packets have arrived at a time. Since the tokens have accumulated a lot, at this time, all the data packets will be sent out, which will have a huge impact on the network. Therefore, the tokens cannot be accumulated indefinitely, but when accumulated to a certain value, the order is added. Card is considered as none Token; the token discriminating module 103, when the data packet arrives, determines whether the remaining tokens in the token bucket 102 are sufficient for the data packet to pass, and if the token is sufficient, the data packet passes, otherwise the data packet is discarded; the token update module 104. After the data packet is passed, the token in the token bucket 102 is subtracted from the number of tokens corresponding to the data packet; based on the bps traffic policing device, the total number of bytes (user traffic) for allowing the user to access is implemented. A packet that is limited to a data traffic that is allowed to be sent by the user, which is preset by the traffic policing device, will be discarded.
现有的pps流量监管技术,容易造成通讯设备的流量突发,无法保证业务的丢包率,影响业务服务质量。The existing pps traffic policing technology is prone to cause traffic bursts of communication devices, which cannot guarantee the packet loss rate of services and affect the service quality of services.
发明内容Summary of the invention
有鉴于此,本发明实施例期望提供一种包每秒流量监管方法、装置和计算机存储介质,期望能降低业务流量突发的出现概率,提高业务服务质量。In view of this, the embodiments of the present invention are directed to providing a packet per second traffic monitoring method, apparatus, and computer storage medium, which are expected to reduce the probability of occurrence of traffic bursts and improve service quality.
本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is implemented as follows:
本发明实施例提供一种包每秒流量监管方法,包括: The embodiment of the invention provides a packet per second traffic monitoring method, including:
根据获取到的每转发一个预设长度的数据包所需要消耗的令牌数及目标业务的约定流量速率确定令牌添加速率,及根据所述令牌添加速率匀速的向令牌存储模块中添加令牌;Determining a token addition rate according to the obtained number of tokens to be forwarded for each packet of a preset length and an agreed traffic rate of the target service, and adding the token to the token storage module according to the token addition rate Token
响应于所述目标业务的当前数据包的转发请求,确定所述令牌存储模块中的剩余令牌数满足预置条件时,将所述目标业务的当前数据包转发,及从所述令牌存储模块中删除转发所述目标业务的当前数据包所需要消耗的令牌数。Responding to the forwarding request of the current data packet of the target service, determining that the remaining number of tokens in the token storage module meets a preset condition, forwarding the current data packet of the target service, and from the token The number of tokens that need to be consumed in the storage module to delete the current data packet of the target service.
本发明实施例还提供一种包每秒流量监管装置,包括:The embodiment of the invention further provides a packet per second traffic monitoring device, including:
添加模块,配置为根据获取到的每转发一个预设长度的数据包所需要消耗的令牌数及目标业务的约定流量速率确定令牌添加速率,及根据所述令牌添加速率匀速的向令牌存储模块中添加令牌;Adding a module, configured to determine a token addition rate according to the obtained number of tokens to be forwarded for each packet of a preset length and an agreed traffic rate of the target service, and a uniform rate according to the token addition rate Add a token to the card storage module;
响应模块,配置为响应于所述目标业务的当前数据包的转发请求,确定所述令牌存储模块中的剩余令牌数满足预置条件时,将所述目标业务的当前数据包转发,及从所述令牌存储模块中删除转发所述目标业务的当前数据包所需要消耗的令牌数。The response module is configured to: in response to the forwarding request of the current data packet of the target service, determine that the current number of tokens in the token storage module meets a preset condition, and forward the current data packet of the target service, and The number of tokens that need to be consumed to forward the current data packet of the target service is deleted from the token storage module.
本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行上述包每秒流量监管方法。The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the packet per second traffic monitoring method.
与现有的pps流量监管技术在每秒开始的时候使用设定值配置这一秒允许通过的数据包数,每来一个数据包将允许通过的数据包个数减1相比,本发明实施例中,将每秒允许通过的数据包数转化成令牌添加速率,根据令牌添加速率按时间均匀的向令牌存储模块中添加令牌,每来一个数据包就从令牌存储模块中删除转发数据包所需要消耗的令牌数,由于令牌是基于令牌添加速率按时间均匀的向令牌存储模块中添加的,这样就能够避免在每秒开始时间的流量突发,保证同一种类型的数据包的丢包率比较均衡, 如此,能降低业务流量突发,提高业务服务质量。Compared with the existing pps traffic policing technology, at the beginning of each second, the set value is used to configure the number of packets allowed to pass, and the number of packets that each packet will be allowed to pass is reduced by one. In the example, the number of packets allowed to pass per second is converted into a token addition rate, and tokens are added to the token storage module uniformly according to the token addition rate, and each packet is from the token storage module. The number of tokens that need to be consumed to delete the forwarding packet. Since the token is added to the token storage module in a time-based manner based on the token addition rate, traffic bursts at the start time per second can be avoided, ensuring the same Packet loss ratios of various types of data packets are relatively balanced. In this way, traffic bursts can be reduced and service quality can be improved.
附图说明DRAWINGS
图1为一种bps流量监管装置的工作原理示意图;FIG. 1 is a schematic diagram of a working principle of a bps traffic monitoring device;
图2为另一种pps流量监管装置的工作原理示意图;2 is a schematic diagram showing the working principle of another pps flow monitoring device;
图3为本发明实施例提供的第一种包每秒流量监管方法的流程示意图;FIG. 3 is a schematic flowchart of a first method for monitoring traffic per second according to an embodiment of the present disclosure;
图4为本发明实施例提供的第二种包每秒流量监管方法的流程示意图;4 is a schematic flowchart of a second method for monitoring traffic per second according to an embodiment of the present invention;
图5为本发明实施例提供的第一种包每秒流量监管装置的结构示意图;FIG. 5 is a schematic structural diagram of a first packet per second traffic monitoring apparatus according to an embodiment of the present disclosure;
图6为本发明实施例提供的第二种包每秒流量监管装置的结构示意图;FIG. 6 is a schematic structural diagram of a second packet per second traffic monitoring apparatus according to an embodiment of the present disclosure;
图7为本发明实施例提供的第三种包每秒流量监管装置的结构示意图。FIG. 7 is a schematic structural diagram of a third packet per second traffic monitoring apparatus according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合附图及实施例,对本发明的技术方案进行清楚、完整地描述,应当理解,以下所说明的优选实施例仅用于说明和解释本发明,并不用于限定本发明。The present invention will be described in detail with reference to the accompanying drawings and embodiments.
参见图2示出的pps流量监管装置的工作原理示意图,研究发现pps流量监管技术的一种实现方式是在每秒钟开始的时候,将允许通过的数据包数目配置为设定值,每来一个数据包,pps流量监管装置201将允许通过的数据包数目减1,直到允许通过的数据包数目为0,即判定1秒钟内已经通过的数据包个数大于设定值,如此,在这1秒的剩余时间内到来的数据包,将被pps流量监管装置201全部丢弃;这就存在如下问题:a)如果每秒的开始时间来了大量数据包,这样前面的数据包大量通过,造成通讯设备的流量比较大;b)每秒钟开始的数据包,能通过的概率远远大于后面来的数据包,而通讯设备,一般希望同一种类型的数据包,丢包率比较均衡。Referring to the working principle of the pps traffic policing device shown in FIG. 2, it is found that an implementation manner of the pps traffic policing technology is to configure the number of allowed packets to be set at the beginning of each second. a data packet, the pps traffic policing device 201 decrements the number of packets allowed to pass until the number of allowed packets is zero, that is, the number of packets that have passed in one second is determined to be greater than the set value, thus, The incoming packets of the remaining time of 1 second will be completely discarded by the pps traffic policing device 201; this has the following problems: a) If a large number of data packets come from the start time per second, so that the preceding data packets are passed in a large amount, The traffic of the communication equipment is relatively large; b) the probability of passing the data packet starting every second is far greater than that of the subsequent data packet, and the communication equipment generally expects the same type of data packet, and the packet loss rate is relatively balanced.
下面首先对实施本发明实施例的装置(在以下各具体实施例中即为流 量监管装置)进行说明,流量监管装置可以采用各种方式来实施,例如在网络处理器、路由器等网络设备中实施流量监管装置的全部组件(比如,流量监管装置可以集成于上述的网络设备中),或者,在上述的网络设备侧以耦合的方式实施流量监管装置中的组件。The apparatus for implementing the embodiments of the present invention is first described below (in the following specific embodiments, the flow is The traffic policing device can be implemented in various manners, for example, implementing all components of the traffic policing device in a network device such as a network processor or a router (for example, the traffic policing device can be integrated into the foregoing network device) Or, the components in the traffic policing device are implemented in a coupled manner on the network device side described above.
基于上述记载的流量监管装置,提出以下各具体实施例。Based on the flow rate monitoring device described above, the following specific embodiments are proposed.
实施例一Embodiment 1
本实施例记载一种包每秒流量监管方法,可以应用于如下场景中:希望在实现pps流量监管功能的同时,能降低业务流量突发,提高业务服务质量;本实施例针对此情况的处理进行说明。This embodiment describes a method for advertised traffic per second packet, which can be applied to the following scenarios: It is desirable to reduce the traffic burst and improve the service quality of the service while implementing the pps traffic policing function. Be explained.
参见图3,本实施例记载的包每秒流量监管方法包括以下步骤:Referring to FIG. 3, the packet per second traffic monitoring method described in this embodiment includes the following steps:
步骤301、根据获取到的每转发一个预设长度的数据包所需要消耗的令牌数及目标业务的约定流量速率确定令牌添加速率。Step 301: Determine a token addition rate according to the obtained number of tokens consumed for forwarding a data packet of a preset length and an agreed traffic rate of the target service.
在本实施例中,流量监管装置在执行步骤301之前,预先获取每转发一个预设长度的数据包所需要消耗的令牌数;预设长度是一个固定值;可选的,获取每转发一个预设长度的数据包所需要消耗的令牌数的实现方式可以包括以下任意一种方式:In this embodiment, before performing step 301, the traffic policing device pre-acquires the number of tokens that need to be consumed for forwarding a data packet of a preset length; the preset length is a fixed value; optionally, each forwarding is performed. The implementation of the number of tokens to be consumed by the preset length packet may include any of the following methods:
方式1、流量监管装置获取每转发一个比特的数据所需要消耗的令牌数,基于预设长度及获取的每转发一个比特的数据所需要消耗的令牌数,确定每转发一个预设长度的数据包所需要消耗的令牌数;举个例子来说,流量监管装置计算预设长度与每转发一个比特的数据所需要消耗的令牌数的乘积,将乘积值确定为每转发一个预设长度的数据包所需要消耗的令牌数;例如,假设每转发一个比特的数据所需要消耗的令牌数为32个,数据包的预设长度为64比特,则每转发一个预设长度的数据包所需要消耗的令牌数为2048个(即32*64)。Method 1. The traffic policing device acquires the number of tokens that need to be consumed for each bit of data to be forwarded, and determines a preset length for each forwarding based on the preset length and the number of tokens that need to be consumed for each data that is forwarded by one bit. The number of tokens that the packet needs to consume; for example, the traffic policing device calculates the product of the preset length and the number of tokens consumed per data of one bit of forwarding, and determines the product value as a preset for each forwarding. The number of tokens that need to be consumed by the length of the data packet; for example, suppose that the number of tokens consumed per data for forwarding one bit is 32, and the preset length of the data packet is 64 bits, each time a predetermined length is forwarded The number of tokens that a packet needs to consume is 2048 (that is, 32*64).
方式2、预先在流量监管装置中配置每转发一个预设长度的数据包所需 要消耗的令牌数。Mode 2, configured in advance in the traffic policing device, required to forward a predetermined length of data packets The number of tokens to consume.
流量监管装置基于获取到每转发一个预设长度的数据包所需要消耗的令牌数,计算每转发一个预设长度的数据包所需要消耗的令牌数与目标业务的约定流量速率的乘积,将乘积值确定为令牌添加速率;例如,假设每转发一个预设长度的数据包所需要消耗的令牌数为2048个,目标业务的约定流量速率(pps监管需求)为100pps,则令牌添加速率等于204800(即2048*100),令牌添加速率的单位可以为令牌每秒;目标业务的约定流量速率可以为目标业务的承诺信息速率(CIR,Committed Information Rate)或者超出信息速率(EIR,Excess Information Rate)等;目标业务的约定流量速率可以预先在流量监管装置中配置。The traffic policing device calculates a product of the number of tokens consumed per forwarded packet of a preset length and the agreed traffic rate of the target service based on the number of tokens required to retrieve each packet of a predetermined length. The product value is determined as the token addition rate; for example, if the number of tokens required to forward a predetermined length of data packet is 2048, and the agreed traffic rate (pps regulatory requirement) of the target service is 100 pps, the token The rate of the addition is equal to 204800 (that is, 2048*100), and the unit of the token addition rate may be the token per second. The agreed traffic rate of the target service may be the committed information rate (CIR, Committed Information Rate) of the target service or exceed the information rate ( EIR, Excess Information Rate, etc.; the agreed traffic rate of the target service can be configured in advance in the traffic policing device.
步骤302、根据令牌添加速率匀速的向令牌存储模块中添加令牌。Step 302: Add a token to the token storage module according to the token addition rate.
例如,假设令牌添加速率等于204800(令牌每秒),则流量监管装置每秒钟将204800个令牌放入到令牌存储模块中;需要注意的是,流量监管装置每秒钟需要往令牌存储模块里添加的令牌数并不是一次性加完的,而是按时间分次的、匀速的向令牌存储模块中添加令牌,例如流量监管装置每次往令牌存储模块里添加的令牌数为102400个,则流量监管装置每秒钟需要往令牌存储模块里添加两次令牌,及流量监管装置往令牌存储模块里添加令牌的时间间隔是0.5s(102400/204800=0.5);可选的,令牌存储模块可以为令牌桶。For example, assuming the token addition rate is equal to 204800 (tokens per second), the traffic policing device puts 204,800 tokens into the token storage module every second; it should be noted that the traffic policing device needs to go every second. The number of tokens added in the token storage module is not added in one time. Instead, the tokens are added to the token storage module in a time-division manner. For example, the traffic policing device goes to the token storage module each time. The number of added tokens is 102,400. The traffic policing device needs to add tokens to the token storage module twice per second, and the time interval for the traffic policing device to add tokens to the token storage module is 0.5s (102400). /204800=0.5); Optionally, the token storage module can be a token bucket.
流量监管装置往令牌存储模块里添加的令牌会在令牌存储模块里累积,即令牌存储模块中的剩余令牌数,当流量监管装置确定令牌存储模块中的剩余令牌数超出令牌存储模块的深度时,令牌会溢出,流量监管装置将超出的令牌视为无效令牌,防止如下情况的发生,即在没有数据包需要转发的时间里令牌大量累积,然后接下来的时刻接收到大量的数据包需要转发,此时由于令牌已经积累很多,这时候将数据包全部发出去,将对设 备及网络造成巨大冲击,因此,令牌存储模块中的令牌不能无限累积,而是累积到一定值(例如令牌存储模块的深度)时,继续添加的令牌被视为无效令牌。The token added by the traffic policing device to the token storage module is accumulated in the token storage module, that is, the number of remaining tokens in the token storage module, when the traffic policing device determines that the number of remaining tokens in the token storage module exceeds When the depth of the token storage module is exceeded, the token overflows. The traffic policing device treats the exceeded token as an invalid token, preventing the occurrence of the token, that is, the token is accumulated in a large amount of time when no packet needs to be forwarded, and then At the moment of receiving, a large number of data packets need to be forwarded. At this time, since the token has accumulated a lot, at this time, all the data packets are sent out, and the data will be set. The backup and the network cause a huge impact. Therefore, the tokens in the token storage module cannot be accumulated indefinitely, but when accumulated to a certain value (for example, the depth of the token storage module), the token that continues to be added is regarded as an invalid token.
步骤303、响应于目标业务的当前数据包的转发请求,确定令牌存储模块中的剩余令牌数满足预置条件时,将目标业务的当前数据包转发。Step 303: Respond to the forwarding request of the current data packet of the target service, and determine that the remaining number of tokens in the token storage module meets the preset condition, and forward the current data packet of the target service.
流量监管装置接收到目标业务的当前数据包的转发请求时,或流量监管装置针对到达指定设备端口的归属目标业务的当前数据包,根据目标业务的当前数据包的特征信息,判断令牌存储模块中的剩余令牌数是否满足预置条件,若是则将目标业务的当前数据包转发,若判定令牌存储模块中的剩余令牌数不满足预置条件,则说明目标业务的当前流量速率超过了目标业务的约定流量速率(pps监管需求),此时,流量监管装置将目标业务的当前数据包视为超限,将目标业务的当前数据包丢弃或者缓存;这里,流量监管装置可以将超限的数据包进行缓存,等到判定令牌存储模块中的剩余令牌数满足预置条件时将该因超限而缓存的数据包转发;流量监管装置还可以从令牌存储模块中预借令牌将该超限的数据包转发;数据包的特征信息可以包括数据包的长度、QoS属性、业务归属信息等数据;可选的,目标业务的当前数据包的长度可以等于预设长度;可选的,目标业务的每一个数据包的长度均等于预设长度。The traffic policing device receives the forwarding request of the current data packet of the target service, or the traffic policing device determines the token storage module according to the current data packet of the current data packet of the target service for the current data packet of the home target service that reaches the specified device port. If the number of remaining tokens in the token meets the preset condition, if the current packet of the target service is forwarded, if the number of remaining tokens in the token storage module does not satisfy the preset condition, the current traffic rate of the target service exceeds The agreed traffic rate (pps supervision requirement) of the target service. At this time, the traffic policing device considers the current data packet of the target service as an overrun, and discards or caches the current data packet of the target service; here, the traffic policing device can The limited data packet is buffered, and the data packet buffered by the overrun is forwarded when the number of remaining tokens in the token storage module is determined to meet the preset condition; the traffic policing device may also pre-borrow the order from the token storage module. The card forwards the overrun packet; the feature information of the packet may include the length of the packet, the QoS class , Data such as information home service; alternatively, the length of the current packet data service may be equal to a target preset length; alternatively, the length of each of the target traffic packet are equal to a preset length.
步骤304、从令牌存储模块中删除转发目标业务的当前数据包所需要消耗的令牌数。Step 304: Delete, from the token storage module, the number of tokens that need to be consumed to forward the current data packet of the target service.
与现有的pps流量监管技术在每秒开始的时候基于设定值配置这一秒允许业务通过的数据包个数,每来一个数据包将允许通过的数据包个数减1相比,本实施例中,流量监管装置将每秒允许通过的数据包数转化成令牌添加速率,根据令牌添加速率按时间均匀的向令牌存储模块中添加令牌,每来一个数据包就从令牌存储模块中删除转发数据包所需要消耗的令牌 数,由于令牌是基于令牌添加速率按时间均匀的向令牌存储模块中添加的,这样就能够避免在每秒开始时间的流量突发,保证同一种类型的数据包的丢包率比较均衡,如此,能降低业务流量突发,提高业务服务质量。Compared with the existing pps traffic policing technology, at the beginning of each second, based on the set value, the number of packets allowed to pass the service is allowed, and the number of packets allowed to pass each packet is reduced by one. In an embodiment, the traffic policing device converts the number of data packets allowed to pass per second into a token addition rate, and adds a token to the token storage module in a time-average manner according to the token addition rate, and each data packet is ordered from the token. The token used in the card storage module to delete the forwarded data packet Because the token is added to the token storage module based on the token addition rate in a time-based manner, it can avoid the traffic burst at the start time per second and ensure the packet loss ratio of the same type of data packet. Balance, so, can reduce business traffic bursts and improve business service quality.
实施例二Embodiment 2
本实施例基于实施例一,本实施例中上述预设条件包括:令牌存储模块中的剩余令牌数是否大于转发目标业务的当前数据包所需要消耗的令牌数。The embodiment is based on the first embodiment. The preset condition in the embodiment includes: whether the number of remaining tokens in the token storage module is greater than the number of tokens to be consumed by the current data packet of the forwarding destination service.
参见图4,本实施例记载的包每秒流量监管方法包括以下步骤:Referring to FIG. 4, the packet per second traffic monitoring method described in this embodiment includes the following steps:
步骤401、流量监管装置根据获取到的每转发一个预设长度的数据包所需要消耗的令牌数及目标业务的约定流量速率确定令牌添加速率。Step 401: The traffic policing device determines the token adding rate according to the obtained number of tokens consumed for forwarding a preset length of data packet and the agreed traffic rate of the target service.
步骤402、根据令牌添加速率匀速的向令牌存储模块中添加令牌。Step 402: Add a token to the token storage module according to the token addition rate.
步骤403、接收到目标业务的当前数据包时,基于获取的每转发一个预设长度的数据包所需要消耗的令牌数,及目标业务的当前数据包的长度,确定转发目标业务的当前数据包所需要消耗的令牌数。Step 403: When receiving the current data packet of the target service, determine the current data of the forwarding target service based on the number of tokens that need to be consumed for each data packet that is forwarded by a preset length, and the length of the current data packet of the target service. The number of tokens that the package needs to consume.
可选的,流量监管装置在接收到目标业务的当前数据包时,首先根据目标业务的当前数据包的特征信息确定当前数据包的长度。Optionally, when receiving the current data packet of the target service, the traffic policing device first determines the length of the current data packet according to the feature information of the current data packet of the target service.
步骤404、判断令牌存储模块中的剩余令牌数是否大于转发目标业务的当前数据包所需要消耗的令牌数,若是,则转到步骤406,否则转到步骤405。Step 404: Determine whether the number of remaining tokens in the token storage module is greater than the number of tokens needed to forward the current data packet of the target service. If yes, go to step 406; otherwise, go to step 405.
步骤405、将目标业务的当前数据包丢弃或者缓存;然后,处理结束。Step 405: Discard or cache the current data packet of the target service; then, the process ends.
步骤406、将目标业务的当前数据包转发。Step 406: Forward the current data packet of the target service.
步骤407、从令牌存储模块中删除转发目标业务的当前数据包所需要消耗的令牌数。Step 407: Delete, from the token storage module, the number of tokens that need to be consumed to forward the current data packet of the target service.
本实施例中,基于令牌存储模块中的剩余令牌数与转发目标业务的当前数据包所需要消耗的令牌数的不同关系,对如何实现pps流量监管功能的 过程进行了详细说明。In this embodiment, based on the difference between the number of remaining tokens in the token storage module and the number of tokens to be consumed by the current data packet of the forwarding destination service, how to implement the pps traffic supervision function The process is described in detail.
实施例三Embodiment 3
基于上述实施例一、实施例二,本实施例记载一种包每秒流量监管装置,针对如下场景提出解决的技术方案:现有的流量监管技术分别设置两套流量监管装置,实现流量监管需要占用较多的逻辑资源,同时也增加了芯片在流量监管方面的设计复杂性。Based on the first embodiment and the second embodiment, the present embodiment describes a packet-per-second traffic policing device, which proposes a solution for the following scenarios: the existing traffic policing technologies respectively set two sets of traffic policing devices to implement traffic policing requirements. It takes up more logic resources and increases the design complexity of the chip in traffic supervision.
本实施例记载的包每秒流量监管装置实际上是对现有bps流量监管装置进行了复用和改进,该改进的bps流量监管装置可以用于实施上述实施例中技术方案;本实施例针对此情况的处理进行说明。The packet-per-second traffic policing device described in this embodiment is actually used to multiplex and improve the existing bps traffic policing device. The improved bps traffic policing device can be used to implement the technical solution in the foregoing embodiment. The processing of this case will be explained.
参见图5,本实施例记载的包每秒流量监管装置的一个可选的结构示意图,该包每秒流量监管装置包括:令牌发生器501、令牌桶502、令牌判别模块503和令牌更新模块504;需要说明的是,该包每秒流量监管装置通过令牌发生器501、令牌桶502、令牌判别模块503和令牌更新模块504的相互配合和协作,可以实现bps流量监管需求;在本实施例为了实现pps流量监管功能,对该些模块(令牌发生器501、令牌桶502、令牌判别模块503和令牌更新模块504)的功能进行了增强,具体为,Referring to FIG. 5, an optional structural diagram of a packet per second traffic monitoring device according to the embodiment includes: a token generator 501, a token bucket 502, a token discriminating module 503, and an The card update module 504; it should be noted that the packet per second traffic monitoring device can implement bps traffic through the cooperation and cooperation of the token generator 501, the token bucket 502, the token discriminating module 503, and the token update module 504. In the embodiment, in order to implement the pps traffic supervision function, the functions of the modules (the token generator 501, the token bucket 502, the token discriminating module 503, and the token update module 504) are enhanced, specifically ,
1)、令牌发生器501向令牌桶502里面添加令牌的速率与数据包个数进行了关联,假设每转发一个预设长度的数据包所需要消耗的令牌数为10000个,pps监管需求(例如目标业务的约定流量速率)为100pps,则令牌发生器501需要按照每秒钟100*10000个令牌的速度,匀速的向令牌桶502添加令牌。1) The rate at which the token generator 501 adds a token to the token bucket 502 is associated with the number of data packets. It is assumed that the number of tokens consumed for forwarding a predetermined length of data packet is 10000, pps The regulatory requirement (e.g., the agreed traffic rate of the target service) is 100 pps, and the token generator 501 needs to add a token to the token bucket 502 at a constant rate of 100*10000 tokens per second.
2)、令牌桶502,用于存储令牌发生器501添加的令牌;令牌桶502具有至少如下2个参数:剩余令牌数、桶深(令牌桶的深度),其中,剩余令牌数用于评估(计算)调度器还可以发送多少个数据包;桶深,如果令牌桶的剩余令牌数大于桶深,则令牌丢弃,这里的桶深,代表允许突发数据 包的个数,假设允许最大50个数据包的突发,则令牌桶桶深设置为50*10000。2) a token bucket 502 for storing a token added by the token generator 501; the token bucket 502 has at least two parameters: a remaining token number, a bucket depth (a depth of the token bucket), wherein the remaining The number of tokens is used to evaluate (calculate) how many packets the scheduler can send; if the bucket is deep, if the number of tokens remaining in the token bucket is greater than the bucket depth, the token is discarded, where the bucket is deep, indicating that burst data is allowed. The number of packets, assuming that a burst of up to 50 packets is allowed, the token bucket depth is set to 50*10000.
3)、令牌判别模块503,用于当数据包到达时,判断令牌桶502里的剩余令牌数是否大于等于转发一个数据包所需要消耗的令牌数(10000),如果剩余令牌数大于等于10000,则转发该数据包,否则将该数据包丢弃。3) The token discriminating module 503 is configured to determine, when the data packet arrives, whether the number of remaining tokens in the token bucket 502 is greater than or equal to the number of tokens (10000) consumed to forward a data packet, if the remaining tokens If the number is greater than or equal to 10000, the packet is forwarded, otherwise the packet is discarded.
4)、令牌更新模块504,用于当数据包通过后,要将令牌桶502里的令牌减去与数据包对应的令牌数,表示已转发一个数据包,例如将令牌桶502里面的令牌数减去10000。4) The token update module 504 is configured to: after the data packet passes, subtract the token corresponding to the data packet from the token in the token bucket 502, indicating that a data packet has been forwarded, for example, the token bucket. The number of tokens in 502 is reduced by 10,000.
本发明采用以下技术方案:第一步:利用漏桶(令牌桶)来进行bps监管;第二步:如果漏桶需要用来做pps监管,则每一个包经过漏桶,都是按固定长度进行令牌的判断以及扣除。The invention adopts the following technical solutions: the first step: using the leaky bucket (token bucket) for bps supervision; the second step: if the leaky bucket needs to be used for pps supervision, each packet passes through the leaky bucket and is fixed. The length is judged and deducted.
与现有技术相比,本实施例避免单独设计一个pps监管模块,只需要对现有bps流量监管装置进行改进,使得改进的bps流量监管模块既可以支持bps流量监管需求,也可以支持pps流量监管需求,实现了对bps流量监管模块的高效复用,减少了模块设计面积和复杂度,能够节约实现流量监管的逻辑资源,降低了芯片在流量监管方面的设计复杂性;同时,在实现pps流量监管功能的同时,能降低业务流量突发,提高业务服务质量。Compared with the prior art, this embodiment avoids designing a pps supervision module separately, and only needs to improve the existing bps traffic policing device, so that the improved bps traffic policing module can support both the bps traffic policing requirement and the pps traffic. The regulatory requirements enable efficient reuse of the bps traffic policing module, reducing the module design area and complexity, saving logic resources for traffic policing, and reducing the design complexity of the chip in traffic policing. At the same time, implementing pps The traffic policing function can reduce traffic bursts and improve service quality.
实施例四Embodiment 4
与前述实施例一对应,本实施例针对前述的流量监管装置进行说明,流量监管装置可以用于执行本发明实施例的流量监管方法,流量监管装置可以是为实施本发明实施例而专门设置的设备,也可以内置于网络设备内部,网络设备可以包括网络处理器、路由器,参见图6,本实施例记载的流量监管装置包括:Corresponding to the foregoing embodiment, the present embodiment is directed to the foregoing traffic policing device. The traffic policing device may be used to perform the traffic policing method according to the embodiment of the present invention. The traffic policing device may be specifically configured for implementing the embodiment of the present invention. The device may also be built in the network device, and the network device may include a network processor and a router. Referring to FIG. 6, the traffic policing device described in this embodiment includes:
添加模块601,配置为根据获取到的每转发一个预设长度的数据包所需要消耗的令牌数及目标业务的约定流量速率确定令牌添加速率,及根据令 牌添加速率匀速的向令牌存储模块中添加令牌;The adding module 601 is configured to determine a token adding rate according to the obtained number of tokens to be used for forwarding a predetermined length of data packets and an agreed traffic rate of the target service, and Adding a token to the token storage module at a uniform rate;
响应模块602,配置为响应于目标业务的当前数据包的转发请求,确定令牌存储模块中的剩余令牌数满足预置条件时,将目标业务的当前数据包转发,及从令牌存储模块中删除转发目标业务的当前数据包所需要消耗的令牌数。The response module 602 is configured to: in response to the forwarding request of the current data packet of the target service, determine that the remaining number of tokens in the token storage module meets the preset condition, forward the current data packet of the target service, and the slave token storage module The number of tokens that need to be consumed to delete the current packet of the forwarding destination service.
与现有的pps流量监管技术在每秒开始的时候基于设定值配置这一秒允许业务通过的数据包个数,每来一个数据包将允许通过的数据包个数减1相比,本实施例中,流量监管装置将每秒允许通过的数据包数转化成令牌添加速率,根据令牌添加速率按时间均匀的向令牌存储模块中添加令牌,每来一个数据包就从令牌存储模块中删除转发数据包所需要消耗的令牌数,由于令牌是基于令牌添加速率按时间均匀的向令牌存储模块中添加的,这样就能够避免在每秒开始时间的流量突发,保证同一种类型的数据包的丢包率比较均衡,如此,能降低业务流量突发,提高业务服务质量。Compared with the existing pps traffic policing technology, at the beginning of each second, based on the set value, the number of packets allowed to pass the service is allowed, and the number of packets allowed to pass each packet is reduced by one. In an embodiment, the traffic policing device converts the number of data packets allowed to pass per second into a token addition rate, and adds a token to the token storage module in a time-average manner according to the token addition rate, and each data packet is ordered from the token. The number of tokens that need to be consumed in the card storage module to delete the forwarding packet. Since the token is added to the token storage module in a time-uniform manner based on the token addition rate, the traffic at the start time per second can be avoided. To ensure that the packet loss rate of the same type of data packets is relatively balanced, thus reducing traffic bursts and improving service quality.
可选的,响应模块602,配置为确定令牌存储模块中的剩余令牌数大于等于转发目标业务的当前数据包所需要消耗的令牌数时,将目标业务的当前数据包转发。Optionally, the response module 602 is configured to forward the current data packet of the target service when the number of remaining tokens in the token storage module is greater than or equal to the number of tokens consumed by the current data packet of the forwarding target service.
可选的,响应模块602,还配置为确定令牌存储模块中的剩余令牌数小于转发目标业务的当前数据包所需要消耗的令牌数时,将目标业务的当前数据包丢弃或者缓存。Optionally, the response module 602 is further configured to: when the number of remaining tokens in the token storage module is less than the number of tokens consumed by the current data packet of the forwarding destination service, discard or cache the current data packet of the target service.
可选的,响应模块602,还配置为确定令牌存储模块中的剩余令牌数超出令牌存储模块的深度时,将超出的令牌视为无效。Optionally, the response module 602 is further configured to determine that the excess token is invalid when the number of remaining tokens in the token storage module exceeds the depth of the token storage module.
可选的,响应模块602,还配置为:基于获取的每转发一个预设长度的数据包所需要消耗的令牌数,及目标业务的当前数据包的长度,确定转发目标业务的当前数据包所需要消耗的令牌数。Optionally, the response module 602 is further configured to: determine, according to the obtained number of tokens to be used for forwarding a data packet of a preset length, and the length of the current data packet of the target service, determine a current data packet of the forwarding target service. The number of tokens that need to be consumed.
实施例五 Embodiment 5
本实施例基于实施例四,参见图7,本实施例记载的流量监管装置也包括图6中的添加模块601、响应模块602,并且该些功能模块也具有实施例四所记载的相应作用,在此基础上,本实施例记载的流量监管装置还包括:The embodiment is based on the fourth embodiment. Referring to FIG. 7, the traffic policing device described in this embodiment also includes the adding module 601 and the response module 602 in FIG. 6, and the functional modules also have the corresponding functions described in the fourth embodiment. On the basis of this, the traffic policing device described in this embodiment further includes:
获取模块603,配置为获取每转发一个比特的数据所需要消耗的令牌数,基于预设长度及获取的每转发一个比特的数据所需要消耗的令牌数,确定每转发一个预设长度的数据包所需要消耗的令牌数。The obtaining module 603 is configured to obtain the number of tokens that need to be consumed for each bit of data to be forwarded, and determine a preset length for each preset based on the preset length and the number of tokens to be retrieved for each bit of data to be forwarded. The number of tokens that the packet needs to consume.
在实际应用中,上述添加模块601、响应模块602、获取模块603,均可由位于网络设备的中央处理器(CPU)、微处理器(MPU)、数字信号处理器(DSP)、或现场可编程门阵列(FPGA)等实现。In practical applications, the foregoing adding module 601, the response module 602, and the obtaining module 603 may all be programmable by a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field device located in a network device. Gate array (FPGA) and other implementations.
实施例六Embodiment 6
本发明实施例提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述任意一个实施例提供的所述包每秒流量监管方法,具体可如图3和/或图4所示的方法。The embodiment of the present invention provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the packet per second traffic monitoring method provided by any one of the foregoing embodiments. The method as shown in Figures 3 and/or 4 can be used.
所述计算机存储介质可选为非瞬间存储介质;本实施例记载一种计算机可读介质,可以为ROM(例如,只读存储器、FLASH存储器、转移装置等)、磁存储介质(例如,磁带、磁盘驱动器等)、光学存储介质(例如,CD-ROM、DVD-ROM、纸卡、纸带等)以及其他熟知类型的程序存储器;计算机可读介质中存储有计算机可执行指令,当执行指令时,引起至少一个处理器执行包括以下的操作:The computer storage medium may be a non-transitory storage medium; the embodiment describes a computer readable medium, which may be a ROM (eg, a read only memory, a FLASH memory, a transfer device, etc.), a magnetic storage medium (eg, a magnetic tape, Disk drive, etc.), optical storage media (eg, CD-ROM, DVD-ROM, paper card, paper tape, etc.) and other well-known types of program memory; computer-readable media stores computer-executable instructions when executing instructions Causing at least one processor to perform the following operations:
根据获取到的每转发一个预设长度的数据包所需要消耗的令牌数及目标业务的约定流量速率确定令牌添加速率,及根据令牌添加速率匀速的向令牌存储模块中添加令牌;Determining the token addition rate according to the obtained number of tokens to be forwarded for each packet of a preset length and the agreed traffic rate of the target service, and adding a token to the token storage module according to the token addition rate ;
响应于目标业务的当前数据包的转发请求,确定令牌存储模块中的剩余令牌数满足预置条件时,将目标业务的当前数据包转发,及从令牌存储模块中删除转发目标业务的当前数据包所需要消耗的令牌数。 Responding to the forwarding request of the current data packet of the target service, determining that the remaining number of tokens in the token storage module meets the preset condition, forwarding the current data packet of the target service, and deleting the forwarding target service from the token storage module The number of tokens that need to be consumed by the current packet.
可选的,根据获取到的每转发一个预设长度的数据包所需要消耗的令牌数及目标业务的约定流量速率确定令牌添加速率之前,方法还包括:Optionally, before determining the token addition rate according to the obtained number of tokens to be forwarded for each preset length of the data packet and the agreed traffic rate of the target service, the method further includes:
获取每转发一个比特的数据所需要消耗的令牌数;Get the number of tokens consumed per one bit of data forwarded;
基于预设长度及获取的每转发一个比特的数据所需要消耗的令牌数,确定每转发一个预设长度的数据包所需要消耗的令牌数。The number of tokens to be consumed per forwarded packet of a predetermined length is determined based on the preset length and the number of tokens required to retrieve each bit of data.
可选的,确定令牌存储模块中的剩余令牌数满足预置条件时,将目标业务的当前数据包转发,包括:Optionally, when determining that the number of remaining tokens in the token storage module meets the preset condition, forwarding the current data packet of the target service, including:
确定令牌存储模块中的剩余令牌数大于等于转发目标业务的当前数据包所需要消耗的令牌数时,将目标业务的当前数据包转发。The current data packet of the target service is forwarded when it is determined that the number of remaining tokens in the token storage module is greater than or equal to the number of tokens consumed by the current data packet of the forwarding destination service.
可选的,方法还包括:确定令牌存储模块中的剩余令牌数小于转发目标业务的当前数据包所需要消耗的令牌数时,将目标业务的当前数据包丢弃或者缓存。Optionally, the method further includes: when determining that the number of remaining tokens in the token storage module is less than the number of tokens consumed by the current data packet of the forwarding destination service, discarding or caching the current data packet of the target service.
可选的,方法还包括:确定令牌存储模块中的剩余令牌数超出令牌存储模块的深度时,将超出的令牌视为无效。Optionally, the method further includes: determining that the excess token is invalid when the number of remaining tokens in the token storage module exceeds the depth of the token storage module.
可选的,从令牌存储模块中删除转发目标业务的当前数据包所需要消耗的令牌数之前,方法还包括:基于获取的每转发一个预设长度的数据包所需要消耗的令牌数,及目标业务的当前数据包的长度,确定转发目标业务的当前数据包所需要消耗的令牌数。Optionally, before deleting the number of tokens that need to be consumed by forwarding the current data packet of the target service from the token storage module, the method further includes: the number of tokens to be consumed per forwarded data packet of a preset length based on the obtained And the length of the current data packet of the target service, and determine the number of tokens that need to be consumed to forward the current data packet of the target service.
综上,本发明实施例中,流量监管装置将每秒允许通过的数据包数转化成令牌添加速率,根据令牌添加速率按时间均匀的向令牌存储模块中添加令牌,每来一个数据包就从令牌存储模块中删除转发数据包所需要消耗的令牌数,由于令牌是基于令牌添加速率按时间均匀的向令牌存储模块中添加的,这样就能够避免在每秒开始时间的流量突发,保证同一种类型的数据包的丢包率比较均衡,如此,能降低业务流量突发,提高业务服务质量。 In summary, in the embodiment of the present invention, the traffic policing device converts the number of data packets allowed to pass per second into a token addition rate, and adds a token to the token storage module in a uniform manner according to the token addition rate, one for each The packet removes the number of tokens that need to be consumed to forward the packet from the token storage module. Since the token is added to the token storage module in a time-uniform manner based on the token addition rate, it can be avoided in every second. The traffic burst at the start time ensures that the packet loss rate of the same type of data packet is relatively balanced, thus reducing service traffic bursts and improving service quality.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围,凡按照本发明原理所作的修改,都应当理解为落入本发明的保护范围。 The above is only the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and modifications made in accordance with the principles of the present invention are understood to fall within the scope of the present invention.

Claims (11)

  1. 一种包每秒流量监管方法,所述方法包括:A packet per second traffic policing method, the method comprising:
    根据获取到的每转发一个预设长度的数据包所需要消耗的令牌数及目标业务的约定流量速率确定令牌添加速率,及根据所述令牌添加速率匀速的向令牌存储模块中添加令牌;Determining a token addition rate according to the obtained number of tokens to be forwarded for each packet of a preset length and an agreed traffic rate of the target service, and adding the token to the token storage module according to the token addition rate Token
    响应于所述目标业务的当前数据包的转发请求,确定所述令牌存储模块中的剩余令牌数满足预置条件时,将所述目标业务的当前数据包转发,及从所述令牌存储模块中删除转发所述目标业务的当前数据包所需要消耗的令牌数。Responding to the forwarding request of the current data packet of the target service, determining that the remaining number of tokens in the token storage module meets a preset condition, forwarding the current data packet of the target service, and from the token The number of tokens that need to be consumed in the storage module to delete the current data packet of the target service.
  2. 根据权利要求1所述的方法,其中,所述根据获取到的每转发一个预设长度的数据包所需要消耗的令牌数及目标业务的约定流量速率确定令牌添加速率之前,所述方法还包括:The method according to claim 1, wherein said method determines a token addition rate based on the number of tokens required to be retrieved for each predetermined length of data packet and the agreed traffic rate of the target service. Also includes:
    获取每转发一个比特的数据所需要消耗的令牌数;Get the number of tokens consumed per one bit of data forwarded;
    基于所述预设长度及所述获取的每转发一个比特的数据所需要消耗的令牌数,确定每转发一个预设长度的数据包所需要消耗的令牌数。And determining, according to the preset length and the number of tokens to be consumed for each data of one bit forwarded, determining the number of tokens to be consumed each time a data packet of a preset length is forwarded.
  3. 根据权利要求1所述的方法,其中,所述确定所述令牌存储模块中的剩余令牌数满足预置条件时,将所述目标业务的当前数据包转发,包括:The method of claim 1, wherein the determining, when the number of remaining tokens in the token storage module meets a preset condition, forwarding the current data packet of the target service comprises:
    确定所述令牌存储模块中的剩余令牌数大于等于所述转发所述目标业务的当前数据包所需要消耗的令牌数时,将所述目标业务的当前数据包转发。And determining that the current data packet of the target service is forwarded when the number of remaining tokens in the token storage module is greater than or equal to the number of tokens required to forward the current data packet of the target service.
  4. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:
    确定所述令牌存储模块中的剩余令牌数小于所述转发所述目标业务的当前数据包所需要消耗的令牌数时,将所述目标业务的当前数据包丢弃或者缓存。 When it is determined that the number of remaining tokens in the token storage module is smaller than the number of tokens required to forward the current data packet of the target service, the current data packet of the target service is discarded or cached.
  5. 根据权利要求1所述的方法,其中,所述从所述令牌存储模块中删除转发所述目标业务的当前数据包所需要消耗的令牌数之前,所述方法还包括:The method of claim 1, wherein the method further comprises: before deleting the number of tokens that need to be consumed to forward the current data packet of the target service from the token storage module, the method further comprising:
    基于所述获取的每转发一个预设长度的数据包所需要消耗的令牌数,及所述目标业务的当前数据包的长度,确定转发所述目标业务的当前数据包所需要消耗的令牌数。Determining a token to be consumed by forwarding the current data packet of the target service based on the obtained number of tokens required to be forwarded for a preset length of data packet and the length of the current data packet of the target service number.
  6. 一种包每秒流量监管装置,所述装置包括:A packet per second traffic monitoring device, the device comprising:
    添加模块,配置为根据获取到的每转发一个预设长度的数据包所需要消耗的令牌数及目标业务的约定流量速率确定令牌添加速率,及根据所述令牌添加速率匀速的向令牌存储模块中添加令牌;Adding a module, configured to determine a token addition rate according to the obtained number of tokens to be forwarded for each packet of a preset length and an agreed traffic rate of the target service, and a uniform rate according to the token addition rate Add a token to the card storage module;
    响应模块,配置为响应于所述目标业务的当前数据包的转发请求,确定所述令牌存储模块中的剩余令牌数满足预置条件时,将所述目标业务的当前数据包转发,及从所述令牌存储模块中删除转发所述目标业务的当前数据包所需要消耗的令牌数。The response module is configured to: in response to the forwarding request of the current data packet of the target service, determine that the current number of tokens in the token storage module meets a preset condition, and forward the current data packet of the target service, and The number of tokens that need to be consumed to forward the current data packet of the target service is deleted from the token storage module.
  7. 根据权利要求6所述的装置,其中,所述装置还包括:The apparatus of claim 6 wherein said apparatus further comprises:
    获取模块,配置为获取每转发一个比特的数据所需要消耗的令牌数,基于所述预设长度及所述获取的每转发一个比特的数据所需要消耗的令牌数,确定每转发一个预设长度的数据包所需要消耗的令牌数。Obtaining a module, configured to acquire a number of tokens to be consumed for forwarding one bit of data, and determining, based on the preset length and the number of tokens to be consumed for each data that is forwarded by one bit, determining that each pre-forward is forwarded The number of tokens that need to be consumed for a packet of length.
  8. 根据权利要求6所述的装置,其中,所述响应模块,配置为确定所述令牌存储模块中的剩余令牌数大于等于所述转发所述目标业务的当前数据包所需要消耗的令牌数时,将所述目标业务的当前数据包转发。The apparatus according to claim 6, wherein the response module is configured to determine that the number of remaining tokens in the token storage module is greater than or equal to a token consumed by the current data packet forwarding the target service When the number is time, the current data packet of the target service is forwarded.
  9. 根据权利要求6所述的装置,其中,所述响应模块,还配置为确定所述令牌存储模块中的剩余令牌数小于所述转发所述目标业务的当前数据包所需要消耗的令牌数时,将所述目标业务的当前数据包丢弃或者缓存。The apparatus according to claim 6, wherein the response module is further configured to determine that the number of remaining tokens in the token storage module is smaller than a token consumed by the current packet forwarding the target service When the number of times, the current data packet of the target service is discarded or cached.
  10. 根据权利要求6所述的装置,其中,所述响应模块,还配置为: The apparatus according to claim 6, wherein the response module is further configured to:
    基于所述获取的每转发一个预设长度的数据包所需要消耗的令牌数,及所述目标业务的当前数据包的长度,确定转发所述目标业务的当前数据包所需要消耗的令牌数。Determining a token to be consumed by forwarding the current data packet of the target service based on the obtained number of tokens required to be forwarded for a preset length of data packet and the length of the current data packet of the target service number.
  11. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1至5任一项所述包每秒流量监管方法。 A computer storage medium storing computer executable instructions for performing the packet per second traffic monitoring method according to any one of claims 1 to 5.
PCT/CN2017/072869 2016-03-21 2017-02-03 Method of monitoring data traffic in packets per second, device, and computer storage medium WO2017161967A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610162369.1A CN107222358A (en) 2016-03-21 2016-03-21 Wrap flux monitoring method per second and device
CN201610162369.1 2016-03-21

Publications (1)

Publication Number Publication Date
WO2017161967A1 true WO2017161967A1 (en) 2017-09-28

Family

ID=59899323

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/072869 WO2017161967A1 (en) 2016-03-21 2017-02-03 Method of monitoring data traffic in packets per second, device, and computer storage medium

Country Status (2)

Country Link
CN (1) CN107222358A (en)
WO (1) WO2017161967A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111262790A (en) * 2018-11-30 2020-06-09 深圳市中兴微电子技术有限公司 Token bucket implementation method and device and computer readable storage medium

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110838989B (en) * 2018-08-15 2023-06-27 北京京东尚科信息技术有限公司 Method and device for carrying out network current limiting based on token
CN110058941A (en) * 2019-03-16 2019-07-26 平安城市建设科技(深圳)有限公司 Task scheduling and managing method, device, equipment and storage medium
CN111800350A (en) * 2020-07-10 2020-10-20 芯河半导体科技(无锡)有限公司 Fused speed limit shaping method and storage medium
WO2022178872A1 (en) * 2021-02-26 2022-09-01 华为技术有限公司 Traffic shaping method and device
CN114979012B (en) * 2022-05-31 2024-06-21 郑州浪潮数据技术有限公司 Network traffic flow limiting method, system, device and computer storage medium
CN115102908B (en) * 2022-08-25 2023-03-10 珠海星云智联科技有限公司 Method for generating network message based on bandwidth control and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101917646A (en) * 2010-08-17 2010-12-15 中兴通讯股份有限公司 Message transmitting method and device
WO2010151496A1 (en) * 2009-06-22 2010-12-29 Citrix Systems, Inc. Systems and methods for platform rate limiting
CN102710502A (en) * 2012-05-12 2012-10-03 杭州迪普科技有限公司 Network speed-limiting method and device based on time wasting
CN104243333A (en) * 2013-06-24 2014-12-24 阿里巴巴集团控股有限公司 Traffic control method for address resolution protocol messages

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103716248B (en) * 2013-06-07 2017-03-01 潘晶 A kind of method that ethernet traffic based on Ethernet switching chip generates and analyzes
CN103428099B (en) * 2013-08-21 2016-02-24 中国人民解放军国防科学技术大学 A kind of method of universal multi-core network processor flow control

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010151496A1 (en) * 2009-06-22 2010-12-29 Citrix Systems, Inc. Systems and methods for platform rate limiting
CN101917646A (en) * 2010-08-17 2010-12-15 中兴通讯股份有限公司 Message transmitting method and device
CN102710502A (en) * 2012-05-12 2012-10-03 杭州迪普科技有限公司 Network speed-limiting method and device based on time wasting
CN104243333A (en) * 2013-06-24 2014-12-24 阿里巴巴集团控股有限公司 Traffic control method for address resolution protocol messages

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111262790A (en) * 2018-11-30 2020-06-09 深圳市中兴微电子技术有限公司 Token bucket implementation method and device and computer readable storage medium
CN111262790B (en) * 2018-11-30 2023-03-10 深圳市中兴微电子技术有限公司 Token bucket implementation method and device and computer readable storage medium

Also Published As

Publication number Publication date
CN107222358A (en) 2017-09-29

Similar Documents

Publication Publication Date Title
WO2017161967A1 (en) Method of monitoring data traffic in packets per second, device, and computer storage medium
US11316795B2 (en) Network flow control method and network device
WO2019158106A1 (en) Network congestion control method, device, and system
CN111355669B (en) Method, device and system for controlling network congestion
US20210119922A1 (en) Network Configuration Method and Device
WO2020042624A1 (en) Transmission rate control method and apparatus, sending device and receiving device
CN108989235B (en) Message forwarding control method and device
WO2019157867A1 (en) Method for controlling traffic in packet network, and device
US11785113B2 (en) Client service transmission method and apparatus
WO2017206763A1 (en) Terminal apparatus, data processing method, and data storage medium
CN112104562B (en) Congestion control method and device, communication network and computer storage medium
WO2016086551A1 (en) Improved wred-based congestion control method and device
WO2018113436A1 (en) Method and device for network congestion processing
US20130208593A1 (en) Method and apparatus providing flow control using on-off signals in high delay networks
WO2018218957A1 (en) Traffic control method, device and system
WO2019192318A1 (en) Traffic smoothing method, server, and forwarding device
CN112995048B (en) Blocking control and scheduling fusion method of data center network and terminal equipment
US11777857B2 (en) Service forwarding method and network device
WO2018076641A1 (en) Method and apparatus for reducing delay and storage medium
CN111131061B (en) Data transmission method and network equipment
US20140211649A1 (en) Reducing latency of at least one stream that is associated with at least one bandwidth reservation
JP6460099B2 (en) Packet transmission apparatus, packet transmission system, and packet transmission method
WO2022068617A1 (en) Traffic shaping method and device
CN109391558B (en) Queue control method and device
JP2024502118A (en) Data transmission methods, devices, electronic devices, and storage media

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17769244

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17769244

Country of ref document: EP

Kind code of ref document: A1