Related Documentation
- ACX, M, MX, PTX, QFX, SRX, T Series
- Understanding Source Class Usage and Destination Class Usage Options
- Route Filter Match Conditions
Example: Grouping Source and Destination Prefixes into a Forwarding Class
This example shows how to group source and destination prefixes into a forwarding class.
Requirements
No special configuration beyond device initialization is required before configuring this example.
Overview
This example uses three routing devices: a customer edge (CE) device, a provider edge (PE) device, and a provider core (P) device.
Figure 1 shows the sample network.
Figure 1: SCU and DCU Sample Network

Source class usage (SCU) counts packets sent to the customer edge by performing lookup on the IP source address and the IP destination address. SCU makes it possible to track traffic originating from specific prefixes on the provider core and destined for specific prefixes on the customer edge.
DCU counts packets from customers by performing a lookup of the IP destination address. DCU makes it possible to track traffic originating from the customer edge and destined for specific prefixes on the provider core router.
On Device PE’s fe-1/2/1 interface, facing the provider core (represented by Device P), SCU input is configured with the source-class-usage input statement to track traffic originating at Device P and destined to Device CE. On this same interface, the destination-class-usage input statement is configured to track traffic originating at Device CE destined to the provider core.
Unlike destination class usage (DCU), which only requires implementation on a single interface, accounting for SCU must be enabled on two interfaces: the inbound and outbound interfaces traversed by the source class. You must define explicitly the two interfaces on which SCU monitored traffic is expected to arrive and depart. This is because SCU performs two lookups in the routing table: a source address (SA) and a destination address (DA) lookup. In contrast, DCU only has a single destination address lookup.
On Device PE’s fe-1/2/0 interface, facing Device CE, SCU output is configured with the source-class-usage output statement.
To account for traffic destined to the customer, the policy called scu_class uses route filters to place traffic into the gold1, gold2, and gold3 classes.
To account for traffic destined to the provider, the policy called dcu_class uses route filters to place traffic into the silver1, silver2, and silver3 classes.
The policies are then applied to the forwarding table.
The example uses static routes to provide connectivity and loopback interface addresses for testing the operation.
CLI Quick Configuration shows the configuration for all of the devices in Figure 1.
The section Step-by-Step Procedure describes the steps on Device PE.
Configuration
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.
Device CE
Device PE
Device P
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the CLI User Guide.
To group source and destination prefixes in a forwarding class:
Create the router interfaces.
[edit interfaces]user@PE# set fe-1/2/0 unit 0 family inet accounting source-class-usage outputuser@PE# set fe-1/2/0 unit 0 family inet address 10.0.0.2/30
user@PE# set fe-1/2/1 unit 0 family inet accounting source-class-usage inputuser@PE# set fe-1/2/1 unit 0 family inet accounting destination-class-usageuser@PE# set fe-1/2/1 unit 0 family inet address 10.1.0.1/30
user@PE# set lo0 unit 0 family inet address 192.168.0.2/32Configure BGP.
[edit protocols bgp group ext]user@PE# set type externaluser@PE# set export send-directuser@PE# set neighbor 10.0.0.1 peer-as 100user@PE# set neighbor 10.1.0.2 peer-as 300Configure the DCU policy.
[edit policy-options policy-statement dcu_class]user@PE# set term silver1 from route-filter 5.0.0.0/24 orlongeruser@PE# set term silver1 then destination-class silver1
user@PE# set term silver2 from route-filter 6.0.0.0/24 orlongeruser@PE# set term silver2 then destination-class silver2
user@PE# set term silver3 from route-filter 7.0.0.0/24 orlongeruser@PE# set term silver3 then destination-class silver3Configure the SCU policy.
[edit policy-options policy-statement scu_class]user@PE# set term gold1 from route-filter 2.0.0.0/24 orlongeruser@PE# set term gold1 then source-class gold1
user@PE# set term gold2 from route-filter 3.0.0.0/24 orlongeruser@PE# set term gold2 then source-class gold2
user@PE# set term gold3 from route-filter 4.0.0.0/24 orlongeruser@PE# set term gold3 then source-class gold3Apply the policies to the forwarding table.
[edit routing-options forwarding-table]user@PE# set export dcu_classuser@PE# set export scu_classNote: You can refer to the same routing policy one or more times in the same or different export statement.
- (Optional) Configure a routing policy that advertises
direct routes.[edit policy-options policy-statement send-direct term 1]user@PE# set from protocol directuser@PE# set then accept
- Configure the autonomous system (AS) number.[edit routing-options]user@PE# set autonomous-system 200
Results
From configuration mode, confirm your configuration by issuing the show interfaces, show protocols, show policy-options, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Making Sure That the DCU Policy Is Working
Purpose
Verify that traffic sent from the provider core into the customer network is causing the DCU policy counters to increment.
Action
- From Device P, ping an address in the customer network.
user@P> ping rapid count 10000000 6.0.0.1
PING 6.0.0.1 (6.0.0.1): 56 data bytes !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!...
- On Device PE, check the interface statistics on the interface
facing the provider core.
user@PE> show interfaces statistics fe-1/2/1.0
Logical interface fe-1/2/1.0 (Index 108) (SNMP ifIndex 546) Flags: SNMP-Traps 0x4000 Encapsulation: ENET2 Input packets : 251956 Output packets: 251961 Protocol inet, MTU: 1500 Flags: Sendbcast-pkt-to-re, DCU, SCU-in Packets Bytes Destination class (packet-per-second) (bits-per-second) silver1 7460 626640 ( 0) ( 0) silver2 22440 2401416 ( 256) ( 171963) silver3 9004 756336 ( 0) ( 0) Addresses, Flags: Is-Preferred Is-Primary Destination: 10.1.0.0/30, Local: 10.1.0.1, Broadcast: 10.1.0.3
Meaning
Packet and bit rates are displayed with packet and byte counters.
Alternatively, you can use the show interfaces destination-class all command to display the same information.
Making Sure That the SCU Policy Is Working
Purpose
Verify that traffic sent from the customer network into the provider core is causing the SCU policy counters to increment.
Action
- From Device CE, ping an address in the customer network.
user@CE> ping rapid count 10000000 2.0.0.1
PING 6.0.0.1 (6.0.0.1): 56 data bytes !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!...
- On Device PE, check the interface statistics on the interface
facing the customer network.
user@PE> show interfaces statistics fe-1/2/0.0
Logical interface fe-1/2/0.0 (Index 93) (SNMP ifIndex 554) Flags: SNMP-Traps 0x4000 Encapsulation: ENET2 Input packets : 32246 Output packets: 32245 Protocol inet, MTU: 1500 Flags: Sendbcast-pkt-to-re, Is-Primary, SCU-out Packets Bytes Source class (packet-per-second) (bits-per-second) gold1 8871 745164 ( 259) ( 174497) gold2 1812 152208 ( 0) ( 0) gold3 5711 479724 ( 0) ( 0) Addresses, Flags: Is-Preferred Is-Primary Destination: 10.0.0.0/30, Local: 10.0.0.2, Broadcast: 10.0.0.3
Meaning
Packet and bit rates are displayed with packet and byte counters.
Alternatively, you can use the show interfaces source-class all command to display the same information.
Related Documentation
- ACX, M, MX, PTX, QFX, SRX, T Series
- Understanding Source Class Usage and Destination Class Usage Options
- Route Filter Match Conditions
Published: 2013-09-17
Related Documentation
- ACX, M, MX, PTX, QFX, SRX, T Series
- Understanding Source Class Usage and Destination Class Usage Options
- Route Filter Match Conditions