How to Shape Outbound Traffic in Junos

By Walter J. Goralski, Cathy Gadecki, Michael Bushong

The most common forwarding resource you’ll want to control is the bandwidth allocated for a particular application. For example, say that your video traffic is critical to your business, but you don’t want it consuming all of your networking resources. You still need bandwidth to handle your voice, business applications, and even network control traffic.

So it makes sense to cap the amount of bandwidth available to the video streams, in which case shaping becomes valuable. As you might expect, in the Junos OS, this resource-handling is all configured through the scheduler.

Examine the types of traffic on your network and consider these underlying assumptions about bandwidth consumption:

  • Voice traffic: The most critical traffic for this particular network. Because this business is predicated on communication between employees and customers, voice calls can never be dropped. This traffic needs to be forwarded at all costs.

  • Video traffic: Because of the dependence on streaming stock quotes, this traffic is critical to the business. However, you don’t want this traffic consuming all available bandwidth, so you want to cap it at 40 percent of the available bandwidth.

  • Business critical applications: These applications are critical to the business and must receive some amount of assured bandwidth. These applications can’t exceed 30 percent of the total bandwidth.

  • Noncritical applications: Noncritical applications don’t have a demonstrable impact on business, so they should be treated as best-effort tasks. Because they’re not business-impacting, they should not consume more than 10 percent of the available bandwidth.

Given these requirements, you must configure a number of different parameters. The configuration is done within the specified schedulers that are mapped to the forwarding classes to which this traffic is tied.

Configure strict-high scheduling

Voice traffic is delay-sensitive, so you want to ensure that voice packets in your network are serviced with minimal delay. To do so, you must configure strict priority queuing, which basically means that the voice packets will be processed before anything else is processed.

To configure the strict-priority queuing:

[edit class-of-service]
schedulers {
  cos-sched-voice {
   priority strict-high;

This configuration simply assigns the strict-high priority to the voice traffic. The scheduler map associates this scheduler with a forwarding class so that it can be used to service voice traffic.

Cap a transmission rate

Say, for example, that you want to cap the total bandwidth consumption for video traffic at 40 percent of the available bandwidth on a given interface. To specify the maximum percentage of total bandwidth that a particular forwarding class can use, configure a transmit rate:

[edit class-of-service]
schedulers {
  cos-sched-video {
   transmit-rate percent 40;
  cos-sched-buscrit {
   transmit-rate percent 30;
  cos-sched-noncrit {
   transmit-rate percent 10;

This configuration sets the maximum transmission rate at the specified percentage. If the total throughput on a link is 1.5 Mbps, setting a transmit rate of 40 percent means that the forwarding class can, at most, consume 600 Kbps.