Description

This article provides a sample CoS configuration to remove the code point for a specific host (user) on EX-series switches.

Symptoms

  • In the following setup, HOST_A is generating traffic with the code point of EF to remove the code point for a particular host. The new TEST forwarding-class has been created.
  • On the ge-0/0/0 interface, a firewall filter is used to place all the traffic that is coming from HOST_A to the TEST forwarding class.
  • On the ge-0/0/1 interface of the switch, a rewrite rule is applied for the TEST  forwarding class to remove the EF marking.
  • In the following setup, the EF code-point was removed, which was being received from HOST_A .

Topology :
HOST_A ------- ge-0/0/0 [EX4200] ge-0/0/1 ------HOST_B
10.0.0.1/24                                     10.0.0.2/24
  • Host_A is sending the traffic with the EF code point.
  • On the ge-0/0/0 interface, the firewall filter is applied to place the traffic in the TEST  forwarding-class.
  • On the ge-0/0/1 interface, the rewrite rule is being applied to remove the code point.

Solution


Configuration :
user@switch# show class-of-service | no-more
classifiers {
    dscp juniper_dscp_classifier {
        forwarding-class best-effort {
            loss-priority low code-points [ 000000 000001 000010 000011 000100
            000101 000110 000111 001000 001001 001010 001011 001100 001101 
            001110 001111 010000 010001 010010 010011 010100 010101 010110 
            010111 011000 011001 011010 011011 011100 011101 011110 011111 
            100000 100001 100010 100011 100100 100101 100110 100111 101000 
            101001 101010 101011 101100 101101 101111 ];
        }
        forwarding-class voice {
            loss-priority low code-points 101110;
        }
    }
    ieee-802.1 juniper_ieee_classifier {
        forwarding-class best-effort {
            loss-priority low code-points [ 000 001 010 011 100 ];
        }
        forwarding-class voice {
            loss-priority low code-points 101;
        }
    }
}
forwarding-classes {
    class voice queue-num 7;
    class expedited-forwarding queue-num 5;
    class assured-forwarding queue-num 1;
    class best-effort queue-num 0;
    class TEST queue-num 4; }
interfaces {
    ge-0/0/0 {
        scheduler-map juniper-port-profile-map;
        unit 0 {
            classifiers {
                dscp juniper_dscp_classifier;
                ieee-802.1 juniper_ieee_classifier;
            }
        }
    }
    ge-0/0/1 {
        scheduler-map juniper-port-profile-map;
        unit 0 {
            classifiers {
                dscp juniper_dscp_classifier;
                ieee-802.1 juniper_ieee_classifier;
            }
            rewrite-rules {                 dscp removeall;                 ieee-802.1 remallall;             }
        }
    }
}
rewrite-rules {
    dscp removeall {
        import default;
        forwarding-class TEST {             loss-priority low code-point 000000;
        }
        inactive: forwarding-class best-effort {
            loss-priority low code-point 000000;
        }
    }
    ieee-802.1 remallall {
        import default;
        forwarding-class TEST {             loss-priority low code-point 000;
        }
        inactive: forwarding-class best-effort {
            loss-priority low code-point 000;
        }
    }
}
scheduler-maps {
    juniper-port-profile-map {
        forwarding-class voice scheduler strict-priority-scheduler;
        forwarding-class expedited-forwarding scheduler expedited-scheduler;
        forwarding-class assured-forwarding scheduler assured-scheduler;
        forwarding-class best-effort scheduler best-effort-scheduler;
        forwarding-class TEST scheduler TEST_SCH;
    }
}
schedulers {
    strict-priority-scheduler {
        buffer-size percent 5;
        priority strict-high;
    }
    expedited-scheduler {
        transmit-rate percent 25;
        buffer-size percent 30;
        priority low;
    }
    assured-scheduler {
        transmit-rate percent 25;
        buffer-size percent 25;
        priority low;
    }
    best-effort-scheduler {
        transmit-rate percent 35;
        buffer-size percent 40;
        priority low;
    }
    TEST_SCH {         transmit-rate remainder;         buffer-size remainder;         priority low;
    }
}


user@switch# show firewall
family ethernet-switching {
    filter alltraffic {
        term 1 {
            then {
                accept;
                forwarding-class TEST;
                loss-priority low;
                count TRACK_TEST;
            }
        }
    }
}

The following command is used to verfiy if the configuration is working:
user@switch# run show interfaces filters
Interface       Admin Link Proto Input Filter         Output Filter
ge-0/0/0        up    up ge-0/0/0.0      up    up   eth-switch alltraffic  [edit]
user@switch# run show firewall

Filter: alltraffic Counters:
Name                                                Bytes              Packets
TRACK_TEST                                              0                    0  [edit]
user@switch# run show firewall

Filter: alltraffic Counters:
Name                                                Bytes              Packets
TRACK_TEST                                      139361874                95217  [edit]
user@switch# run show interfaces queue ge-0/0/1
Physical interface: ge-0/0/1, Enabled, Physical link is Up
  Interface index: 133, SNMP ifIndex: 503
Forwarding classes: 16 supported, 5 in use
Egress queues: 8 supported, 5 in use
Queue: 0, Forwarding classes: best-effort
  Queued:
  Transmitted:
    Packets              :                     0
    Bytes                :                     0
    Tail-dropped packets :                     0
Queue: 1, Forwarding classes: assured-forwarding
  Queued:
  Transmitted:
    Packets              :                     0
    Bytes                :                     0
    Tail-dropped packets :                     0
Queue: 4, Forwarding classes: TEST   Queued:
  Transmitted:
Packets  :94424 Bytes :138202400 Tail-dropped packets :  0
Queue: 5, Forwarding classes: expedited-forwarding
  Queued:
  Transmitted:
    Packets              :                     0
    Bytes                :                     0
    Tail-dropped packets :                     0
Queue: 7, Forwarding classes: voice
  Queued:
  Transmitted:
    Packets              :                     9
    Bytes                :                   612
    Tail-dropped packets :                     0
The following packet capture was performed on HOST_B . It was observed that the marking has been stripped from the packets that were generated from HOST_A :

alt