When the COS is applied to SRX interface with schedulers, shaping-rate and custom configured "buffer-size temporal", in case the input bandwidth exceeds the configured shaping-rate, then the input interface bandwidth is limited to the available bandwidth of the output interface.
Input interface bandwidth aligns to the output interface COS settings when configuring:
class-of-service schedulers buffer-size temporal
This is Junos protection mechanism in case of output queues buffer oversubscription.The interface output queues buffer oversubscription can occur when these buffers are manually configured with a fixed value and that configured value exceeds the physical memory available on the respective device and interface type.The available output queues buffer memory is different for each device and interface type.Usually, this buffer space is automatically calculated, then the calculated values are assigned to each queue, based on the configuration or by default values.This works when using custom buffer size allocation in percentage out of the total buffer size per queues, with CLI configuration:
set class-of-service schedulers <scheduler-name> buffer-size percent <percentage value 0%-100%>
The Junos compiler automatically calculates the buffer size for each configured queue out of the total available burier size amount for that interface and assigns the values to each output queue.Now, if the output queues are manually assigned, the assigned value can be higher than the available buffer size and buffer oversubscription can occur. The manual assignment is possible with CLI configuration command:set class-of-service schedulers <scheduler-name> buffer-size temporal <time value in ms>With the above command the output queue buffer size is assigned using the time value - the amount of time this queue should buffer the packets that exceeds the interface rate or configured shaping-rate.The amount of time is configured directly in milliseconds, If I want to configure a specific output queue to buffer the packets in case of congestion for 4 seconds, I set this value directly with 4M which means 4 million microseconds = 4 seconds:
set class-of-service schedulers <scheduler-name> buffer-size temporal 4M
Depending on the SRX device, the interface type and the shaping-rate configured, the buffer memory value can be insufficient to ensure 4 seconds buffering.For example:A hypothetical device has a buffer size of 1MB for an interface.If I configure the COS buffer size per output queue with "buffer-size percent" it is automatically calculated and assigned to respective queues.If I configure the COS buffer size per output queue with "buffer-size temporal" - I manually specify the time to buffer the packets in congested network.For a configured shaping rate of 100Mbps "buffer-size 4M" of four seconds, the necessary buffer for that output queue is:100*4=400MB it's 400 times oversubscription of the available buffer memory of 1MB.
More details in and calculation mode can be found in Scheduler Buffer Size Overview.
To found out output queue buffer memory size for a specific SRX device and interface depending on the COS configuration - contact JTAC.The general recommendation is to use percentage based assignment to let Junos calculate and assign buffer size automatically.