Guidelines for Scheduling Algorithm

Both queuing and scheduling are used to decrease traffic congestion. It is recommended to apply the scheduling algorithm only when there is no traffic transmitted / received on that port.

By default, strict-priority is configured as scheduling algorithm (as default scheduler). A disadvantage of this algorithm is that if there is enough traffic in the strict priority queue, other traffic can be completely starved of bandwidth.

Weighted Round Robin (WRR) is one of the scheduling algorithms used by the device. In WRR, there is a number of queues and to every queue is assigned weight (w). In a classical WRR, the scheduler cycles over the queues, and when a queue with weight w is visited, the scheduler can send consequently a burst of up to w packets. This works well for packets with the same size.

In the more general case of IP networks with variable size packets, the part of the bandwidth received by each queue depends not only on the weights but also of the packets sizes. To approximate the generalized processor sharing (GPS), the weight factors must be adjusted based on the packet size. That requires estimation of the average packet size, which makes a good GPS approximation hard to achieve with WRR.

Deficit Round Robin is a later variation of WRR that achieves better GPS approximation without knowing the mean packet size of each connection in advance.

Configuring Scheduling Algorithm

  1. To set scheduler algorithm as strict-priority, execute the following.

    Type the following:

    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Enter Interface Configuration Mode.
    iS5comm(config)# scheduler 2 interface gigabitethernet 0/1 sched-algo strict-priority
  2. To set scheduler algorithm as Weighted Round Robin (WRR), execute the following.

    Type the following:

    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Enter Interface Configuration Mode.
    iS5comm(config)# scheduler 2 interface gigabitethernet 0/2 sched-algo wrr
    iS5comm(config)# queue 1 interface gigabitethernet 0/2 scheduler 2 weight 20
    iS5comm(config)# queue 2 interface gigabitethernet 0/2 scheduler 2 weight 30
    iS5comm(config)# queue 3 interface gigabitethernet 0/2 scheduler 2 weight 20
    iS5comm(config)# queue 4 interface gigabitethernet 0/2 scheduler 2 weight 40
    iS5comm(config)# queue 5 interface gigabitethernet 0/2 scheduler 2 weight 30
    iS5comm(config)# queue 7 interface gigabitethernet 0/2 scheduler 2 weight 40
    iS5comm(config)# queue 8 interface gigabitethernet 0/2 scheduler 2 weight 40
    iS5comm(config)# scheduler 2 interface gigabitethernet 0/3 sched-algo wrr
    iS5comm(config)# queue 1 interface gigabitethernet 0/2 scheduler 2 weight 20
    • Exit the Global Configuration Mode
    iS5comm(config)# exit
  3. View the configuration detail.

    Type the following.

    iS5comm# show interface rate-limit
    QoS Scheduler Entries
    ---------------------
    IfIndex SchedulerIndex SchedulerAlgo Shape Index SchedulerHL GlobalId
    ---------- --------------- -------------------- ----------- ------------ 
    Gi0/2      2 weightedRoundRobin   0           0            29
    Gi0/3      2 weightedRoundRobin   0           0            30
    Gi0/4      1 strictPriority       0           0            4
    Gi0/5      1 strictPriority       0           0            5
    Gi0/6      1 strictPriority       0           0            6
    Gi0/7      1 strictPriority       0           0            7
    Gi0/8      1 strictPriority       0           0            8
    Gi0/9      1 strictPriority       0           0            9
    Gi0/10     1 strictPriority       0           0            10
    Gi0/11     1 strictPriority       0           0            11
    Gi0/12     1 strictPriority       0           0            12
    Gi0/13     1 strictPriority       0           0            13
    Gi0/14     1 strictPriority       0           0            14
    Gi0/15     1 strictPriority       0           0            15
    Gi0/16     1 strictPriority       0           0            16
    Gi0/17     1 strictPriority       0           0            17
    Gi0/18     1 strictPriority       0           0            18
    Gi0/19     1 strictPriority       0           0            19
    Gi0/20     1 strictPriority       0           0            20
    Gi0/21     1 strictPriority       0           0            21
    Gi0/22     1 strictPriority       0           0            22
    Gi0/23     1 strictPriority       0           0            23
    Gi0/24     1 strictPriority       0           0            24
    Ex0/1      1 strictPriority       0           0            25
    Ex0/2      1 strictPriority       0           0            26
    Ex0/3      1 strictPriority       0           0            27
    Ex0/4      1 strictPriority       0           0            28
  4. To delete configured scheduling algorithms, use the no-form of the scheduler command.

    Type the following:

    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • use the no-form of the scheduler command.
    iS5comm(config)# no scheduler 2 interface gigabitethernet 0/3
    • Exit Global Configuration Mode.
    iS5comm(config)# exit
    • View the deletion.
    iS5comm(config)# show scheduler
    QoS Scheduler Entries
    ---------------------
    IfIndex    SchedulerIndex SchedulerAlgo Shape Index Scheduler HLGlobalId
    ---------- --------------- -------------------- ----------- ------------ 
    Gi0/2      2 weightedRoundRobin   0           0            29
    Gi0/4      1 strictPriority       0           0            4
    Gi0/5      1 strictPriority       0           0            5
    Gi0/6      1 strictPriority       0           0            6

    We can see that the Scheduler 2 on port Gi 0/3 is not shown any more.

  5. To remove an algorithm, configure it to the default Scheduler 1.

    Type the following:

    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • use the no-form of the scheduler command.
    iS5comm(config)# scheduler 1 interface gigabitethernet 0/3
    • Exit Global Configuration Mode.
    iS5comm(config)# exit
    • View the reversal of configuration.
    iS5comm(config)# show scheduler
    QoS Scheduler Entries
    ---------------------
    IfIndex    SchedulerIndex SchedulerAlgo Shape Index Scheduler HLGlobalId
    ---------- --------------- -------------------- ----------- ------------ 
    Gi0/2      2 weightedRoundRobin   0           0            29
    Gi0/3      1 strictPriority       0           0            3
    Gi0/4      1 strictPriority       0           0            4
    Gi0/5      1 strictPriority       0           0            5
    Gi0/6      1 strictPriority       0           0            6

    We can see that the default Scheduler 1 is now shown on port Gi 0/3.