Junos OS

last person joined: 7 days ago 

Ask questions and share experiences about Junos OS.
Expand all | Collapse all

CoS confusion

  • 1.  CoS confusion

    Posted 08-16-2011 13:50

    Can someone, please, verify my thinking?

    class-of-service classifiers exp BA_CORE_EXP_CLASSIFIER forwarding-class NC loss-priority low code-points 111

    - Set (match?) ingress MPLS exp NETWORK CONTROL packets with a loss-priority of low and set (match?) the code-point to 111.

    class-of-service forwarding-classes class NC queue 7 priority high

    - MPLS exp NETWORK CONTROL packets with a loss-priority of low and code-point of 111 should be sent to (egress) high-priority fabric queue 7.

    class-of-service schedulers HIGH_5PC_5PC_SCHEDULER transmit-rate percent 5
    class-of-service schedulers HIGH_5PC_5PC_SCHEDULER buffer-size percent 5
    class-of-service schedulers HIGH_5PC_5PC_SCHEDULER priority high

    - Set the schedule's transmit-rate to 5% (5% of the transmission capacity), the buffer-size to 5% (5% of the total buffer), and the priority of the scheduler to high.

    class-of-service scheduler-maps CORE_UPLINK_SCHED_MAP class NC scheduler HIGH_5PC_5PC_SCHEDULER

    - Egress MPLS exp NETWORK CONTROL packets in high-priority fabric queue 7 will be scheduled using the HIGH_5PC_5PC_SCHEDULER scheduler.

    class-of-service rewrite-rules exp CORE_EXP_REWRITE forwarding-class NC loss-priority low code-point 111

    - Egress MPLS exp NETWORK CONTROL packets with a low loss-priority and a code-point of 111 will be rewritten with a low loss-priority and a code-point of 111 (no change).

    interfaces ge-0/0/0.0 scheduler-map CORE_UPLINK_SCHED_MAP
    interfaces ge-0/0/0.0 classifiers exp BA_CORE_EXP_CLASSIFIER
    interfaces ge-0/0/0.0 rewrite-rules exp CORE_EXP_REWRITE

    - Assign (egress) scheduler-map, (ingress) classifiers, and (egress) rewrite-rules to the interface.



  • 2.  RE: CoS confusion
    Best Answer

    Posted 08-16-2011 23:16

    Looks like you got it right, the only thing to mention is that if you use BA for classification and you don't use Multifield-Classifiers, then you don't need to apply rewrite rules, as CoS values will be preserved.



  • 3.  RE: CoS confusion

    Posted 08-17-2011 02:40

    When class-of-services classifiers are configured, are they setting the loss-priority and code-point or are the matching them?



  • 4.  RE: CoS confusion

    Posted 08-17-2011 02:42

    They only match those values,.



  • 5.  RE: CoS confusion

    Posted 08-17-2011 04:29

    > When class-of-services classifiers are configured, are they setting the loss-priority and code-point or are the matching them?

     

    They are actually setting the loss-priority bit. There is no loss-priority bit in MPLS packets, so it is up to the classifier to assign one on the basis of the EXP marking.

     

    Please check this:

     

    http://www.juniper.fr/techpubs/software/junos/junos91/swconfig-cos/setting-the-plp-with-a-ba-classifier.html

     

    So if you write a statement like this:

     

    set class-of-service classifiers exp BA_CORE_EXP_CLASSIFIER forwarding-class NC loss-priority low code-points 111

     

    you are actually requesting all MPLS traffic which has been tagged with EXP-bits 111 to be assigned the forwarding class NC, and a loss priority of low.

     

    You would do this (set loss-priority to 'low') to make sure your network control traffic is never discarded.

     

    Also, there is a bit of confusion when it cames to these two statements:

     

    > class-of-service rewrite-rules exp CORE_EXP_REWRITE forwarding-class NC loss-priority low code-point 111
    > - Egress MPLS exp NETWORK CONTROL packets with a low loss-priority and a code-point of 111 will be rewritten with a low loss-priority and a code-point of 111 (no change).

     

    It is actually the other way around.

     

    You are requesting MPLS traffic which has been classified as belonging to the NC class with low loss-priority to be rewritten with EXP-bits 111 when leaving the router.

    Other traffic in the same NC class but with loss-priority of 'high' would not be affected by this rewrite rule.

     

    About the loss-priority flag, it is mostly used to have separate drop profiles, i.e. to prioritize traffic within the same queue.

     

    Hope it helps..

    Saverio

     

     

     

     



  • 6.  RE: CoS confusion

    Posted 08-17-2011 05:29

    >They are actually setting the loss-priority bit. There is no loss-priority bit in MPLS packets, so it is up to the classifier to assign one on the basis of the EXP marking.

     

    Classifiers are used to place the packet in the desired forwarding-class and  to treat it according to PLP. It does not change PLP bits even for DSCP packets. It's an internal assignment.

    In that example, the MPLS frames with EXP 111 are placed in NC forwarding-class with PLP low, but it does not alter the  EXP value, nor DSCP in case of IP packet. This is how I know it.

    The rewrite rule does the oposite of classification, based on forwarding-class and PLP it sets the CoS values(DSCP, EXP etc)



  • 7.  RE: CoS confusion

    Posted 08-17-2011 05:43

    > In that example, the MPLS frames with EXP 111 are placed in NC forwarding-class with PLP low, but it does not alter the  EXP value, nor DSCP in case of IP packet. This is how I know it.

     

    The PLP bit (i.e. loss priority) is an internal bit.

    It is not present in incoming MPLS traffic, so it cannot be used by EXP classifiers for classification.

     

    An EXP classifier may SET that bit, so that it can be used to select grop profile on the egress queue. 

    In other words, you can use a classifier to assign different loss-priority to different packets which you want to place in the same forwarding classes. 

     

    With regard to your answer:

     

    >> When class-of-services classifiers are configured, are they setting the loss-priority and code-point or are the matching them?

    >They only match those values,.

     

    What I would say is, classifiers do match on codepoints, and translate them in a forwarding class and a drop priority.

    In this, they are matching on codepoints, but setting a loss priority.

     

    Saverio



  • 8.  RE: CoS confusion

    Posted 08-17-2011 13:03

    At ingress, if the EXP-bits have already been set to 111, why rewrite them on egress?

     

    set class-of-service classifiers exp BA_CORE_EXP_CLASSIFIER forwarding-class NC loss-priority low code-points 111

    set class-of-service rewrite-rules exp CORE_EXP_REWRITE forwarding-class NC loss-priority low code-point 111

     

    Maybe a better example should have been:

     

    set class-of-service classifiers exp BA_CORE_EXP_CLASSIFIER forwarding-class NC loss-priority low code-points 010

    set class-of-service rewrite-rules exp CORE_EXP_REWRITE forwarding-class NC loss-priority low code-point 111



  • 9.  RE: CoS confusion

    Posted 08-17-2011 18:52

    > At ingress, if the EXP-bits have already been set to 111, why rewrite them on egress?

     

    Well, it is very common - and there can be several reasons for this.

    The most obvious one is, you need to consider traffic which does not enter the router as MPLS, but leave it as such.

     

    If that traffic is somehow classified as NC with loss-priority low, you still need to mark it as EXP=111 as it leaves the router as MPLS, to make sure that the next router down the path 'protects' it as well.

    This situation happens ofter with VPNs, as traffic enters the router as plain IP/IPv6 (in case of L3VPN) or pure L2 frames (in case of VPLS etc) - so MPLS needs always to be rewritten on the core-facing interface to reflect the classification on the CE-PE link.

     

    Hope it helps..

      Saverio

     

     

     

     



  • 10.  RE: CoS confusion

    Posted 08-19-2011 00:59

    Yes, this help a lot.  Two more questions, though.

     

    If the classifier is matching on EXP bits with code point 111, doesn't this imply a MPLS packet in ingressing the interface?  If so, then why rewrite the EXP bits with the same code point of 111?

     

    jslaven



  • 11.  RE: CoS confusion

    Posted 08-19-2011 01:03
      |   view attached

    If this is a P router and you don't do multifield classification than you don't need this(rewrite rulle), as the values received on ingress will be preserved.

    If you do some sort of MF classification, or you connect to other QoS domain with different QoS mappings than you can/should use it, but it's usually done on Edge or PE routers. 

    BTW, you DON'T need to apply rewrite rules in case of PE routers that does DSCP to EXP conversion because on Juniper routers there's a default rewrite rule applied for MPLS enabled interfaces(see attach). If you do modify the default forwarding class configuration, then you should adjust or configure a new EXP rewrite rule.

    Try to keep the CoS configuration as simple as possible and enable only that features which you need, because the CoS issues are a hell to troubleshoot in a big network. 

     

     

    Attachment(s)

    txt
    rewrite rule.txt   1 KB 1 version


  • 12.  RE: CoS confusion

    Posted 08-19-2011 05:08

     

    > BTW, you DON'T need to apply rewrite rules in case of PE routers that does DSCP to EXP conversion because on Juniper routers there's a default rewrite rule applied for MPLS enabled interfaces(see attach)

     

    Hi Dumitru,

     

    Unfortunately, in this case you do, as the default does not match the chosen EXP assignments for NC traffic with PLP low (EXP 110, rather than 111).

    If you leave the default, your next core router will not classify this traffic correctly.

     

    set class-of-service classifiers exp BA_CORE_EXP_CLASSIFIER forwarding-class NC loss-priority low code-points 111

    <--

     

    .. so you would run the risk of treating NC-traffic as best effort.

    As a rule, I would not rely that much on defaults, but specify explicitly every CoS operation I want.

     

    Saverio



  • 13.  RE: CoS confusion

    Posted 08-22-2011 12:46

    Yep, you're right. The default rewrite rule is meant to be used with the default mpls classification.

    Changing the classifier should be coordinated with the rewrite rule, especially for EXP on PE routers because of the push operation.