How to Configure the Scheduler in Junos

By Walter J. Goralski, Cathy Gadecki, Michael Bushong

After you’ve effectively identified the inbound traffic on your router and classified it into one of your forwarding classes, you then want to turn your attention to the control the outbound flow of that traffic. The first step is to configure the scheduler on the queues. There are two major components to the scheduler configuration:

  • Schedulers: Define the properties of the outbound queues. Once they’re tied to individual interfaces and forwarding classes, all traffic matching a particular forwarding class is treated as per the definitions in the scheduler.

  • Scheduler maps: Associate a forwarding class with a scheduler. Scheduler maps are then tied to interfaces, thereby configuring the hardware queues, packet schedulers, and RED processes that operate according to the mapping.

In other words, schedulers and their maps associate resources with forwarding classes and queues. In this example, you have four customized forwarding classes, each of which requires a scheduler to be explicitly configured. To create the schedulers, configure the following:

[edit class-of-service]
schedulers {
  cos-sched-voice;
  cos-sched-video;
  cos-sched-buscrit;
  cos-sched-noncrit;
}

This configuration simply creates the schedulers. No properties are associated with these schedulers yet. That’s what the maps do.

After creating the schedulers, you want to associate each forwarding class with one of the schedulers:

[edit class-of-services]
scheduler-maps {
  forwarding-class cos-voice scheduler cos-sched-voice;
  forwarding-class cos-video scheduler cos-sched-video;
  forwarding-class cos-buscrit scheduler cos-sched-buscrit;
  forwarding-class cos-noncrit scheduler cos-sched-noncrit;
}

This configuration maps each of the forwarding classes from the previous examples to its corresponding scheduler.

You’re using four of the predefined forwarding classes. Although these forwarding classes didn’t need to be explicitly configured, only two of them had default schedulers associated with them. By default, only the best-effort traffic associated with queue 0 and the network-control traffic associated with queue 3 have schedulers (and the resources they represent) associated with them.

If you want to use either the expedited or the assured forwarding classes, you must explicitly configure a scheduler and related resources for those.