Description

This article explains how to mark every transit traffic through the device with 802.1p COS.

Symptoms

Marking the traffic through 802.1p allows it to be treated as a background priority in the peer device.

Solution


Following is the configuration that needs to be done on the device:

ge-0/0/2 {
     per-unit-scheduler;
     vlan-tagging;
     unit 0 {
         vlan-id 10;
         family inet {
         address 190.168.103.1/30;
         }
     }
}

class-of-service {
     interfaces {
         ge-0/0/2 {
             unit 0 {
                 rewrite-rules {
                     ieee-802.1 class;
                 }
             }
        }
    }
    rewrite-rules {
        ieee-802.1 class {
            import default;
            forwarding-class network-control {                           <<<<< Include classes and priorities for which you want the traffic to be marked.
                loss-priority low code-point 001;
                loss-priority medium-low code-point 001;
                loss-priority medium-high code-point 001;
                loss-priority high code-point 001;
            }
            forwarding-class best-effort {                                  <<< If you want that traffic coming to BE class should be 802.1p marked only when its loss-priority is low and high then include only those two here.
                loss-priority low code-point 001;
                loss-priority high code-point 001;
            }
        }
    }
}



Following is the packet capture depicting the transit traffic to be 802.1p marked:

alt



NOTE: - Only transit traffic through the device can be 802.1p marked and not RE generated traffic. Refer Pg 294 of the following link:
http://www.juniper.net/techpubs/en_US/junos12.1/information-products/topic-collections/config-guide-cos/config-guide-cos.pdf