Shared Shaping
In the JUNOSe QoS implementation, you configure a traffic-class group to create a separate scheduler hierarchy. Traffic classes in a traffic-class group are queued through a scheduler hierarchy dedicated to that group. QoS supports up to five user-configurable, named traffic-class groups. Traffic classes that do not belong to any named group are considered to belong to the default traffic-class group. With the factory default configuration, the best-effort traffic class is in the default traffic-class group.
Shared shaping is a mechanism for shaping a logical interface's aggregate traffic to a rate when the traffic for that logical interface is queued through more than one scheduler hierarchy. For example, a service provider may configure QoS for voice, video, and data traffic on a single ATM VC. The video traffic and the voice traffic are placed in separate scheduler hierarchies from the data traffic to provision the low latency that is required for voice traffic and the higher bandwidth that is required for video traffic.
In this scenario, the data traffic needs to be dynamically shaped so that its rate matches the bandwidth available after the voice and video bandwidth requirements are met. When less voice and video traffic is being forwarded, then the data traffic should expand to fill the line rate.
Shared shaping is typically enabled on the access-facing line module, but you can enable the feature for any interface type recognized by QoS, on any line module and any JUNOSe router.
Sharing Bandwidth with the SAR
On ATM line modules, providers can use the SAR to implement bandwidth sharing for VCs. When the SAR is operating in default mode (that is, when the no qos-mode-port command is in effect), the SAR backpressures the VC node in the default traffic-class group, but traffic that is queued through a named traffic-class group is unaffected by VC backpressure. In the absence of voice and video traffic, the VC runs data traffic at the shared rate. When voice and video traffic start streaming, the SAR backpressures just the VC node in the default traffic-class group, thus sharing the bandwidth.
However, providers need to configure shared shaping on more than just ATM VCs. The SAR cannot support shared shaping per virtual path on ATM, and there is no SAR on Ethernet line modules. The shared shaper implemented in the HRR scheduler can support shared shaping for all these different configurations.
How Shared Shaping Works
You can configure the shared-shaping rate on either the best-effort scheduler node or the best-effort queue for the logical interface. If you specify shared shaping for the best-effort node, the shared shaper is said to be node controlled. If you specify shared shaping for the best-effort queue, the shared shaper is said to be queue controlled. The router locates the queues in named traffic-class groups that are associated with the logical interface and shapes that set of queues to the shared rate. The shared-shaping rate is the total bandwidth for the logical interface.
A typical configuration places the low-latency voice traffic in the auto-strict-priority traffic-class group and video traffic in a separate extended traffic-class group. The data traffic is usually queued in the best-effort traffic class in the default traffic-class group.
Two types of shared shaping are available, depending on your hardware. Simple shared shaping can shape the best-effort node or queue associated with a logical interface to a shared rate. Compound shared shaping is a hardware-assisted mode that controls bandwidth for all scheduler objects associated with the subscriber logical interface.
The constraints of both the legacy hierarchical scheduler and the shared shaper affect the bandwidth of scheduler objects. The shared shaper limits the bandwidth even when the port or VP is not congested. When the port or VP is congested, the legacy scheduler is dominant. For example, when a heavily oversubscribed VP becomes congested, the legacy hierarchical scheduler may limit the VP bandwidth to a lower rate, so that shared shaping of excess bandwidth is moot.
Simple Shared Shaping
Simple shared shaping shapes the best-effort node or queue associated with a logical interface to a shared rate. Once per second, the simple shared shaper calculates the combined rate of the voice and video queues for the logical interface, and shapes the best-effort queue for the data traffic to the shared rate minus the video and voice queue rates. The bandwidth for the voice and video queues is determined by the configuration of the hierarchical scheduler. The shared shaper does not actively manage the video and voice queues.
Simple Shared Shaping Example
In Figure 12, the AF traffic-class group contains the video traffic class. The EF traffic-class group contains the voice traffic class. The best-effort traffic class remains outside any traffic-class group. Because the voice, video, and data queues are stacked in separate scheduler hierarchies, you must use the shared shaper to shape the logical interface aggregate to a single rate.
In this example, VC 1 is configured for voice and data. VC 2 is configured for data and video. VC 3 is configured for data, voice, and video. The shared shaper is configured on the best-effort node or queue for VC 1; the corresponding voice queue for VC 1 shares the configured rate.
![]()
Simple Shared Shaping on the Best-Effort Scheduler Queue
If you configure shared shaping for the best-effort queue, the shared shaper is queue controlled. Node-controlled shared shaping is generally preferable for the following reasons:
- With this configuration, the legacy scheduler can still allocate bandwidth to queues above the best-effort node based on their relative weights.
- Queues stacked above the best-effort node will still be shaped, even if they are for interfaces stacked above the shared shaper logical interface.
- For ATM in low-CDV mode, the shared-shaping rate for ATM VCs and VPs is also applied in the SAR.
Simple Shared Shaping on the Best-Effort Scheduler Node
If you have a second traffic class for data in addition to the best-effort data traffic class, you should configure shared shaping on the best-effort scheduler node. This is known as node-controlled shared shaping. In this scenario, two weighted queues are stacked above the best-effort scheduler node, one for the best-effort traffic class and the other for the second data traffic class. If you configure the shared-shaping rate on the best-effort queue, then the shared shaper may have a tendency to starve the best-effort queue in favor of the second data queue. If you instead configure the shared-shaping rate on the best-effort node, the hierarchical scheduler will allocate bandwidth between multiple data queues based on their relative weight and assured rate.
If you are configuring VP shared shaping, you should configure shared shaping on the best-effort scheduler node for the VP. Shaping the best-effort scheduler node for the VP has the effect of shaping all the VC best-effort queues for that VP. This enables you to retain the advantages of per-VC queuing in the hierarchical scheduler.
If you are configuring VC shared shaping and the SAR is operating in low-CDV mode, you generally should configure the shared-shaping rate on the best-effort scheduler node for the VP or VC. The router sets the SAR shaper for the VC or VP to match the shared-shaping rate on VC and VP nodes in the hierarchical scheduler; this is usually the desired behavior. A shared shaper configured on the best-effort queue does not trigger the matching shaper in the SAR.
Shared Shaping and Low-CDV Mode
JUNOSe releases before 6.0.0 implemented a carve-out scheduling model. If you configured multiple scheduler nodes for a VC or VP, the router added together the shaping rates for each scheduler node and shaped the corresponding VC or VP tunnel in the SAR to the sum of the rates. This implementation forced a strict-priority carve-out model for a logical interface, because the best-effort traffic cannot share unused bandwidth from the strict-priority traffic-class group.
Beginning with the JUNOSe 6.0 release, the router synchronizes the SAR rate for a VC or VP to the shared-shaping rate for the best-effort scheduler node for the VC or VP, so that the default behavior for low-CDV mode becomes shared shaping. Applying shared shaping to the best-effort queue does not synchronize the rate for the corresponding VC or VP in the SAR.
JUNOSe releases before 6.1.0 had a different behavior when multiple traffic-class groups were configured in low-CDV mode. In those releases, the shaping rates of the VC nodes in each group were added together, and the corresponding VC queue in the SAR was shaped to the sum. The same algorithm was used for shaping VP tunnels in the SAR—the shaping rates of all VP nodes in the hierarchical scheduler were added together to shape the VP tunnel in the SAR. This behavior implements a carve-out model for scheduling into VPs and VCs and generally is not as desirable as the shared shaping model supported in JUNOSe 6.1.0 and higher releases.
Beginning with JUNOSe 6.1.0, low-CDV mode causes SAR shaping of VCs and VPs only when you specify the shared-shaping-rate command for the best-effort VC or VP node in the HRR scheduler.
Compound Shared Shaping
Compound shared shaping is a hardware-assisted mode that can control bandwidth for all scheduler objects associated with the subscriber logical interface. Thus it can manage voice and video queues in addition to data queues, so that the shared rate cannot be exceeded.
Compound shared shaping can shape scheduler nodes in addition to scheduler queues. This capability makes it possible to implement hierarchical shared shaping by configuring shared shaping on VP nodes and simultaneously configure shared shaping for the VC queues stacked above the node. Compound shared shaping responds to changes in traffic rates more rapidly than simple shared shaping, on the order of milliseconds.
If you configure a compound shared shaper on hardware that does not support it, the CLI displays the following message:
host1config)#ERROR 02/08/2005 14:06:36 qos: line card in slot 11: EFA2 hardware not installed. 1 compound shared shaper(s) converted to simple.QoS automatically converts the erroneously configured compound shared shaper to a supported simple shared shaper.
Shared Shaping Constituents
When you specify a shared-shaping rate on a best-effort node or queue, QoS shapes the aggregate of traffic for the logical interface that owns the best-effort queue or node. QoS locates the queues and nodes owned by that logical interface and applies the shared shaper to them. The nodes and queues owned by the interface are called the constituents of the shared shaper instance. For example, if the logical interface type is VC, the constituents are all VC objects: VC nodes and VC queues. A shared-shaping rule in a profile can apply to up to eight constituents.
Active constituents are those that are actively controlled by the shared shaper mechanism. Inactive constituents are those that are not controlled. For example, when ATM VC queues are stacked above an ATM VC node, the ATM VC node might be an active constituent. In this case, the queues stacked above the node are shaped to the shared rate indirectly by the hierarchical scheduler, making the queues inactive constituents of the shared shaper. If the ATM VC queues are the active constituents, then the ATM VC node is inactive.
Shared shaping supports both implicit and explicit constituent selection. Implicit constituent selection is the easier of the two methods and works well for most cases. With implicit selection, you configure a shared-shaping rate on the best-effort node or queue and QoS locates the other constituents automatically. The mechanism that determines which constituents are considered active differs for simple and compound shared shapers. Generally, simple implicit shared shapers activate the queues in named traffic-class groups, but compound implicit shared shapers activate the nodes in the named groups.
Explicit selection is important if you want to shape a subset of the interface traffic to the shared rate. An example of this is when you want the sum of best-effort and voice traffic to be shaped to the shared rate, but want video traffic to be exempt from the shared shaping rate.
Active constituents are selected either implicitly by QoS or explicitly by the user. Active constituents of the simple shared shaper can be the best-effort node and any queues in named traffic-class groups. A node that is not a best-effort node cannot be an active constituent of the simple shared shaper. If you choose the best-effort node as an active constituent, queues above that node are not active constituents. Active constituents of the compound shared shaper can be nodes or queues. If you choose a node as an active constituent, queues above it are not active constituents.
Inactive constituents are queues that are stacked above an active node or nodes stacked below active queues. For both of these situations, the shared shaper controls the active constituents, and the legacy scheduler indirectly controls the inactive constituents to achieve the shared rate. The other case for inactive constituents is when you use explicit constituent selection and some of the nodes and queues are explicitly not included in the shared shaper.
To use implicit constituent selection, you specify only the shared-shaping rate and the logical interface. The router identifies the constituents associated with the logical interface type and their allocated bandwidth. This method is appropriate for the mainstream case where the intent is to shape all subscriber queues to the shared rate. For more information and examples about implicit selection, see Implicit Constituent Selection.
If you want instead to shape a subset of the queues for a subscriber to the shared rate, the explicit selection process is appropriate. Explicit selection is also useful when you want queues as the active constituents instead of the node below them. By choosing queues you can assign appropriate priority or weights.
For more information and examples about explicit selection, see Explicit Constituent Selection.
Types of Shared Shapers
The shared-shaping-constituent command in a scheduler profile specifies constituents and their attributes. The command has two aspects. For explicit constituent selection, this command specifies the constituents. For the compound shared shaper only, this command specifies scheduling attributes of shared shaping: the shared priority and the shared weight.
A shared shaper can be one of the following four types:
- Simple implicit—Constituents are the best-effort node or queues, and all queues in named traffic-class groups. Nodes in named groups are not constituents. The constituents in named groups are monitored but not controlled. The shared-shaping-constituent command is ignored.
- Simple explicit—The software selects constituents based on the shared-shaping-constituent command, but it cannot activate scheduler nodes in the named traffic-class groups. The weight and priority attributes of the shared-shaping-constituent command are ignored, because the simple shared shaper does not allocate bandwidth among constituents; instead it controls just the best-effort queue or node.
- Compound implicit—Constituents are selected automatically by the software. If a node exists in a given traffic-class group, the node is active and the queues stacked above it are inactive constituents. The shared-shaping-constituent command does not affect constituent selection. However, if the command is present for a constituent that was implicitly selected, the software configures that constituent with the shared priority and shared weight as indicated.
- Compound explicit—The software selects constituents based on the shared priority and shared weight configured with the shared-shaping-constituent command. If no attributes are specified, the software supplies a shared priority consistent with the legacy scheduler configuration.
Implicit Constituent Selection
The implicit selection process for simple shared shaping operates according to the following rules:
- The point at which the scheduler profile that contains a shared-shaping-rate command is associated with a best-effort node or best-effort queue determines the logical interface type that the shared shaper applies to. Logical interface types include IP, VP, VC, VLAN, and so on.
- All nodes and queues for the same logical interface are potential constituents.
- The best-effort node is selected if you configure node-based shared shaping. The best-effort queue is selected if you configure queue-based shared shaping. If you configure both, then the best-effort node is selected over the best-effort queue.
- Non-best-effort queues are selected.
The implicit selection process for compound shared shaping operates according to the following rules:
- The point at which the scheduler profile that contains a shared-shaping-rate command is associated with a best-effort node or best-effort queue determines the logical interface type that the shared shaper applies to. Logical interface types include IP, VP, VC, VLAN, and so on.
- All nodes and queues for the same logical interface are potential constituents.
- Nodes are selected over queues.
For example, suppose a shared shaper is associated with a particular interface type. A node for that interface type is present and has a queue for that interface type stacked above it. The node is selected and becomes an active constituent; the queue is not selected.
Now suppose a shared shaper is associated with a logical interface at the best-effort node, and a second shared shaper is simultaneously associated with the same interface at the best-effort queue, In this case, the node is selected as the constituent, because nodes are selected over queues.
In Figure 13, scheduler profile A includes a shared-shaping rule, and is associated with the best-effort node for VC 2. The constituents are all the scheduler objects associated with VC 2: VC 2 nodes and VC 2 queues. Nodes are selected over queues, so the implicitly selected active constituents are the VC 2 default group node, the VC 2 Group EF node, and the VC 2 Group AF node.
![]()
In Figure 14, scheduler profile B is associated with the best-effort queue for VC 3. This association indicates that the logical interface type being shared is VC. The constituents are all the scheduler objects associated with VC 3: VC 3 nodes and VC 3 queues. Nodes are selected over queues, so the implicitly selected active constituents for profile B's shared shaper are the VC 3 default group queue, the VC 3 Group EF node, and the VC 3 Group AF node. The VC 3 default group queue is selected instead of the VC 3 default group node because the shared shaper is associated with that best-effort queue.
![]()
Figure 15 illustrates some other examples of implicit constituent selection. It does not reflect typical configurations, but includes a mixture of interface types: IP, VC, and VP. If only scheduler profile A is applied, the associated interface is VC 1. The selected constituents then consist of the VC 1 best-effort node, the VC 1 TC voice queue, and the VC 1 TC video queue.
If instead only scheduler profile B is applied, the associated interface is IP 1. The selected constituents then consist of the IP 1 best-effort queue, the IP 1 TC voice queue, and the IP 1 TC video queue.
Finally, if only scheduler profile C is applied, the associated interface is VP 1. The selected constituents then consist of the VP 1 default group node, the VP 1 Group EF node, and the VP 1 Group AF node.
![]()
Implicit Bandwidth Allocation for Compound Shared Shaping
After selecting the implicit constituents for compound shared shaping, the router places the constituents in an order that determines how the constituents can claim a share of the available shared bandwidth.
The compound shared shaper mechanism actively allocates the bandwidth it receives from the hierarchical scheduler to each active constituent, based on its own rules, independent of the hierarchical scheduler. Constituents are either priority constituents or weighted constituents. These attributes are specified either explicitly, using the shared-shaper-constituent command, or implicitly.
Compound shared shaper scheduling allocates bandwidth as follows. Priority constituents consume as much of the shared bandwidth as they can, subject to the bandwidth allocated to them by the hierarchical scheduler. Priority constituents are ordered according to their priority. The weighted constituents subdivide the remaining shared bandwidth in proportion to their shared weights, again subject to the bandwidth allocated to them by the hierarchical scheduler.
When it implements compound implicit shared shapers, the software selects attributes for the active constituents consistent with the hierarchical scheduler. Auto-strict nodes and queues have the highest priority. Nodes and queues in extended traffic-class groups are next. Nodes and queues in the default traffic-class group have the lowest priority.
For example, suppose a compound shared shaper has a rate of 2 Mbps. The shared shaper has three active constituents: the best-effort node, a voice queue in the auto-strict traffic-class group, and a video queue in an extended traffic-class group. For compound implicit shared shaping, the shared shaper assigns the voice queue all the 2MB, the video queue the next priority, and the best-effort node the last priority. The voice queue is unlikely to drop because it has highest priority in the hierarchical scheduler as well as highest priority within its shared shaper. The video queue is less likely to drop, but you must still take care that the hierarchical scheduler is provisioned to allocate the proper assured bandwidth to video. The shared shaper can shape, or deny, bandwidth to its constituents, but it cannot allocate assured bandwidth in the hierarchical scheduler.
Another view of the compound shared shaper mechanism is the following. In the legacy scheduler, weight and shaping rate are independent attributes that together determine bandwidth allocation. The scheduler allocates bandwidth based on relative weights, and the shaper can deny that bandwidth when the shaping rate is reached. With the shared shaper in effect, there are two independent shaping rates that must be satisfied in order for the queue or node to dequeue. A deficit in either type of shaping will bound the bandwidth.
As a general way of predicting the scheduler behavior, if the physical port is congested because there are many queues and nodes competing in the hierarchical scheduler, the legacy weights and shaping rates will dominate the scheduler outcome. If the hierarchical scheduler is not congested, a shared shaper configured for a logical interface will dominate the outcome for the traffic scheduled through that logical interface.
The compound shared shaper orders constituents, and allocates shared bandwidth to them, according to the following rules:
For multiple strict-priority traffic-class groups, bandwidth allocation order is the same order in which the additional strict traffic class groups were configured. You can issue the show traffic-class-groups command to view this order.
For multiple extended traffic class groups, bandwidth allocation order is the same order in which the traffic class groups were configured. You can issue the show traffic-class-groups command to view this order.
- Strict constituents in the default group.
- Weighted constituents in the auto-strict-priority traffic class group.
- Weighted constituents in extended traffic class groups.
- Weighted constituents in the default group.
Strict constituents transmit traffic at a rate up to the lesser of their shared-shaping rate or the legacy shaping rate. This behavior is the default. Individual strict constituents can be allocated any bandwidth value less than the shared rate. The sum of all constituent rate credits does not have to be less than the shared rate. Individual constituent rates are not capped, because it is often the case that a particular traffic class won't exceed a limit because of admission control, or because the class is policed at some point in the path.
Unlike strict constituents, which can consume bandwidth up to the legacy shaping rate or the shared-shaping rate, weighted constituents share bandwidth with their peers solely in proportion to their shared-shaping-weight. A higher weight value grants the constituent a greater proportion of the available bandwidth.
Although a shared shaper can be applied to up to eight constituents, only four of these can be weighted constituents. If you configure more than four weighted constituents as part of the same shared shaper, the first four are treated as weighted constituents but the remainder are handled as strict constituents, generating a warning message.
Weighted Compound Shared Shaping Example
Weighted shared shaping is most useful for sharing bandwidth between traffic classes carrying TCP data. Figure 16 shows an application of weighted shared shaping where weighted constituents span multiple traffic class groups, making them ineligible for legacy weighted scheduling. Best-effort data and premium data constituents are weighted.
![]()
Scheduler profile A specifies the shared-shaping rate of 1Mbps for the best-effort node, which is associated with a VC logical interface. The node is further configured with a weight of 1. Scheduler profile B specifies the VC 1 AF node as a weighted constituent with a weight of 31.
The implicitly selected constituents of the shared shaper are the VC 1 best-effort node, the VC 1 AF group node, and the VC 1 EF group node. Bandwidth is allocated as follows:
- The VC 1 EF group node is strict and can transmit up to the shared-shaping rate of 1Mbps. Any remaining bandwidth is available to the remaining constituents.
- The VC 1 AF group node is weighted with the VC 1 best-effort node. The sum of the constituent weights is 32. With a weight of 31, the VC 1 AF group node can transmit 31/32nds of the available bandwidth when both constituents are competing for bandwidth.
- The VC 1 best-effort node is weighted with VC 1 AF group node. The sum of the constituent weights is 32. With a weight of 1, the VC 1 best-effort node can transmit 1/32 of the available bandwidth when both constituents are competing for bandwidth.
Explicit Constituent Selection
If you want only a subset of the queues for a subscriber to be shaped to the shared rate, then you must explicitly identify the desired constituents rather than accepting the implicitly selected constituents.
For compound shared shaping, explicit selection is also useful when you want queues as the active constituents instead of the node below them. By choosing queues you can assign appropriate priority or weights.
In the set of nodes and queues for a logical interface, only scheduler objects associated with a scheduler profile that includes a shared-shaping-constituent command are considered constituents. Objects that are not explicitly selected are exempt from the shared shaper.
To identify the constituents for simple shared shaping, include the explicit-constituents keyword with the shared-shaping-rate simple command in a scheduler profile that you associate with a best-effort node or queue to identify the logical interface.
For compound shared shaping, omit the simple keyword. For a compound shared shaper, you can further designate the explicit constituents as strict or weighted.
Table 18 compares implicit and explicit shared shaping.
Explicit Shared Shaping Example
In Figure 17, two scheduler profiles are applied to scheduler objects VC 1 best effort node, VC 1 AF node, and VC 1 EF node. The shared-shaping-constituent command in each profile specifies that the associated object is an explicit constituent of the shared shaper.
![]()
In this example, the VC shared shaper has two explicit constituents, the VC 1 best effort node and the VC 1 Group EF node. By default, these constituents are considered to be strict constituents with a priority of 8.
If implicit selection rules were followed in this example, the association of the shared shaper with the VC 1 best-effort node would have selected the VC 1 best effort node, the VC 1 Group EF node, and the VC 1 Group AF node.
Explicit Weighted Compound Shared Shaping Examples
Figure 18 illustrates a case where scheduler profiles A, B, C, D and E are applied to scheduler objects.
![]()
In Case 1, scheduler profile A associates the shared-shaping rate with the VLAN 1 best-effort queue. Table 19 lists the explicit constituents of the shared shaper and the bandwidth allocated to each constituent:
Figure 19 illustrates another case where scheduler profiles B, X, Y, and Z are applied to scheduler objects. Each profile assigns a weight to an explicit constituent.
![]()
In Case 2, scheduler profile B associates the shared-shaping rate with the VLAN 1 best-effort queue. Table 20 lists the explicit constituents of the shared shaper and the bandwidth allocated to each constituent:
Simple Shared Shaping Configuration Examples
Configure the shared shaper by specifying a shared-shaping rate for either the best-effort queue or the best-effort scheduler node for the logical interface. The router locates the other queues associated with the logical interface and shapes that set of queues to the shared rate.
You do not explicitly specify shared shaping on the other queues for the logical interface. You can configure individual shaping rates on the other queues that are less than the shared rate. These individual shapers have the effect of reserving some of the shared bandwidth for the other queues.
shared-shaping-rate
- Use to set shared-shaping rate and burst size for the logical interface.
- To configure the shared shaping feature, this command must appear in the scheduler profile for either the best-effort queue or the best-effort scheduler node.
- You can specify simple to shape data queue rates to the the value of the shared rate minus the combined voice and video traffic rate. By default, shared shaping is set to auto. In this mode, the router selects the type of shared shaping that is applied according to the type of line module. Compound shared shaping is hardware-dependent. If you specify compound for line modules that do not support it, an error message is generated and the router applies simple shared shaping.
- The explicit-constituents keyword overrides automatic selection of compound shared-shaping constituents and enables you to explicitly specify constituents and bandwidth allocation. This keyword does not apply to simple shared shaping. If you issue the keyword for modules that do not support compound shared shaping, the CLI generates an error message and the keyword has no effect.
- The range for the shared-shaping rate is 64000-100000000 bps (64 Kbps-1 Gbps); the default is no shaping rate.
- Burst is the catch-up number associated with the shaper; the range is 0-522240 (0-510 KB). You can specify 0 to enable the router to select an applicable default value.
- Example
host1(config-scheduler-profile)#shared-shaping-rate 128000 burst 32767 simpleUse the no version to delete the shared-shaping rate. VC Simple Shared Shaping Example
The following commands configure a simple shared shaper for a VC, as shown in Figure 12. In this example, the best-effort queue for logical interface VC 3 is shaped to a shared rate of 1 Mbps. The voice and video queues for VC 3 share the 1 Mbps with the best-effort traffic. The voice queue has first claim on the shared 1 Mbps, but only up to its individual shaping rate of 200 Kbps. The video queue claims up to the next 300 Kbps. The best-effort queue obtains whatever bandwidth remains of the 1 Mbps after the voice and video traffic have made their claims.
- Configure the traffic classes and traffic-class groups.
(config)#traffic-class voice(config-traffic-class)#fabric-strict-priority(config-traffic-class)#exit(config)#traffic-class video(config-traffic-class)#exit(config)#traffic-class-group EF auto-strict-priority(config-traffic-class-group)#traffic-class voice(config-traffic-class-group)#exit((config)#traffic-class-group AF extended(config-traffic-class-group)#traffic-class video(config-traffic-class-group)#exit- Configure the shared shaper.
(config)#scheduler-profile 200kbps(config-scheduler-profile)#shaping-rate 200000(config-scheduler-profile)#exit(config)#scheduler-profile 300kbps(config-scheduler-profile)#shaping-rate 300000(config-scheduler-profile)#exit(config)#scheduler-profile shared-1mbps(config-scheduler-profile)#shared-shaping-rate 1000000 simple(config-scheduler-profile)#exit(config)#qos-profile subscriber-default-mode(config-qos-profile)#atm-vc node(config-qos-profile)#atm-vc node group AF(config-qos-profile)#atm-vc node group EF(config-qos-profile)#atm-vc queue traffic-class best-effort scheduler-profile shared-1mbps(config-qos-profile)#atm-vc queue traffic-class video scheduler-profile 300kbps(config-qos-profile)#atm-vc queue traffic-class voice scheduler-profile 200kbps(config-qos-profile)#exit- Delete the rule in the default port type profile that creates IP best-effort queues by default.
config)#qos-profile atm-default(config-qos-profile)#no ip queue traffic-class best-effort(config-qos-profile)#exit- Attach the profile to the ATM subinterface for VC 3.
(config)#interface atm 11/0.10(config-subif)#qos-profile subscriber-default-mode(config-scheduler-profile)#exitThe qos-profile subscriber-default-mode command shown in this example is appropriate if you have configured the SAR to be in default mode (by issuing the no qos-mode-port command). If this QoS profile were attached in low-CDV mode, the shaper would be effective but the CDV would not be correctly bounded, because the VC will not be reshaped in the SAR.
The following commands configure a QoS profile different from the one shown above. In this example, the best-effort scheduler node for VC 3 is shaped to a shared rate of 1 Mbps. The qos-profile subscriber-low-cdv-mode command is appropriate if you configure the SAR in low-CDV mode (by issuing the qos-mode-port low-cdv command). Here the VC will be reshaped to 1 Mbps in the SAR. If this QoS profile were attached in the SAR default mode, the 1-Mbps shaper would be disabled by VC backpressure from the SAR.
(config)#qos-profile subscriber-low-cdv-mode(config-qos-profile)#atm-vc node scheduler-profile shared-1mbps(config-qos-profile)#atm-vc node group AF(config-qos-profile)#atm-vc node group EF(config-qos-profile)#atm-vc queue traffic-class best-effort(config-qos-profile)#atm-vc queue traffic-class video scheduler-profile 300kbps(config-qos-profile)#atm-vc queue traffic-class voice scheduler-profile 200kbps(config-qos-profile)#exitVP Simple Shared Shaping Example
In the example shown in Figure 20, VP 1 is shaped to a shared rate of 5 Mbps. The shared shaper requires that voice and video traffic be carried in queues associated with the logical interface, which in this scenario is the VP. VP-level queuing does not guarantee fairness to the voice and video traffic for each VC, but fairness is not a major issue because admission control guarantees that the voice and video queues will not become congested.
This example assumes the same traffic class and traffic-class group configurations that were used in VC Simple Shared Shaping Example.
![]()
The following set of commands configures the shared shaper in Figure 20.
(config)#scheduler-profile 2mbps(config-scheduler-profile)#shaping-rate 2000000(config-scheduler-profile)#exit(config)#scheduler-profile 400kbps(config-scheduler-profile)#shaping-rate 400000(config-scheduler-profile)#exit(config)#scheduler-profile shared-5mbps(config-scheduler-profile)#shared-shaping-rate 5000000 simple(config-scheduler-profile)#exit(config)#qos-profile vp-subscriber1(config-qos-profile)#atm-vp node scheduler-profile shared-5mbps(config-qos-profile)#atm-vp node group AF(config-qos-profile)#atm-vp node group EF(config-qos-profile)#atm-vc node(config-qos-profile)#atm-vc queue traffic-class best-effort scheduler-profile default(config-qos-profile)#atm-vp queue traffic-class video scheduler-profile 2mbps(config-qos-profile)#atm-vp queue traffic-class voice scheduler-profile 400kbps(config-qos-profile)#exitIn this example, the best-effort scheduler node for the VP is shaped to a shared rate of 5 Mbps. The EF and AF queues for the VP share the 5 Mbps with the best-effort traffic. The EF queue has first claim on the shared 5 Mbps, but only up to its individual shaping rate of 400 Kbps. The AF queue claims up to the next 2 Mbps. The VC-level best-effort queues obtain whatever bandwidth remains of the 5 Mbps after the AF traffic and EF traffic have made their claims. This QoS profile is appropriate for low-CDV mode. If the provider configures a shapeless VP tunnel in the SAR, QoS sets the SAR shaper for the VP to match the 5-Mbps shared-shaping rate, and the CDV will be bounded for the VP tunnel.
Shared Shaping and Individual Shaping
You can use both the shared-shaping-rate command and the shaping-rate command in a single scheduler profile. For example, you can shape the best-effort node or queue to accept less than the remainder of the shared-shaping rate as in the following commands:
(config)#scheduler-profile shared-1mbps(config-scheduler-profile)#shared-shaping-rate 1000000 simple(config-scheduler-profile)#shaping-rate 500000If you configure a shaping rate higher than the shared-shaping rate, the rate will never exceed the shared rate anyway, so the router issues the following error message:
% shaping-rate cannot be greater than the shared-shaping-rateCompound Shared Shaping Configuration Examples
Compound shared shaping requires that you set a shared-shaping rate in a scheduler profile associated with a best-effort node or queue. You can let the router implicitly select the constituents of the shared shaper, or you can explicitly select the constituents by issuing the explicit-constituents keyword when you set the shared-shaping rate. The shared-shaping-constituent command enables you to identify specific explicit constituents. Use the same command to set attributes for both implicit and explicit constituents that determine how bandwidth is allocated among the constituents.
shared-shaping-rate
- Use to set shared-shaping rate and burst size for the logical interface.
- To configure the shared shaping feature, this command must appear in the scheduler profile for either the best-effort queue or the best-effort scheduler node.
- Specify the compound keyword to actively shape voice and video traffic so that the shared rate cannot be exceeded, and shape data queue rates to the value of the shared rate minus the combined voice and video traffic rate.
- By default, shared shaping is set to auto, where the router selects the type of shared shaping that is configured, depending on the line module. An error message is generated if you specify compound for line modules that do not support it, and the router applies simple shared shaping. The simple keyword is appropriate for simple shared shaping, where you want to shape data queue rates to the the value of the shared rate minus the combined voice and video traffic rate.
- By default the router identifies the shared shaper constituents associated with the logical interface. You can override this automatic selection by issuing the explicit-constituents keyword. Specify the desired subset of the potential constituents and their bandwidth with the shared-shaping-constituents command.
- The range for the shared-shaping rate is 64000-100000000 bps (64 Kbps-1 Gbps); the default is no shaping rate.
- Burst is the catch-up number associated with the shaper; the range is 0-522240 (0-510 KB). Specifying 0 enables the router to select an applicable default value.
- Example
host1(config-scheduler-profile)#shared-shaping-rate 128000 burst 32767 compound explicit-constituentsUse the no version to delete the shared-shaping rate. shared-shaping-constituent
- Use to specify explicit constituents and to set the attributes of both implicit and explicit shared-shaping constituents that determine how bandwidth is allocated to them.
- You can specify a constituent as strict or weighted. Strict-priority constituents are allocated bandwidth ahead of weighted constituents.
- You can optionally set a value that determines the precedence of a constituent among its peers (strict or weighted) for claiming bandwidth.
- For strict-priority constituents, the range is 1-8 and the default value is 8. A lower value correlates to a higher claim.
- For weighted constituents, the range is 1-31 and the default value is 8. The weights of all sibling weighted constituents are added together. Then each weighted constituent is allocated bandwidth according to the proportion of its weight to the total.
host1(config-scheduler-profile)#shared-shaping-constituent weight 28Use the no version to delete the attributes of a constituent or to delete an explicit constituent. Configuration Restrictions
Although you can configure a shared-shaping rate and a shaping rate in the same scheduler profile, the shaping-rate must not exceed the shared-shaping rate. A scheduler profile that includes a shaping rate must not contain a shared-shaping rate that specifies a constituent as weighted.
A scheduler profile that includes a shared-shaping rate cannot be associated with a queue other than the best-effort queue or a node other than the best-effort node.
A scheduler profile that is referenced by nodes or queues that are not best effort cannot be modified to include a shared-shaping rate command. A scheduler profile that includes a shared-shaping rate command cannot be associated with a group node.
VC Compound Shared Shaping Example
The following commands configure the network shown in Figure 21. This example illustrates a typical DSL "triple play" configuration, involving voice, video, and data traffic. In this example, 1 Mbps of bandwidth is allocated to voice, video, and best-effort data traffic associated with the VC 1 logical interface.
The voice queue in the EF traffic-class group for VC 1 is a strict constituent that has first claim on up to 200 Kbps of the shared bandwidth. The video queue in the AF traffic-class group is a strict constituent that can claim up to 300 Kbps of the remaining 800-1000 Kbps of shared bandwidth. The best-effort queue for logical interface VC 1 is a strict constituent that has the last claim to the remaining 500-1000 Kbps of shared bandwidth.
![]()
- Configure the traffic classes, traffic-class groups, and additional scheduler profiles.
- Configure the scheduler profile that defines the shared shaper and the profiles that apply the legacy shaper.
host1(config)#scheduler-profile shared-1Mbpshost1(config-scheduler-profile)#shared-shaping-rate 1000000 burst 32768 autohost1(config)#scheduler-profile 300Kbpshost1(config-scheduler-profile)#shaping-rate 300000host1(config)#scheduler-profile 200Kbpshost1(config-scheduler-profile)#shaping-rate 200000- Configure the QoS profile.
host1(config)#qos-profile vcSharedShaping- Create group nodes.
host1(config-qos-profile)#atm group AF scheduler-profile defaulthost1(config-qos-profile)#atm group EF scheduler-profile default- Create VC nodes for each group and for traffic in the default group.
host1(config-qos-profile)#atm-vc nodehost1(config-qos-profile)#atm-vc node group AFhost1(config-qos-profile)#atm-vc node group EF- Create queues for the best-effort, video, and voice traffic. Apply the scheduler profile that defines the shared shaping rate to the best-effort queue. Apply the legacy shaper profiles to the voice and video traffic queues.
host1(config-qos-profile)#atm-vc queue traffic-class best-effort scheduler-profile shared-1mbpshost1(config-qos-profile)#atm-vc queue traffic-class video scheduler-profile 300Kbpshost1(config-qos-profile)#atm-vc queue traffic-class voice scheduler-profile 200Kbpshost1(config-qos-profile)#exit- Attach the QoS profile to an ATM subinterface.
host1(config)#interface atm 11/0.1host1(config-interface)#qos-profile vcSharedShapinghost1(config-interface)#exitIn this example, the constituents of the VC shared shaper are the VC 1 best effort node, the VC 1 Group EF node, and the VC 1 Group AF node. The available bandwidth is strictly allocated in the following order:
To display the sample shared shaper configuration:
host1#show shared-shaper atm 11/0.1shared currentshaping shaping shapinginterface rate rate resource rate---------------- ------- ------- ------------------------- -------atm-vc ATM11/0.1 1000000 compound best-effort atm-vc queueatm-vc best-effort nodeEF voice atm-vc queue 200000AF video atm-vc queue 300000atm-vc ATM11/0.2 1000000 compound best-effort atm-vc queueatm-vc best-effort nodeEF voice atm-vc queue 200000AF video atm-vc queue 300000Total shared shapers: 2Total constituents: 8Total failovers: 0VP Compound Shared Shaping Example
The following commands configure a compound shared shaper for a VP interface, as shown in Figure 22. VP shared shaping enables a shared shaper to apply to all the aggregate rates of all VCs within the VP.
In this example, the VP is shaped to a compound shared rate of 5 Mbps. The voice traffic gets strict priority scheduling for up to 400 Kbps of the shared rate on the VP. The video traffic gets up to 2 Mbps of the remaining 4.6-5 Mbps on the VP. Finally, the data traffic has the last claim to the remaining 2.6-3 Mbps of shared VP bandwidth.
This configuration enables data traffic to flow at 2.6 Mbps when voice and video are both using their limit. When both voice and video are quiescent, data can flow at the full 5 Mbps shared rate.
The QoS profile used in this example is appropriate for low-CDV mode. If the provider configures a shapeless VP tunnel in the SAR, QoS sets the SAR shaper for the VP to match the 5 Mbps shared-shaping rate, and the CDV is bounded for the VP tunnel. VP-level queuing does not guarantee fairness to the voice and video for each VC.
![]()
- Configure the traffic classes, traffic-class groups, and additional scheduler profiles.
- Configure the scheduler profile that defines the shared shaper and the profiles that apply the legacy shaper.
host1(config)#scheduler-profile shared-5Mbpshost1(config-scheduler-profile)#shared-shaping-rate 5000000 burst 32768 autohost1(config-scheduler-profile)#exit- Configure the scheduler-profile for AF (video) traffic.
host1(config)#scheduler-profile 2Mbpshost1(config-scheduler-profile)#shaping-rate 2000000- Configure the scheduler-profile for EF (voice) traffic.
host1(config)#scheduler-profile 400Kbpshost1(config-scheduler-profile)#shaping-rate 400000host1(config-scheduler-profile)#exit- Configure the QoS profile.
host1(config)#qos-profile vpSharedShaping- Create group nodes.
host1(config-qos-profile)#atm group AF scheduler-profile defaulthost1(config-qos-profile)#atm group EF scheduler-profile default- Create VP nodes for each group and for traffic in the default group. The scheduler profile containing the shared-shaping rate is applied to the VP node that is in the default group and contains the best-effort queue.
host1(config-qos-profile)#atm-vp node scheduler-profile shared-5Mbpshost1(config-qos-profile)#atm-vp node group AF scheduler-profile 2Mbpshost1(config-qos-profile)#atm-vp node group EF scheduler-profile 400Kbps- Create a VC node for the default group.
host1(config-qos-profile)#atm-vc node- Create queues for the best-effort, video, and voice traffic.
host1(config-qos-profile)#atm-vc queue traffic-class best-efforthost1(config-qos-profile)#atm-vc queue traffic-class AFhost1(config-qos-profile)#atm-vc queue traffic-class EFhost1(config-qos-profile)#exit- Attach the QoS profile to an ATM subinterface.
host1(config)#interface atm 11/0.1host1(config-interface)#qos-profile vpSharedShapingIn this example, the constituents of the VP shared shaper are the VP 1 default group node, the VP 1 Group EF node, and the VP 1 Group AF node. The available bandwidth is strictly allocated in the following order:
Shared Shaping Caveats
When you configure shared shaping, be sure to consider the following behaviors.
Hardware Dependency
Compound shared shaping requires new hardware that will be available in a future release, You can contact your Juniper Networks account representative for more information. If you configure compound shared shaping on modules that do not support this feature, an error message is generated.
Logical Interface Traffic Carried in Other Queues
A shared shaper affects only the queues and nodes for a single interface. Queues associated with other interfaces are not constrained by the shared shaper. This behavior should cause no problems if you configure all queues for a single logical interface type. However, if you configure queues for multiple interface types, you may have problems with shared shaping.
For example, a shared shaper for VC 1 does not directly constrain the rate for a queue for IP 1 unless that queue is stacked above a node for VC 1 in the scheduler hierarchy. If the IP queue is stacked above a node for VC 1, then the shared shaper indirectly controls the queue bandwidth through the VC 1 node. But if the IP 1 queue is not stacked above a VC 1 node, it is immune to the shared shaper, and the total bandwidth for VC 1 may exceed the shared rate.
As another example, if a shared queue exists for VP 1 where VC 1 is contained within VP 1, the shared shaper for VC 1 does not constrain the bandwidth of a VP queue. The total bandwidth for VC 1 may again exceed the shared rate.
Figure 15 illustrates an example of mixed interface shaping and its implications for implicit constituent selection for compound shared shaping.
Traffic Starvation
Traffic in the strict-priority traffic-class group can starve out other traffic competing within the shared shaper. You may wish to configure an individual shaping rate for strict-priority queues, thus reserving the remaining shared bandwidth for nonstrict traffic.
For example, the following scheduler profiles limit the subscriber's strict priority traffic to 1.0 Mbps and limits the subscriber's aggregate traffic to 1.5 Mbps. If scheduler profile strictOne specified a shaping rate greater than or equal to 1.5 Mbps, nonstrict traffic might face starvation.
host1(config)#scheduler-profile strictOnehost1(config-scheduler-profile)#shaping-rate 1000000host1(config-scheduler-profile)#exithost1(config)#scheduler-profile nonStrictOnehost1(config-scheduler-profile)#shared-shaping-rate 1500000Oversubscription
Many providers configure voice and video queues that combine to oversubscribe the shared rate. The intent is that an external admission control agent, such as RADIUS, is controlling traffic flows such that the offered load will not ever really oversubscribe the shared rate. The static oversubscribed configuration on the router removes the need for the provider to signal voice or video traffic to the router.
Burst Size
The burst size for constituents is typically shaped by the burst value that you specify in the scheduler profile with the shared-shaping-rate command. You can override this burst for a particular constituent by applying another scheduler profile to that constituent and specifying the burst value with the shaping-rate command.
The following commands configures a VC shared shaper with two constituents, best effort and voice. The best-effort constituent has a burst of 30000 and the voice constituent has a burst of 16384.
host1(config)#scheduler-profile bestEffortBursthost1(config-scheduler-profile)#shared-shaping-rate 1000000 burst 30000host1(config-scheduler-profile)#exithost1(config)#scheduler-profile voiceBursthost1(config-scheduler-profile)#shaping-rate 300000 burst 16384host1(config-scheduler-profile)#exitConfigure the QoS profile that applies the scheduler profiles:
host1(config)#qos-profile burstExamplehost1(config-qos-profile)#atm-vc nodehost1(config-qos-profile)#atm-vc node group EFhost1(config-qos-profile)#atm-vc queue traffic-class best-effort scheduler-profile bestEffortBursthost1(config-qos-profile)#atm-vc queue traffic-class voice scheduler-profile voiceBurst