Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Example: Configuring and Verifying Two-Rate Tricolor Marking

date_range 19-Feb-21

This topic provides several examples of how you can configure and verify two-rate tricolor marking policers and includes the following sections:

Requirements

No special configuration beyond device initialization is required before configuring this example.

Overview

This example configures a two-rate tricolor marking policer on an input Gigabit Ethernet interface and shows commands to verify its operation.

Traffic enters the Gigabit Ethernet interface and exits a SONET/SDH OC12 interface. Oversubscription occurs when you send line-rate traffic from the Gigabit Ethernet interface out the OC12 interface.

Topology

Figure 1 shows the sample topology.

Figure 1: Tricolor Marking Sample TopologyTricolor Marking Sample Topology

Configuration

To configure two-rate tricolor marking policers, perform these tasks:

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Applying a Policer to an Input Interface

content_copy zoom_out_map
set interfaces ge-1/2/1 unit 0 family inet filter input trtcm-filter
set firewall three-color-policer trtcm1 two-rate color-aware 
set firewall three-color-policer trtcm1 two-rate committed-information-rate 100m 
set firewall three-color-policer trtcm1 two-rate committed-burst-size 65536 
set firewall three-color-policer trtcm1 two-rate peak-information-rate 200m 
set firewall three-color-policer trtcm1 two-rate peak-burst-size 131072
set firewall filter trtcm-filter term one then three-color-policer two-rate trtcm1

Applying Profiles to an Output Interface

content_copy zoom_out_map
set class-of-service drop-profiles low-tcm fill-level 80 drop-probability 100 
set class-of-service drop-profiles med-tcm fill-level 40 drop-probability 100 
set class-of-service drop-profiles high-tcm fill-level 10 drop-probability 100 
set class-of-service tri-color
set class-of-service interfaces so-1/1/0 scheduler-map tcm-sched
set class-of-service scheduler-maps tcm-sched forwarding-class queue-0 scheduler q0-sched 
set class-of-service scheduler-maps tcm-sched forwarding-class queue-3 scheduler q3-sched 
set class-of-service schedulers q0-sched transmit-rate percent 50 
set class-of-service schedulers q0-sched buffer-size percent 50 
set class-of-service schedulers q0-sched drop-profile-map loss-priority low protocol any drop-profile low-tcm 
set class-of-service schedulers q0-sched drop-profile-map loss-priority medium-high protocol any drop-profile med-tcm 
set class-of-service schedulers q0-sched drop-profile-map loss-priority high protocol any drop-profile high-tcm 
set class-of-service schedulers q3-sched transmit-rate percent 50 
set class-of-service schedulers q3-sched buffer-size percent 50

Marking Packets with Medium-Low Loss Priority

content_copy zoom_out_map
set interfaces ge-1/2/1 unit 0 family inet filter input 4PLP 
set interfaces ge-1/2/1 unit 0 family inet policer input 4PLP 
set interfaces ge-1/2/1 unit 0 family inet address 10.45.10.2/30 
set firewall three-color-policer trTCM two-rate color-blind 
set firewall three-color-policer trTCM two-rate committed-information-rate 400m 
set firewall three-color-policer trTCM two-rate committed-burst-size 100m 
set firewall three-color-policer trTCM two-rate peak-information-rate 1g 
set firewall three-color-policer trTCM two-rate peak-burst-size 500m 
set firewall policer 4PLP if-exceeding bandwidth-limit 40k 
set firewall policer 4PLP if-exceeding burst-size-limit 4k 
set firewall policer 4PLP then loss-priority medium-low 
set firewall family inet filter 4PLP term 0 from precedence 1 
set firewall family inet filter 4PLP term 0 then loss-priority medium-low 
set firewall family inet filter filter_trTCM term default then three-color-policer two-rate trTCM

Example: Applying a Policer to an Input Interface

Step-by-Step Procedure

