[j-nsp] Strangeness with CoS and scheduler rate-limiting

Per Westerlund p1 at westerlund.se
Sat Oct 13 14:59:10 EDT 2012


Hi,

I have a requirement to rate-limit some flows on a shared interface, and have succeeded in doing so. However, when I add what I think is unrelated stuff to CoS the rate-limiting stops working. I would like to know if this is a bug of (more probable) limitations in my understanding of schedulers.

This configuration (excerpt with manual name changes) works, two specific flows are egress limited to 50 Mbit/s on a 1 Gbit/s interface:

interfaces {
    reth0 {
        per-unit-scheduler;
        vlan-tagging;
        unit 3 {
            vlan-id 3;
            family inet {
                filter {
                    output cos-scheduler;
                }
                address 10.66.2.129/26;
            }
        }
    }
}
class-of-service {
    forwarding-classes {
        queue 4 temp1;
        queue 5 temp2;
    }
    interfaces {
        reth0 {
            unit 3 {
                scheduler-map reth0-3;
            }
        }
    }
    scheduler-maps {
        reth0-3 {
            forwarding-class temp1 scheduler cust1-50;
            forwarding-class temp2 scheduler cust2-50;
        }
    }
    schedulers {
        tmp-be {
            transmit-rate percent 25;
        }
        cust1-50 {
            transmit-rate {
                50m;
                exact;
            }
            priority low;
        }
        cust2-50 {
            transmit-rate {
                50m;
                exact;
            }
            priority low;
        }
    }
}
firewall {
    family inet {
        filter cos-scheduler {
            term tn-r510-cust1 {
                from {
                    source-address {
                        10.66.71.64/31;
                    }
                    destination-address {
                        10.66.2.134/31;
                    }
                }
                then {
                    forwarding-class temp1;
                    accept;
                }
            }
            term tn-r580-cust2 {
                from {
                    source-address {
                        172.17.0.0/16;
                        172.18.0.0/24;
                    }
                    destination-address {
                        10.66.2.134/31;
                    }
                }
                then {
                    forwarding-class temp2;
                    accept;
                }
            }
            term default {
                then accept;
            }
        }
    }
}


Note that the scheduler "tmp-be" is not used. My belief is that everything that is not explicitly mentioned in the scheduler-map is handled by the default configuration (in practice the rest of the flows hit the default best-effort forwarding-class).

Now for the strange stuff. If I make this change:

class-of-service {
    scheduler-maps {
        reth0-3 {
            forwarding-class best-effort scheduler tmp-be;    <<<<<--- Added
            forwarding-class temp1 scheduler cust1-50;
            forwarding-class temp2 scheduler cust2-50;
        }
    }
}

then the rate limiting of the forwarding classes temp1 and temp2 stop working! The flows stay in the forwarding-classes/queues they are assigned to, but they are no longer limited to 50 Mbit/s, they use up all the available bandwidth!!

Why is this happening? I thought "schedulers XXX transmit-rate YYY exact" would put a strict limit whatever happened.

/Per Westerlund


More information about the juniper-nsp mailing list