An ethernet physical port can only run at certain speeds. i.e. 10/100/1Gb/etc – Often customer will purchase a sublevel of bandwidth on that bearer speed. For example Customer A wants to buy 30Mb of bandwidth. You can’t run the physicla ports at 30Mb, so the ISP will have the interface run at 100Mb and police inbound at 30Mb.

This makes QoS jus a little more complicated. All the ratios we’ve used in the past will ratio themselves at the WAN port’s physical speed. Also the router will not know that if 40Mb of burst comes from the LAN, that the actual bandwidth is only 30Mb.

qos

In this case, you need to first shape all traffic to 30Mb, and then inside that shaped queue give priory bandwidth to voice etc..

IOS

IOS uses the concept of parent/child policy maps. The parent will shape the queue, while the child policy attached will give each queue their respective bandwidths and priority.

policy-map PARENT
 class class-default
  shape average 30000000
   service-policy CHILD
!
policy-map CHILD
 class EF
  priority percent 10
  police cir percent 10 conform-action transmit  exceed-action drop
 class class-default
  bandwidth remaining percent 100
!
interface FastEthernet0/0
 ip address 10.0.0.1 255.255.255.0
 service-policy output PARENT

In this policy the parent policy creates a queue with a bandwidth limit of 30Mb. Inside that policy rests another that gives EF packets 10 percent of priority bandwidth of that initial 30Mb queue. I’m also policing that queue as I don’t want the priority queue to starve other traffic. All other traffic gets 90-100% of the bandwidth, depending on how much priority traffic is in the queue at any one time.

Junos

As with most QoS topics, the following configuration is quite hardware specific. I’ve done the following on an SRX210H. Your configuration might change when doing the same sort of thing on a M/MX/DC SRX/etc so YMMV.

Create the schedulers:

darreno@JR2> show configuration class-of-service schedulers
EF10 {
    transmit-rate {
        percent 10;
        exact;
    }
}
BE_REST {
    transmit-rate {
        remainder {
            100;
        }
    }
}

Put the above schedulers into a schedule-map:

darreno@JR2> show configuration class-of-service scheduler-maps
SCHEDULE {
    forwarding-class expedited-forwarding scheduler EF10;
    forwarding-class best-effort scheduler BE_REST;
}

Finally apply that map to the interface under class-of-service and configure the interface shape rate:

darreno@JR2> show configuration class-of-service interfaces ge-0/0/1
unit 2001 {
    scheduler-map SCHEDULE;
    shaping-rate 30m;
}

In order for the above to work I need to configure per-unit-scheduler on the physical interface:

darreno@JR2> show configuration interfaces ge-0/0/1
per-unit-scheduler;

Verification

Simple again in IOS:

R1#sh policy-map int fa0/0
 FastEthernet0/0

  Service-policy output: PARENT

    Class-map: class-default (match-any)
      106 packets, 6360 bytes
      5 minute offered rate 0000 bps, drop rate 0000 bps
      Match: any
      Queueing
      queue limit 64 packets
      (queue depth/total drops/no-buffer drops) 0/0/0
      (pkts output/bytes output) 106/6360
      shape (average) cir 30000000, bc 120000, be 120000
      target shape rate 30000000

      Service-policy : CHILD

        queue stats for all priority classes:
          Queueing
          queue limit 64 packets
          (queue depth/total drops/no-buffer drops) 0/0/0
          (pkts output/bytes output) 0/0

        Class-map: EF (match-all)
          0 packets, 0 bytes
          5 minute offered rate 0000 bps, drop rate 0000 bps
          Match:  dscp ef (46)
          Priority: 10% (3000 kbps), burst bytes 75000, b/w exceed drops: 0

          police:
              cir 10 %
              cir 3000000 bps, bc 93750 bytes
            conformed 0 packets, 0 bytes; actions:
              transmit
            exceeded 0 packets, 0 bytes; actions:
              drop
            conformed 0000 bps, exceeded 0000 bps

        Class-map: class-default (match-any)
          106 packets, 6360 bytes
          5 minute offered rate 0000 bps, drop rate 0000 bps
          Match: any
          Queueing
          queue limit 64 packets
          (queue depth/total drops/no-buffer drops) 0/0/0
          (pkts output/bytes output) 106/6360
          bandwidth remaining 100%

We can see the entire queue is 30Mb. Inside that queue EF traffic has priority bandwidth of 3000kbps (10% of 30Mb) – All other traffic has anything left up to 30Mb

On Junos its a bit cryptic again:

darreno@JR2> show class-of-service interface ge-0/0/1
Physical interface: ge-0/0/1, Index: 135
Queues supported: 8, Queues in use: 4
  Scheduler map: , Index: 2
  Congestion-notification: Disabled

  Logical interface: ge-0/0/1.2001, Index: 71
    Shaping rate: 30000000
    Object                  Name                   Type                    Index
    Scheduler-map           SCHEDULE               Output                   2878

I wanted to do a more in-depth post on H-QoS but this SRX doesn’t support it. I don’t currently have an MX in the lab (only in the field) so hopefully soon…