In the following example, the tricolor marking and policer are applied on the ingress Gigabit Ethernet interface. Incoming packets are metered. Packets that do not exceed the CIR are marked with low loss priority. Packets that exceed the CIR, but do not exceed the PIR, are marked with medium-high loss priority. Packets that exceed the PIR are marked with high loss priority.

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

  1. Configure the three-color policer.

    content_copy zoom_out_map
    [edit]
    user@host# edit firewall three-color-policer trtcm1 two-rate
    user@host# set committed-information-rate 100m 
    user@host# set committed-burst-size 65536
    user@host# set peak-information-rate 200m 
    user@host# set peak-burst-size 131072
    
  2. Configure the policer in a firewall filter.

    content_copy zoom_out_map
    [edit]
    user@host# set firewall filter trtcm-filter term one then three-color-policer two-rate trtcm1
    
  3. Apply the firewall filter (policer) as an input filter on the logical interface.

    content_copy zoom_out_map
    [edit]
    user@host# edit interfaces ge-1/2/1 unit 0 family inet
    user@host# set filter input trtcm-filter
    
  4. Confirm the configuration.

    content_copy zoom_out_map
    [edit]
    user@host# show
    
    content_copy zoom_out_map
    interfaces {
    ge-1/2/1 {
        unit 0 {
            family inet {
                filter {
                    input trtcm-filter;
                }
            }
        }
    }
    firewall {
     three-color-policer trtcm1 {
            two-rate {
                color-aware;
                committed-information-rate 100m;
                committed-burst-size 65536;
                peak-information-rate 200m;
                peak-burst-size 131072;
            }
        }
    
     filter trtcm-filter {
            term one {
                then {
                    three-color-policer {
                        two-rate trtcm1;
                    }
                }
            }
        }
    }
    
  5. Save the configuration.

    content_copy zoom_out_map
    [edit]
    user@host# commit
    

Example: Applying Profiles to an Output Interface

Step-by-Step Procedure

In the following example, transmission scheduling and weighted random early detection (WRED) profiles are applied on the output OC12 interface. The software drops traffic in the low, medium-high, and high drop priorities proportionally to the configured drop profiles.

  1. Define the drop profile.

    content_copy zoom_out_map
    [edit]
    user@host# edit class-of-service
    user@host# set drop-profiles low-tcm fill-level 80 drop-probability 100 
    user@host# set drop-profiles med-tcm fill-level 40 drop-probability 100 
    user@host# set drop-profiles high-tcm fill-level 10 drop-probability 100 
    user@host# set tri-color
    
  2. Specify the scheduler name and parameter values.

    content_copy zoom_out_map
    [edit class-of-service]
    user@host# set schedulers q0-sched transmit-rate percent 50 
    user@host# set schedulers q0-sched buffer-size percent 50 
    user@host# set schedulers q0-sched drop-profile-map loss-priority low protocol any drop-profile low-tcm 
    user@host# set schedulers q0-sched drop-profile-map loss-priority medium-high protocol any drop-profile med-tcm 
    user@host# set schedulers q0-sched drop-profile-map loss-priority high protocol any drop-profile high-tcm 
    user@host# set schedulers q3-sched transmit-rate percent 50 
    user@host# set schedulers q3-sched buffer-size percent 50
    
  3. Specify a scheduler map name and associate it with the scheduler configuration and forwarding class.

    content_copy zoom_out_map
    [edit class-of-service]
    user@host# set scheduler-maps tcm-sched forwarding-class queue-0 scheduler q0-sched 
    user@host# set scheduler-maps tcm-sched forwarding-class queue-3 scheduler q3-sched 
    
  4. Apply the scheduler map to the interface.

    content_copy zoom_out_map
    [edit class-of-service]
    user@host# set interfaces so-1/1/0 scheduler-map tcm-sched
    
  5. Verify the configuration.

    content_copy zoom_out_map
    [edit class-of-service]
    user@host show
    
    drop-profiles {
        low-tcm {
            fill-level 80 drop-probability 100;
        }
        med-tcm {
            fill-level 40 drop-probability 100;
        }
        high-tcm {
            fill-level 10 drop-probability 100;
        }
    }
    tri-color;
    interfaces {
        so-1/1/0 {
            scheduler-map tcm-sched;
        }
    scheduler-maps {
        tcm-sched {
            forwarding-class queue-0 scheduler q0-sched;
            forwarding-class queue-3 scheduler q3-sched;
        }
    }
    schedulers {
        q0-sched {
            transmit-rate percent 50;
            buffer-size percent 50;
            drop-profile-map loss-priority low protocol any drop-profile low-tcm;
            drop-profile-map loss-priority medium-high protocol any drop-profile med-tcm;
            drop-profile-map loss-priority high protocol any drop-profile high-tcm;
        }
        q3-sched {
            transmit-rate percent 50;
            buffer-size percent 50;
        }
    }
    
  6. Save the configuration.

    content_copy zoom_out_map
    [edit]
    user@host# commit
    

Example: Marking Packets with Medium-Low Loss Priority

Step-by-Step Procedure

In the following example, the 4PLP filter and policer causes certain packets to be marked with medium-low loss priority.

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

  1. Configure the firewall filter.

    1. Define the three-color policer.

      content_copy zoom_out_map
      [edit]
      user@host# edit firewall three-color-policer trTCM two-rate
      user@host# set color-blind
      user@host# set committed-information-rate 400m
      user@host# set committed-burst-size 100m
      user@host# set peak-information-rate 1g
      user@host# set peak-burst-size 500m
      
    2. Configure policer rate limits and actions.

      content_copy zoom_out_map
      [edit]
      user@host# edit firewall policer 4PLP
      user@host# set if-exceeding bandwidth-limit 40k
      user@host# set if-exceeding burst-size-limit 4k
      user@host# set then loss-priority medium-low
      
    3. Configure the IPv4 firewall filter.

      content_copy zoom_out_map
      [edit]
      user@host# edit firewall family inet filter 4PLP term 0
      user@host# set from precedence 1
      user@host# set then loss-priority medium-low
      
    4. Define the terms of the IPv4 firewall filter.

      content_copy zoom_out_map
      [edit]
      user@host# edit firewall family inet filter filter_trTCM
      user@host# set term default then three-color-policer two-rate trTCM
      
  2. Apply the filter to the interface.

    content_copy zoom_out_map
    [edit]
    user@host# edit interfaces ge-1/2/1 unit 0 family inet
    user@host# set filter input 4PLP
    user@host# set policer input 4PLP
    user@host# set address 10.45.10.2/30
    

Results

Confirm your configuration by entering the show interfaces and show firewall commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

content_copy zoom_out_map
[edit]
user@host# show
content_copy zoom_out_map
interfaces {
 ge-1/2/1 {
        unit 0 {
            family inet {
                filter {
                    input 4PLP;
                }
                policer {
                    input 4PLP;
                }
                address 10.45.10.2/30;
            }
        }
    }
}
firewall {
  three-color-policer trTCM {
        two-rate {
            color-blind;
            committed-information-rate 400m;
            committed-burst-size 100m;
            peak-information-rate 1g;
            peak-burst-size 500m;
        }
    }
  policer 4PLP {
        if-exceeding {
            bandwidth-limit 40k;
            burst-size-limit 4k;
        }
        then loss-priority medium-low;
    }
  family inet {
    filter 4PLP {
            term 0 {
                from {
                    precedence 1;
                }
                then loss-priority medium-low;
            }
        }
    filter trtcm-filter {
        term one {
            then {
                three-color-policer {
                    two-rate trtcm1;
                }
            }
        }
    }
}

Verification

Confirm that the configuration is working properly.

Verifying Two-Rate Tricolor Marking Operation

Purpose

Action

The following operational mode commands are useful for checking the results of your configuration:

  • show class-of-service forwarding-table classifiers

  • show interfaces interface-name extensive

  • show interfaces queue interface-name

For information about these commands, see the CLI Explorer.

footer-navigation