CN101771606A - Meter-based method for calculating flow rate of messages - Google Patents

Meter-based method for calculating flow rate of messages Download PDF

Info

Publication number
CN101771606A
CN101771606A CN200810306719A CN200810306719A CN101771606A CN 101771606 A CN101771606 A CN 101771606A CN 200810306719 A CN200810306719 A CN 200810306719A CN 200810306719 A CN200810306719 A CN 200810306719A CN 101771606 A CN101771606 A CN 101771606A
Authority
CN
China
Prior art keywords
meter
flow rate
bucket
message
token
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN200810306719A
Other languages
Chinese (zh)
Other versions
CN101771606B (en
Inventor
严俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN200810306719A priority Critical patent/CN101771606B/en
Publication of CN101771606A publication Critical patent/CN101771606A/en
Application granted granted Critical
Publication of CN101771606B publication Critical patent/CN101771606B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to the Ethernet switch flow rate control technology, in particular to a standard meter (Meter)-based method for calculating flow rate of messages. Aiming at the defect that certain low end Ethernet exchange chip does not have the function of flow rate calculation, the invention provides the meter-based method for calculating the flow rate of messages. The technical scheme of the method comprises the following steps: setting a register of a token bucket meter to be zero at T0 time; reading out the value at certain T1 time before the bucket is full; and multiplying the token injection rate by time interval (T1-T0) to reduce the value of the register of the bucket meter to acquire the message flow rate from T0 to T1. Short-term flow rate values are accumulated to complete the function of flow rate calculation. The method is used for realizing the function of flow rate calculation on low-end chips, can realize the function of charging according to the flow rate for wideband access users by associating with other modules of a system, and provides the low cost resolution of flow rate calculation.

Description

A kind of message meter method of flow based on meter
Technical field
The present invention relates to the Ethernet switch flow control technique, particularly a kind of message meter method of flow based on standard hopper (Meter).
Background technology
General low side exchange chip does not provide the function that message size is counted, so hardware does not support to count traffic engineering capability.In some exchange chips, provide the meter (Meter) of RFC standard definition painted to message.Usually, the painted result of meter is used for message is carried out traffic policing and traffic shaping.Meter in the exchange chip generally defers to the behavior that defines in RFC2697, the RFC2698 standard.Below with single-rate three-color marker (Single Rate Three Color Marker is abbreviated as SRTCM) procedure declaration message coloring principle.
Single-rate three-color marker relates to 3 parameters, and they are respectively committed information rate (CIR), committed burst size (CBS) and exceed burst sizes (EBS).Committed information rate is the transmission rate that unit determines message with the bps, and the committed burst size is that unit provides the message length that allows continuous transmission with the byte with exceeding burst sizes.In the application of reality, single-rate three-color marker is realized by two token buckets.
As shown in Figure 1, the degree of depth of two token buckets is determined by CBS and EBS respectively.In the starting stage of operating process, these two token buckets are full state, and after the operation beginning, per second upgrades CIR time token bucket TC (bucket is dark to be CBS) and token bucket TE (the dark EBS of being of bucket), and it is as follows to upgrade operation:
IF TC<CBS TC=TC+1, otherwise TC is constant;
IF TE<EBS TE=TE+1, otherwise TE is constant.
Be not difficult to find out that from above-mentioned renewal operation as long as token bucket is constant, the each renewal is operating as token of representing 1 bit of token bucket increase, reaches CBS (token bucket TC is full) or EBS (token bucket TE is full) up to the token bucket Counter Value.When length is after the message of B arrives, to judge that at first whether TC-B is more than or equal to 0.If, show the grouping arrival rate in committed information rate, TC=TC-B, message is marked as green; Otherwise show that the message arrival rate has exceeded committed information rate.Whether judge TE-B then more than or equal to 0, if, exceed committed information rate though show the message arrival rate, but still allow go beyond the scope in, TE=TE-B, message is marked as yellow; Otherwise show that the message arrival rate not only exceeds committed information rate, and exceed going beyond the scope of permission, be marked as redness.Dual rate tricolor marker (TRTCM) principle does not similarly repeat them here.Be used for message is carried out the marker of traffic policing, the action of taking for yellow and red packet is to abandon.
In the chip of reality was realized, above-mentioned token bucket generally was to add that with RAM some arithmetic logics realize.Usually, a meter is made up of token charge velocity, the dark restriction of bucket, three registers of token bucket counter (or bucket counter).The CIR of the corresponding SRTCM of token charge velocity register, corresponding CBS of the dark limit register of bucket or EBS.
Summary of the invention
Technical problem to be solved by this invention does not possess on the low side Ethernet switching chip of flowmeter amount function at some exactly, and the mode of employing hardware and software combination realizes the message meter traffic engineering capability of wide band access user.
The technical scheme that the present invention solve the technical problem employing is that a kind of message meter method of flow based on meter may further comprise the steps:
A, zero clearing bucket counter register value, and preset the dark and token charge velocity register of bucket, write down the system time TS of this moment;
B, behind a period of time δ T, read a barrel counter register value VR;
C, upgrade TS with current system time, and zero clearing bucket counter register, poll next time started;
E, the bucket counter register value VE that obtains expecting according to the product of δ T and token charge velocity register value;
F, according to formula: VE-VR, obtain last visit bucket counter register to the message flow between this visit; Further, also comprise step:
G, the short-term flow that n poll obtained add up; N is a positive integer;
Further, described δ T overflows the time less than the bucket counter register.
The invention has the beneficial effects as follows, utilize the meter of widely used RFC standard definition in the modern exchange chip, use it for the meter flow purposes of non-anticipation in producer and the standard, have certain versatility.Technical scheme of the present invention can realize the meter traffic engineering capability on the chip of some low sides.Cooperate with ACL (access control list), IP Source Guard (IP address and MAC binding), DHCP (dynamic IP addressing distribution) and authentication module, can realize the function of charging by flow of wide band access user, provide and count the flow solution cheaply.
Description of drawings
Fig. 1 is a meter basic structure schematic diagram.
Embodiment
Describe technical scheme of the present invention below in detail.
Technical scheme of the present invention has been made following hypothesis to hardware:
1, possess the hardware meter (Meter) that is used for traffic policing, and dark, the token charge velocity of bucket, the bucket counter register of meter is visible, read-write to the user;
2, the parallel interface that possesses processor and chip can be passed through this parallel interface fast access chip;
3, processor controls has hardware timer, can produce high-precision time-base signal.
The present invention regularly inquires about meter bucket counter register in the exchange chip by processor controls, calculates the flow that the polling interval takes place, and obtains flow value after adding up.Principle is as follows:
According to the RFC standard, the bucket counter can inject token by the configuration of token charge velocity register in the bucket counter register, till reaching the dark register value of bucket.Arrive as message, then from bucket, subtract and token according to message length.As can be seen, if constantly the token bucket counter register is changed to 0, it is read the token charge velocity interbody spacer (T1-T0) of taking the opportunity during less than before certain T1 constantly at bucket at T0, deducting a barrel counter register value again, is exactly the message flow of T0 to T1 time.This short-term flow value added up to finish the meter traffic engineering capability.Concrete steps are as follows:
The first step: when starting the meter traffic engineering capability, elder generation of system zero clearing bucket counter register value, and preset the dark and token charge velocity register of bucket, and write down the system time of this moment, be made as TS;
Second step: (suppose to be during this period of time δ T) over time, read a barrel counter register value, be designated as VR;
The 3rd step: the bucket counter register value according to the product of δ T and the token charge velocity register value that presets obtains expecting is designated as VE;
The 4th step:, obtain last visit bucket counter register to the message flow between this visit according to formula: VE-VR;
The 5th step: upgrade TS with current system time immediately, and zero clearing bucket counter, start poll next time;
The 6th step: the message flow that n poll obtained adds up, and obtains n * δ T statistics of message flow during this period of time, and wherein n is a positive integer.
The interval of poll of the present invention must arrive the time of bucket dark (CBS or EBS) less than token counter, otherwise can not draw correct value.The pipe dark (being equivalent to CBS or EBS) that choose and the meter of this time supported and the speed (being equivalent to CIR) of user configured generation token are relevant.
The present invention is based on the Meter that changes in the chip and generally all defer to the behavior that defines in RFC2697, the RFC2698 standard.Though used two buckets in the standard, in the realization of meter traffic engineering capability, only need to use one of them bucket just can finish, specifically how to use relevantly with chip, be not described at this.

Claims (3)

1. message meter method of flow based on meter may further comprise the steps:
A, zero clearing bucket counter register, and preset the dark and token charge velocity register of bucket, write down the system time TS of this moment;
B, behind a period of time δ T, read a barrel counter register value VR;
C, upgrade TS with current system time, and zero clearing bucket counter register, poll next time started;
E, the bucket counter register value VE that obtains expecting according to the product of δ T and the token charge velocity register value that presets;
F, according to formula: VE-VR, obtain last visit bucket counter register to the message flow between this visit.
2. a kind of message meter method of flow based on meter according to claim 1 is characterized in that: also comprise step:
G, the message flow that n poll obtained add up; N is a positive integer.
3. a kind of message meter method of flow based on meter according to claim 1 and 2, it is characterized in that: described δ T overflows the time less than the bucket counter register.
CN200810306719A 2008-12-31 2008-12-31 Meter-based method for calculating flow rate of messages Active CN101771606B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200810306719A CN101771606B (en) 2008-12-31 2008-12-31 Meter-based method for calculating flow rate of messages

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200810306719A CN101771606B (en) 2008-12-31 2008-12-31 Meter-based method for calculating flow rate of messages

Publications (2)

Publication Number Publication Date
CN101771606A true CN101771606A (en) 2010-07-07
CN101771606B CN101771606B (en) 2012-09-12

Family

ID=42504219

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200810306719A Active CN101771606B (en) 2008-12-31 2008-12-31 Meter-based method for calculating flow rate of messages

Country Status (1)

Country Link
CN (1) CN101771606B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447683A (en) * 2010-10-13 2012-05-09 高通创锐讯通讯科技(上海)有限公司 Method of supporting nested multi METER system structure
WO2014161439A1 (en) * 2013-04-02 2014-10-09 中兴通讯股份有限公司 Counting control method for counter, and network chip
CN112995060A (en) * 2021-05-18 2021-06-18 湖南戎腾网络科技有限公司 Flow control method based on hardware counter

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6757249B1 (en) * 1999-10-14 2004-06-29 Nokia Inc. Method and apparatus for output rate regulation and control associated with a packet pipeline
CN101094180B (en) * 2007-07-20 2012-05-23 杭州华三通信技术有限公司 Method and device for watching and controlling compressed flux
CN101227410A (en) * 2008-02-03 2008-07-23 杭州华三通信技术有限公司 Flow monitoring method and flow monitoring equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447683A (en) * 2010-10-13 2012-05-09 高通创锐讯通讯科技(上海)有限公司 Method of supporting nested multi METER system structure
WO2014161439A1 (en) * 2013-04-02 2014-10-09 中兴通讯股份有限公司 Counting control method for counter, and network chip
US9594616B2 (en) 2013-04-02 2017-03-14 Zte Corporation Method for implementing counting control of counter, and network chip
CN112995060A (en) * 2021-05-18 2021-06-18 湖南戎腾网络科技有限公司 Flow control method based on hardware counter
CN112995060B (en) * 2021-05-18 2021-08-24 湖南戎腾网络科技有限公司 Flow control method based on hardware counter

Also Published As

Publication number Publication date
CN101771606B (en) 2012-09-12

Similar Documents

Publication Publication Date Title
CN107743099B (en) Data stream processing method, device and storage medium
US20140112147A1 (en) Refresh mechanism for a token bucket
CN103338133B (en) Dynamic monitoring message forwards the method and device of port congestion
CN101771606B (en) Meter-based method for calculating flow rate of messages
CN104850170A (en) Crystal-metering-free SoC (system-on-chip) and clock acquiring method thereof
CN101741739B (en) Method and device for counting messages of output/input port of exchange equipment
CN101026561A (en) Token bucket fill rate configuration method and device
CA2362923A1 (en) System and method for measuring the transfer durations and loss rates in high volume telecommunication networks
US20140036672A1 (en) Calculating credit for controlling data frame transmission
WO2009078398A1 (en) Buffer device using token bucket and method for controlling same
CN107579877A (en) A kind of exchange of electric power machine flux monitoring system and monitoring method based on FPGA
WO2014067339A1 (en) Method and apparatus for supervising flow
CN106375238A (en) Flow supervision method and apparatus
CN1614939A (en) Realizing method for time-delaying test
CN111193567A (en) Time synchronization method, equipment and storage medium
CN101599905A (en) A kind of method, Apparatus and system of realizing that traffic shaping token adds
CN104158538B (en) Baud rate generation method, Baud rate generator and communication equipment
CN101820380B (en) Token updating method of meter
CN102299828A (en) Test traffic synthesis method and device for test on performance of network security equipment
FI73850B (en) DATASYNKRONISERINGSKRETS.
CN107425936A (en) A kind of transparent clock measurement apparatus
CN109587075B (en) Service processing method, device, equipment and storage medium
CN102413055A (en) System and method for marking timestamps of messages based on software and hardware
CN1997162A (en) PCR correction method and device
CN202818337U (en) An FPGA-based IEC61588V2 event message detector

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant