[j-nsp] COS - IP Precedence rewrite

From: Stefano Bosio (s.bosio@lutech.it)
Date: Fri Aug 10 2001 - 03:58:06 EDT


Hi,

i can set the output queue based on input interface, TOS field or
destination as in sample below (with many refuse and omissions).

but i can set the output queue or rewrite TOS based on source address or
source destination address only with firewall filter, as in example:

firewall {
    filter test-cos {
        policer source-cos-pol {
            if-exceeding {
                bandwidth-limit 512k;
                burst-size-limit 1m;
            }
            then {
                plp 1;
                output-queue 0;
            }
        }
        term source-cos {
            from {
                source-address {
                    192.168.1.1/32;
                }
                destination-address {
                    172.20.0.0/24;
                }
            }
            then {
                policer source-cos-pol;
                plp 0;
                output-queue 2;
            }
        }
    }
}

and use the TOS-Rewrite feature to set IP Precedence bits

is this a right solution?? is there an alternative solution?? If yes,
which??

I try with some policy-option statement but no success because you can
define a statement that match source address (not layer 4 or destination
address/port) but you can't map it with a class-of-service 'something'
statement.

many thanks

stefano

---------

routing-options {
    static {
        route 0.0.0.0/0 next-hop [ 192.168.250.86 192.168.250.90 ];
        route 10.12.0.0/16 next-hop 192.168.250.86;
    }
    forwarding-table {
        export [ balance cos-over ];
    }
}
policy-options {
    policy-statement balance {
        then {
            load-balance per-packet;
        }
    }
    policy-statement cos-over {
        term 1 {
            from {
                route-filter 10.12.0.0/16 exact class test-pol;
            }
            then class test-pol;
        }
    }
    policy-statement change-IP-Prec {
        term 1 {
            from {
                source-address-filter 192.168.1.0/24 orlonger;
            }
        }
    }
}
class-of-service

    input {
        precedence-map costest {
            bits 100 output-queue 1;
        }
        fpc 1 {
            precedence-map costest;
        }
        interfaces {
            so-0/0/0 {
                unit 0 {
                    output-queue 3;
                }
            }
            fe-1/1/2 {
                inet-precedence-map;
            }
        }
    }
    output {
        interfaces {
            e1-0/3/1 {
                /* configurazione del WRR per la gestione della banda */
                weighted-round-robin {
                    output-queue 0 weight 50;
                    output-queue 1 weight 15;
                    output-queue 2 weight 15;
                    output-queue 3 weight 20;
                }
                /* Conf riscrittura campo TOS */
                unit 0 {
                    precedence-rewrite {
                        output-queue 0 {
                            plp-clear rewrite-bits 111;
                            plp-set rewrite-bits 101;
                        }
                        output-queue 1 {
                            plp-set rewrite-bits 100;
                        }
                        output-queue 2 {
                            plp-clear rewrite-bits 000;
                        }
                    }
                }
            }
        }
    }
    cos-next-hop-map costest {
        output-queue 2 {
            next-hop 10.10.1.1;
        }
    }
    policy {
        class test-pol {
            classification-override {
                output-queue 2;
            }
        }
    }
}



This archive was generated by hypermail 2b29 : Mon Aug 05 2002 - 10:42:36 EDT