Method and apparatus for calculating packet arrival time interval
First Claim
1. A method for calculating packet arrival time interval, used to calculate the time interval of the packet of each flow arriving at the network node so as to determine the quantity of tokens in the token bucket of each flow, wherein the method comprises:
- when the current packet arrives, reading system current time T2 from a timer, and reading the arrival time T1, recorded in an external RAM, of previous packet of the flow to which the current packet belongs, wherein when the timer implements a cycle timing with a period of preset time period Tmax, the preset time period Tmax is larger than or equal to the time for filling the maximum depth of the token bucket of the flow at the minimum token injection rate;
reading a current flag bit, recorded in an internal RAM, of the flow to which the current packet belongs, wherein the current flag bit is used for indicating the number of cycles of the timer between the system current time T2 and the arrival time T1 of the previous packet; and
calculating the arrival time interval of the present packet according to the system current time T2, the arrival time T1 of the previous packet and the current flag bit.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and an apparatus for calculating packet arrival time interval are provided by the present invention. In the above-mentioned method, when the current packet arrives, system current time T2 is read from a timer, and the arrival time T1, recorded in an external RAM, of previous packet of the flow to which the current packet belongs is read (301), wherein the timer implements a cycle timing with a period of preset time period Tmax, the preset time period Tmax is larger than or equal to the time for filling the maximum depth of the token bucket of the flow at the minimum token injection rate; a current flag bit, recorded in an internal RAM, of the flow to which the current packet belongs is read (303), wherein the current flag bit is used for indicating the number of cycles of the timer between the system current time T2 and the arrival time T1 of previous packet; and the arrival time interval of the present packet is calculated according to the system current time T2, the arrival time T1 of previous packet and the current flag bit (305). Application of the present invention can reduce the consumption of the internal RAM and improve the operability for realizing by the hardware chips.
-
Citations
17 Claims
-
1. A method for calculating packet arrival time interval, used to calculate the time interval of the packet of each flow arriving at the network node so as to determine the quantity of tokens in the token bucket of each flow, wherein the method comprises:
-
when the current packet arrives, reading system current time T2 from a timer, and reading the arrival time T1, recorded in an external RAM, of previous packet of the flow to which the current packet belongs, wherein when the timer implements a cycle timing with a period of preset time period Tmax, the preset time period Tmax is larger than or equal to the time for filling the maximum depth of the token bucket of the flow at the minimum token injection rate; reading a current flag bit, recorded in an internal RAM, of the flow to which the current packet belongs, wherein the current flag bit is used for indicating the number of cycles of the timer between the system current time T2 and the arrival time T1 of the previous packet; and calculating the arrival time interval of the present packet according to the system current time T2, the arrival time T1 of the previous packet and the current flag bit. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17)
-
-
10. An apparatus for calculating packet arrival time interval, used to calculate the time interval of the packet of each flow arriving at the network node so as to determine the quantity of tokens in the token bucket of each flow, wherein the apparatus comprises:
-
an external RAM, configured to record the arrival time T1 of the latest packet of each flow with the flow identifier of the each flow as the address; a timer, configured to implement a cycle timing with a period of preset time period Tmax, wherein the preset time period Tmax is larger than or equal to the time for filling the maximum depth of the token bucket of each flow at the minimum token injection rate; an internal RAM, configured to record the current flag bit of the each flow with the identifier of the each flow as the address, wherein the current flag bit is used for indicating the number of cycles of the timer between the system current time and the arrival time of previous packet of the each flow; and a processor, configured to execute program units stored in a memory, the program units comprising; a reading module, connected to the external RAM, the timer, the internal RAM and configured to read the system current time T2 from the timer, the arrival time T1 of previous packet recorded in the external RAM and corresponding to the flow to which current packet belongs, and the current flag bit recorded in the internal RAM and corresponding to the flow to which the current packet belongs, when the current packet arrives; and a calculating module, connected to the reading module and configured to calculate the arrival time interval of the present packet according to the system current time T2, the arrival time T1 of previous packet and the current flag bit which are read by the reading module. - View Dependent Claims (11)
-
Specification