The ONL Tutorial

Filters, Queues and Bandwidth >> NSP Architecture TOC

Link Rate Implementation

If a user specifies that a link rate should be R Kbps, the actual link rate r will likely be different than (although not substantially) because the link rate algorithm implemented in the FPX uses integer arithmetic. In fact, the actual link rate will be:

	  r = Max { 61, 61 * k } Kbps
where k is the largest integer such that 61*k is no larger than R; i.e., the actual link rate will be an integer multiple of 61 Kbps and will always be atleast 61 Kbps, even if the desired rate is set to 0. For example, if R = 100 Mbps or 100,000 Kbps, then r = 99975.6 Kbps, a value that is within 0.025% of the desired rate. On the other hand, if R = 100 Kbps, the actual rate will be 61 Kbps, a value that is 39% different than the desired rate. This page describes the link rate algorithm at a conceptual level.

The FPX uses a token bucket to determine when a packet should begin transmission. The token bucket receives new tokens at the beginning of each FPX clock period. The FPX has a clock frequency of F = 62.5 MHz which means that tokens are replenished every 16 nsec.

When a user enters a desired sending rate of R Kbps that is atleast 61 Kbps, the FPX adds z tokens to the token bucket at the beginning of each clock tick where z is the largest integer that satisfies the following relationship:

	r = z*v*F <= R		if R >= 61 Kbps
where F is the FPX clock frequency (62.5 MHz), and v is the value of a single token. Because of the number of bits used in the token computation algorithm, each token represents 1/1024 bits; i.e., the value of one token is 1/1024 bits. Replacing F and v with their values leads to:
	r = 62,500 * z / 1024 <= R Kbps		if R >= 61 Kbps
With integer division, the relationship becomes:
	r = 61 * z <= R Kbps
The link rate algorithm computes z, the number of tokens to place in the token bucket, for all values of R by effectively using the following equation:
	z = Max { 1, Floor(R/61) }
where R is the desired link rate in Kbps. For R less than 61 Kbps, z is 1. This means that the actual link rate r is given by:
	  r = 61 * z Kbps
or
	  r = 61 * Max { 1, Floor(R/61) } Kbps

The key parameters are summarized in the following table:

Parameter Description
F = 62.5 MHZ Clock Rate (ticks/sec)
R Desired Sending Rate (Kbps)
z = Max{ 1, Floor(62,500*R/1024) } Token Rate (tokens/tick)
v = 1/8192 Token Value (bytes/token)
r = 61 * Max{ 1, Floor(R/61) } Bucket Fill Rate (Kbps)

Relationship to Packet Scheduling

To be precise, the RLI sends the link rate R to the appropriate SPC which then computes the z value. The SPC then sends the z value to the FPX to parameterize the link rate token bucket. Recall that z is just the token bucket fill rate; i.e., the number of tokens to be added in one FPX clock tick. At first glance, it may seem odd that the RLI doesn't just directly communicate with the FPX. But the SPC gets involved because of the potential for running the Distributed Queueing (DQ) algorithm. The DQ algorithm uses the link rate (and the switch rate) to compute VOQ rates so as to avoid both underflow and overflow at the egress ports. The RLI does send quantum and threshhold values directly to the FPX since these control packet scheduling on the egress side.

When DQ is OFF, the user sets the VOQ rates through the Queue Table. The RLI translates these rates to z values and sends them directly to the FPX to configure the token buckets associated with packet transmission from the VOQs.



  

Filters, Queues and Bandwidth >> NSP Architecture TOC