Configuring Large Delay Buffers in CoS
You can configure very large delay buffers using the buffer-size-temporal
command combined with the q-pic-large-buffer
command. The buffer-size
temporal
option in combination with q-pic-large-buffer
can create
extra-large delay buffer allocations for one or several queues on an interface.
If the configured buffer size is too low, the buffer size for the forwarding class defaults to 9192 and the following log message is displayed: “fwdd_cos_set_delay_bandwidth:queue:16 delay buffer size (1414) too low, setting to default 9192.”
Configuring Large Delay Buffers
The following configuration applies to the examples that follow:
Example: Simple Configuration Using Four Queues
This configuration allocates 12,500,000 bytes of buffer for each of the four queues. To avoid exceeding the limits of the delay buffer calculation, this initial example has no interface shaping rate, scheduler transmit rate, or scheduler buffer size percent configuration.
Specify the maximum 4-second delay buffer on each of the four queues:
[edit]
set class-of-service schedulers be-Scheduler0 buffer-size temporal 4m
set class-of-service schedulers video-Scheduler1 buffer-size temporal 4m
set class-of-service schedulers voice-Scheduler2 buffer-size temporal 4m
set class-of-service schedulers nc-Scheduler3 buffer-size temporal 4m
Specifying
buffer-size temporal
on some or all queues uses implicit (default) or explicit transmit rate percentages as the buffer-size percentages of the temporal values for those queues. Because there are no explicitly specified transmit rate percentages, divide 100 percent by the number of configured queues (queues with schedulers configured in the scheduler map) to get the implicit (default) per-queue transmit rate percentages. Each queue gets an implicit (default) transmit rate of 100% / 4 = 25%.In this example, specifying the maximum 4-second delay on each queue, with no shaping rate on the interface and implicit (default) per-queue transmit rates of 25 percent, the total buffer for all temporal 4m queues on an interface = 4 seconds * 100,000,000 maximum interface bps / 8 bits/byte = 4 seconds * 12,500,000 bytes = 50,000,000 bytes. Each queue specifying temporal 4m gets 25% * 50,000,000 = 12,500,000 bytes.
Add a shaping rate of 4 Mbps to the interface:
[edit]
set class-of-service interfaces ge-0/0/3 unit 201 shaping-rate 4m
The total buffer for all temporal 4m queues on an interface = 4 sec * 4,000,000 bps shaping-rate / 8 bits/byte = 4 sec * 500,000 bytes = 2,000,000 bytes. Therefore, each queue specifying temporal 4m receives 25% * 2,000,000 = 500,000 bytes.
When using buffer-size temporal
on any interface queues, if you also use the
transmit-rate percent
command, or the buffer-size percent
command, or both commands, on any of the interface queues, the buffer size calculations become
more complex and the limits of available queue depth might be reached. If the configuration
attempts to exceed the available memory, then at commit time two system log messages appear in
the /var/log/messages
file, the interface class-of-service configuration is
ignored, and the interface class-of-service configuration reverts to the two-queue defaults:
Mar 11 11:02:10.239 elma-n4 elma-n4 COSMAN_FWDD: queue mem underflow for ge-0/0/3 Mar 11 11:02:10.240 elma-n4 elma-n4 cosman_compute_install_sched_params: Failed to compute scheduler params for ge-0/0/3.Hence retaining defaults
When configuring buffer-size temporal
along with transmit-rate percent
or buffer-size percent
, or
both, you must monitor the system log to see whether the available
queue depth limit has been reached.
Example: Using buffer-size temporal with Explicit transmit-rate percent Commands
To add explicit transmit rates to all four queues:
[edit]set class-of-service schedulers be-Scheduler0 transmit-rate percent 10
set class-of-service schedulers video-Scheduler1 transmit-rate percent 25
set class-of-service schedulers voice-Scheduler2 transmit-rate percent 25
set class-of-service schedulers nc-Scheduler3 transmit-rate percent 40
For example, if an interface is shaped to 4 Mbps, the transmit rate percentage of 10 for a queue means that the bandwidth share for the specific queue is 0.4 Mbps. The queues are allocated portions of the 2,000,000 bytes of total buffer available for temporal queues on this interface, proportionally to their transmit rates. The four queues get 200,000, 500,000, 500,000, and 800,000 bytes of delay buffer, respectively.
To avoid exceeding the queue depth limits and triggering system
log messages and default configuration behavior, when configuring
queues with buffer-size temporal
and transmit rate
percent
and other (non-temporal) queues with buffer-size
percent
, the following configuration rule must be followed:
When one or more queues on an interface are configured with buffer-size
temporal
, the sum of the temporal queues explicitly configured
transmit rate percentages plus other non-temporal queues explicitly
configured buffer size percentages must not exceed 100 percent.
If the total of the temporal queues transmit rate percentages
and the non-temporal queues buffer-size percentages exceeds 100 percent,
the queue mem underflow
and Failed to compute scheduler
params
system log messages appear in the messages log, the explicitly
configured CLI CoS configuration for the interface is ignored, and
the interface reverts to a two-queue default CoS configuration.
When buffer-size temporal
is specified on a queue,
if transmit-rate percent
is also configured on the same
queue, the queue depth configured is based on the fractional bandwidth
for the queue as obtained by the specified transmit-rate percent
.
In addition to temporal delay times specified for one or more
queues using buffer size temporal, there is another delay time automatically
computed for the entire interface. This interface delay time is distributed
across all non-temporal queues, proportionally to their implicit (default)
or explicit transmit-rate percentages. If q-pic-large-buffer
is not enabled, the interface delay time defaults to 100 ms. As
shown in Table 1, when q-pic-large-buffer
is enabled, interface delay time is calculated according to configured
shaping rate for the interface. Because the shaping-rate configured
in the example above was 4 Mbps (> 2,048,000 bps), the interface delay
time for the configuration is 100 msec.
Configured Shaping Rate (bps) |
Interface Delay Time (msec) Used for Non-Temporal Queues with q-pic-large-buffer Enabled |
Default Delay Time Used (msec) Without q-pic-large-buffer |
---|---|---|
64,000-255,999 |
4000 |
100 |
256,000 - 511,999 |
2000 |
100 |
512,000 - 102,3999 |
1000 |
100 |
1,024,000 - 2,047,999 |
500 |
100 |
>= 2,048,000 |
100 |
100 |
This example properly computes the delay buffer limits on both temporal and non-temporal queues:
Substitute
buffer-size percent
forbuffer-size temporal
on queues 0 and 1:[edit]
delete class-of-service schedulers be-Scheduler0 buffer-size temporal 4m
delete class-of-service schedulers video-Scheduler1 buffer-size temporal 4m
set class-of-service schedulers be-Scheduler0 buffer-size percent 10
set class-of-service schedulers video-Scheduler1 buffer-size percent 25
This deletes the requirement for hard-specified 4 seconds of buffering and replaces it with a proportional limit of 10 percent (or 25 percent) of the total interface delay time for the non-temporal queues. In both cases, the queue depth is calculated based on the share of the interface bandwidth for the specific queues. Total Interface Non-Temporal Queue Memory = shaping-rate * Interface delay time (Table 1) = 4 Mbps * 0.1 seconds = 500,000 bytes per second * 0.1 seconds = 50,000 bytes, therefore queues 0 and 1 get 10% * 50,000 = 5000 bytes and 25% * 50,000 = 12,500 bytes of delay buffer, respectively.
Configure
buffer-size temporal
on queues 2 and 3:[edit]
set class-of-service schedulers voice-Scheduler2 buffer-size temporal 4m
set class-of-service schedulers voice-Scheduler2 transmit-rate percent 25
set class-of-service schedulers nc-Scheduler3 buffer-size temporal 4m
set class-of-service schedulers nc-Scheduler3 transmit-rate percent 40
Queues 2 and 3 still get 500,000 and 800,000 bytes of delay buffer, respectively, as previously calculated. This configuration obeys the rule that the sum of the temporal queues transmit rate percentages (25% + 40% = 65%), plus the non-temporal queues buffer size percentages (10% + 25% = 35%) do not exceed 100% (65% + 35% <= 100%).
The following example exceeds the delay buffer limit, triggering the system log messages and the default, two-queue class-of-service behavior.
Increase the buffer-size percentage from 25 percent to 26 percent for non-temporal queue 1:
[edit]
set class-of-service schedulers video-Scheduler1 buffer-size percent 26
This violates the configuration rule that the sum of the non-temporal
queues buffer-size percentages (10% + 26% = 36%), plus the temporal
queues transmit rate percentages (25% + 40% = 65%) now exceed 100%
(36% + 65% = 101%). Therefore, the following two system log messages
appear in the /var/log/messages
file:
Mar 23 18:08:23 elma-n4 elma-n4 COSMAN_FWDD: %PFE-3: queue mem underflow for ge-0/0/3 q_num(3) Mar 23 18:08:23 elma-n4 elma-n4 cosman_compute_install_sched_params: %PFE-3: Failed to compute scheduler params for ge-0/0/3.Hence retaining defaults
When the delay buffer limits are exceeded, the CLI-configured class-of-service settings are not used and the default class-of-service configuration (the default scheduler-map) is assigned to the interface. This uses two queues: the forwarding-class best-effort (queue 0) has transmit rate percent 95 and buffer-size percent 95 and the forwarding-class network-control (queue 3) has the transmit rate percent 5 and buffer-size percent 5.
queue 0: 1,187,500 Bytes queue 1: 9,192 Bytes queue 2: 9,192 Bytes queue 3: 62,500 Bytes