Class of Service JUNOS

From Teknologisk videncenter
Revision as of 07:33, 16 January 2015 by Rael (talk | contribs) (Remarking)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

JunOS arbejder med Forwarding Classes(FC) og Packet Low Priority(PLP).
Alle pakker har internt i kassen et mærkat hvor der står hvilken FC og PLP de hører til.

BA Klassificering

For at stole på den markere en pakke kommer ind med bruger man BA klassificering til at sætte FC og PLP mærkatet på pakken. Inden i kassen håndteres pakkerne nu efter markeringen.

Eksempel

[edit class-of-service]
root@SRX240# <input>show</input>
interfaces {
    ge-0/0/1 {
        unit 0 {
            classifiers {
                inet-precedence default;
            }
        }
    }
}
root@SRX07# run show class-of-service classifier type dscp
Classifier: dscp-default, Code point type: dscp, Index: 7
  Code point         Forwarding class                    Loss priority
  000000             best-effort                         low
  000001             best-effort                         low
  000010             best-effort                         low
  000011             best-effort                         low
  000100             best-effort                         low
  000101             best-effort                         low
  000110             best-effort                         low
  000111             best-effort                         low
  001000             best-effort                         low
  001001             best-effort                         low
  <notice>001010             assured-forwarding                  low</notice>
  001011             best-effort                         low
  <notice>001100             assured-forwarding                  high</notice>
  001101             best-effort                         low
  <notice>001110             assured-forwarding                  high</notice>
  001111             best-effort                         low
  010000             best-effort                         low
  010001             best-effort                         low
  010010             best-effort                         low
  010011             best-effort                         low
  010100             best-effort                         low
  010101             best-effort                         low
  010110             best-effort                         low
  010111             best-effort                         low
  011000             best-effort                         low
  011001             best-effort                         low
  011010             best-effort                         low
  011011             best-effort                         low
  011100             best-effort                         low
  011101             best-effort                         low
  011110             best-effort                         low
  011111             best-effort                         low
  100000             best-effort                         low
  100001             best-effort                         low
  100010             best-effort                         low
  100011             best-effort                         low
  100100             best-effort                         low
  100101             best-effort                         low
  100110             best-effort                         low
  100111             best-effort                         low
  101000             best-effort                         low
  101001             best-effort                         low
  101010             best-effort                         low
  101011             best-effort                         low
  101100             best-effort                         low
  101101             best-effort                         low
  <notice>101110             expedited-forwarding                low</notice>
  101111             best-effort                         low
  <notice>110000             network-control                     low</notice>
  110001             best-effort                         low
  110010             best-effort                         low
  110011             best-effort                         low
  110100             best-effort                         low
  110101             best-effort                         low
  110110             best-effort                         low
  110111             best-effort                         low
  <notice>111000             network-control                     low</notice>
  111001             best-effort                         low
  111010             best-effort                         low
  111011             best-effort                         low
  111100             best-effort                         low
  111101             best-effort                         low
  111110             best-effort                         low
  111111             best-effort                         low

 [edit]

Custom BA Classifier

Her laves en ny classifyer der gør det samme som default for EF(101110) markeret trafik, smider den i expedited-forwarding FC og sætter PLP til low.

[edit class-of-service]
root@SRX07# <input>show</input>
classifiers {
    dscp MYCLASSIFYER {
        import default;
        <notice>forwarding-class expedited-forwarding {
            loss-priority low code-points 101110;
        }</notice>
    }
}

Multifield Classifier

Med en MC stoler vi ikke på trafikken men bruger et firewall filter til at matche trafik og smide det i en FC og PLP.

[edit]
root@SRX07# <input>show firewall filter VLAN10-COS</input>
term PORT-80 {
    from {
        protocol tcp;
        destination-port 80;
    }
    then {
        count EF;
        <notice>loss-priority low;
        forwarding-class assured-forwarding;</notice>
        accept;
    }
}
term ALLOW-OTHER {
    then accept;
}

root@SRX07# show interfaces vlan.10 family inet filter
input VLAN10-COS;

Remarking

Inden pakken sende ud af kassen bør den markere ud fra sin FC og PLP så de næste enheder ikke skal lave en Multifield Classifier, men bare skal læse DSCP feltet.

[edit]
root@SRX07# show class-of-service
interfaces {
    ge-0/0/0 {
        unit 10 {
            rewrite-rules {
                dscp default;
            }
        }
    }
}

Custom rewrite rules

Med denne regl om markeres alt trafik fra expedited-forwarding classen og PLP på low til DSCP 101100.
Reglen skal selvfølgelig aktiveres på egress interface som i eksemplet ovenfor.

[edit class-of-service]
root@SRX07# <input>show</input>
rewrite-rules {
    dscp MY-REWRITE {
        import default;
        forwarding-class expedited-forwarding {
            loss-priority low code-point 101100;
        }
    }
}

Links