OcNOS-DC 6.4.2 : Multi-Protocol Label Switching Guide : Multi-Protocol Label Switching Configuration Guide : Policing Configuration
Policing Configuration
This chapter contains a complete sample of configuration of Policing for Pipe and Uniform models.This example shows configurations using LDP.
Configuration
Configuring Remarking for MPLS EXP bits require following configurations:
Enabling label-switching on the interface on NSM.
Configuring LSP (Using LDP, Static or RSVP-TE, in this example we are using LDP for setting UP LSP).
Running an IGP (Internal Gateway Protocol), for example, OSPF, to distribute reachability information within the MPLS cloud.
Enable QoS, Configuring Policing on interface Level.
Topology
Basic Policing Topology
R1
The following steps describe how to configure Policing.
Note: Basic configuration for Policing is the same as that of the configurations given in the Remarking chapter.
NSM
#configure terminal
Enter the configure mode
(config)#interface xe1
Specify the interface (xe1) to be configured
(config-if)#ip address 10.10.10.1/24
Configure IP address for the interface
(config-if)#label-switching
Enable label switching on interface xe1
(config-if)#exit
Exit the interface mode
(config)#interface lo
Specify the loopback (lo) interface to be configured
(config-if)#ip address 192.168.0.1/32 secondary
Set the IP address of the loopback interface to 192.168.0.1/32
(config-if)#commit
Commit the transaction
OSPF
#configure terminal
Enter the configure mode
(config)#router ospf 100
Configure the routing process and specify the Process ID (100). The Process ID should be a unique positive integer identifying the routing process
(config-router)#network 10.10.10.0/24 area 0
(config-router)#network 192.168.0.1/32 area 0
Configure IP address for the interface
(config-if)#label-switching
Define the interface on which OSPF runs and associate the area ID (0) with the interface
(config-router)#router
Commit the transaction
LDP
#configure terminal
Enter the configure mode
(config)#router ldp
Enter the router mode for LDP
(config-router)#router-id 192.168.0.1
Set the router ID to IP address 192.168.0.1
(config-router)#transport-address ipv4 192.168.0.1
Configure the transport address to be used for a TCP session where LDP will run on an IPv4 interface
(config-router)#exit
Exit the router mode
(config)#interface xe1
Enter the interface mode
(config-if)#enable-ldp ipv4
Enable LDP on xe1
(config-if)#commit
Commit the transaction
#configure terminal
Enter the configure mode
(config)#qos enable
Enable the QoS
(config)#hardware-profile filter qos enable
Enable the QoS hardware
(config)#commit
Commit the candidate configuration to the running configuration
(config)#class-map cmap1
Enter Class-map mode
(config-cmap-qos)#match dscp 2
Configure the match criteria as DSCP with value of 2
(config-cmap-qos)#exit
Exit the class map mode
(config)#policy-map pmap1
Enter the policy map mode
(config-pmap-qos)#class cmap1
Assign class cmap1 to policy map pmap1
(config-pmap-c-qos)#police cir 1 mbps conform set-mpls-class 6 violate drop
Police DSCP 2 packets @ committed information rate 1 mbps, and map DSCP 2 to class 6
(config-pmap-c-qos)#exit
Exit out of policy-class map mode
(config-pmap-qos)#exit
Exit out of policy map mode
(config)#interface xe1
Enter xe1 interface
(config-if)#service-policy type qos input pmap1
Assign service policy to interface on in direction
(config-if)#exit
Exit the interface mode
 
P
The following steps describe how to configure router P.
NSM
#configure terminal
Enter the configure mode
(config)#interface xe1
Specify the interface (xe1) to be configured
(config-if)#ip address 10.10.10.2/24
Configure the IP address for the interface
(config-if)#label-switching
Enable label switching on interface xe1
(config-if)#exit
Exit the interface mode
(config)#interface xe2
Specify the interface (xe2) to be configured
(config-if)#ip address 10.10.10.1/24
Configure the IP address for the interface
(config-if)#label-switching
Enable label switching on interface xe2
(config-if)#exit
Exit the interface mode
(config)#interface lo
Specify the loopback (lo) interface to be configured
(config-if)#ip address 192.168.0.2/32 secondary
Set the IP address of the loopback interface to 192.168.0.2/32
(config-if)#commit
Commit the transaction
OSPF
#configure terminal
Enter the configure mode
(config)#router ospf 100
Configure the routing process and specify the Process ID (100) The Process ID should be a unique positive integer identifying the routing process
(config-router)#network 10.10.10.0/24 area 0
(config-router)#network 10.10.11.0/24 area 0
(config-router)#network 192.168.0.2/32 area 0
Define the interface on which OSPF runs and associate the 0 area ID (0) with the interface
(config-router)#commit
Commit the transaction
LDP
#configure terminal
Enter the configure mode
(config)#router ldp
Enter the Router mode for LDP
(config-router)#router-id 192.168.0.2
Set the router ID to IP address 192.168.0.2
(config-router)#transport-address ipv4 192.168.0.2
Configure the transport address to be used for a TCP session where LDP will run on an IPv4 interface
(config-router)#exit
Exit the router mode
(config)#interface xe1
Enter the interface mode
(config-if)#enable-ldp ipv4
Enable LDP on xe1
(config-if)#exit
Exit the interface mode
(config)#interface xe2
Enter interface mode
(config-if)#enable-ldp ipv4
Enable the LDP on xe2
(config-if)#commit
Commit the transaction
PE2
The following steps describe how to configure router PE2.
NSM
#configure terminal
Enter the configure mode
(config)#interface xe2
Specify the interface (xe2) to be configured
(config-if)#ip address 10.10.10.2/24
Configure IP address for the interface
(config-if)#label-switching
Enable label switching on interface xe1
(config-if)#exit
Exit the interface mode
(config)#interface lo
Specify the loopback (lo) interface to be configured
(config-if)#ip address 192.168.0.3/32 secondary
Set the IP address of the loopback interface to 192.168.0.3/32
(config-if)#commit
Commit the transaction
OSPF
#configure terminal
Enter the configure mode
(config)#router ospf 100
Configure the routing process and specify the Process ID (100) The Process ID should be a unique positive integer identifying the routing process
(config-router)#network 10.10.10.0/24 area 0
(config-router)#network 192.168.0.3/32 area 0
Define the interface on which OSPF runs and associate the 0 area ID (0) with the interface
(config-router)#commit
Commit the transaction
LDP
#configure terminal
Enter the configure mode
(config)#router ldp
Enter router mode for LDP
(config-router)#router-id 192.168.0.3
Set the router ID to IP address 192.168.0.2
(config-router)#explicit-null
To disable PHP
(config-router)#transport-address ipv4 192.168.0.3
Configure the transport address to be used for a TCP session over which LDP will run on an IPv4 interface
(config-router)#exit
Exit the router mode
(config)#interface xe2
Enter the interface mode
(config-if)#enable-ldp ipv4
Enable the LDP on xe2
(config-if)#commit
Commit the transaction
#configure terminal
Enter configure mode
(config)#qos enable
Enable the QOS
(config)#hardware-profile filter qos enable
Enable the QOS hardware
(config)#commit
Commit candidate configuration to the running configuration
(config)#class-map cmap1
Enter class map mode
(config-cmap-qos)#match dscp 2
Configure the match criteria as DSCP with value of 2
(config-cmap-qos)#exit
Exit class map mode
(config)#policy-map pmap1
Enter policy map mode
(config-pmap-qos)#class cmap1
Assign Class cmap1 to policy map pmap1
(config-pmap-c-qos)#police cir 1 mbps mbps bc 1 kbytes be 1 kbytes
Police DSCP 2 packets @ Committed information rate 1 mbps, and map DSCP 2 to class 6
(config-pmap-c-qos)#exit
Exit out of policy class map mode
(config-pmap-qos)#exit
Exit out of policy map mode
(config)#interface xe1
Enter xe1 interface
(config-if)#service-policy type qos input pmap1
Assign service-policy to interface on in-direction
(config-if)#exit
Exit the interface mode
(config)#commit
Commit candidate configuration to the running configuration
#configure terminal
Enter the configure mode
(config)#qos enable
Enable the QoS
(config)#hardware-profile filter qos enable
Enable the QoS hardware
(config)#commit
Commit candidate configuration to the running configuration
(config)#class-map cmap1
Enter class map mode
(config-cmap-qos)#match dscp 2
Configure the match criteria as DSCP with value of 2
(config-cmap-qos)#exit
Exit the class map mode
(config)#commit
Commit candidate configuration to the running configuration
(config)#policy-map pmap1
Enter policy map mode
(config-pmap-qos)#class cmap1
Assign Class cmap1 to policy map pmap1
(config-pmap-c-qos)#police cir 1 mbps eir 1 mbps bc 1 kbytes be 1 kbytes
Police DSCP 2 packets @ Committed information rate 1 mbps
(config-pmap-c-qos)#exit
Exit out of policy-class-map mode
(config-pmap-qos)#exit
Exit out of Policy-map mode
(config)#commit
Commit candidate configuration to the running configuration
(config)#interface xe1
Enter xe1 interface
(config-if)#service-policy type qos input pmap1
Assign service-policy to interface on in direction
(config-if)#exit
Exit the interface mode
(config)#commit
Commit candidate configuration to the running configuration
Validation
R1#show class-map
 
Type qos class-maps
===================
class-map type qos match-any class-default
 
class-map cmap1
match dscp 2
 
 
Type queuing class-maps
=======================
class-map match-any q0
 
class-map match-any q1
 
class-map match-any q2
 
class-map match-any q3
 
class-map match-any q4
 
class-map match-any q5
 
class-map match-any q6
 
class-map match-any q7
 
 
Type Vlan-Queuing class-maps
============================
 
 
#show running-config qos
qos enable
!
qos statistics
!
class-map cmap1
match dscp 2
!
policy-map pmap1
class cmap1
police cir 1 mbps conform set-mpls-class 6 violate drop
exit
!
interface xe2
service-policy type qos input pmap1 exit
#
 
#show policy-map
 
Type qos policy-maps
====================
 
policy-map pmap1
class cmap1
police cir 1 mbps conform set-mpls-class 6 violate drop
exit
 
 
Type queuing policy-maps
========================
 
policy-map type queuing default default-out-policy
class type queuing default q0
priority level 1
exit
class type queuing default q1
priority level 1
exit
class type queuing default q2
priority level 1
exit
class type queuing default q3
priority level 1
exit
class type queuing default q4
priority level 1
exit
class type queuing default q5
priority level 1
exit
class type queuing default q6
priority level 1
exit
class type queuing default q7
priority level 1
exit
 
 
#show policy-map interface xe1
 
Interface xe1
Global statistics status : enabled
 
Service-policy (queuing) output: default-out-policy
-----------------------------------
Class-map (queuing): q0
priority level 1
output : 5 packets, 340 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q1
priority level 1
output : 25 packets, 2208 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q2
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q3
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q4
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q5
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q6
priority level 1
output : 46337 packets, 3150916 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): q7
priority level 1
output : 346 packets, 25193 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q0
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q2
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q3
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q4
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q5
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q6
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q7
output : 808 packets, 67946 bytes
dropped : 0 packets, 0 bytes
 
Wred Drop Statistics :
----------------------
green : 0 packets
yellow : 0 packets
red : 0 packets
 
PE2
OcNOS#show class-map
Type qos class-maps
===================
class-map type qos match-any class-default
class-map type qos match-all cmap1
match dscp 2
Type queuing class-maps
=======================
class-map type queuing class-default-q
class-map type queuing q0
class-map type queuing q1
class-map type queuing q2
class-map type queuing q3
class-map type queuing q4
class-map type queuing q5
class-map type queuing q6
class-map type queuing q7
OcNOS#show running-config qos
qos enable
!
class-map type qos match-all cmap1
match dscp 2
policy-map type qos pmap1
class type qos cmap1
police cir 1 mbps eir 1 mbps bc 1 kbytes be 1 kbytes
exit
!
!
!
interface xe1
service-policy type qos input pmap1
!
OcNOS#show policy-map
Type qos policy-maps
====================
policy-map type qos pmap1
class type qos cmap1
police cir 1 mbps eir 1 mbps bc 1 kbytes be 1 kbytes
Type queuing policy-maps
========================
policy-map type queuing default default-out-policy
class type queuing default q0
priority level 0
class type queuing default q1
priority level 1
class type queuing default q2
priority level 2
class type queuing default q3
priority level 3
class type queuing default q4
priority level 4
class type queuing default q5
priority level 5
class type queuing default q6
priority level 6
class type queuing default q7
priority level 7
policy-map type queuing default subif-default-out-policy
class type queuing default q0
priority level 0
class type queuing default q1
priority level 1
class type queuing default q2
priority level 2
class type queuing default q3
priority level 3
OcNOS#show policy-map int xe15
Interface xe15
Type QoS statistics status : disabled
Type QoS Ingress policy-map : pmap1
Class-map (qos): cmap1 (match all)
match dscp 2
police cir 1 mbps eir 1 mbps bc 1 kbytes be 1 kbytes
Type Queuing policy-map : default-out-policy
Class-map (queuing): q0
shape 10000000 kbps (inherited)
priority level 0
queue-limit (default)
Output
Total : 451 packets, 33887 bytes
Green : 451 packets, 33887 bytes
Yellow : 0 packets, 0 bytes
Class-map (queuing): q1
shape 10000000 kbps (inherited)
priority level 1
queue-limit (default)
Class-map (queuing): q2
shape 10000000 kbps (inherited)
priority level 2
queue-limit (default)
Class-map (queuing): q3
shape 10000000 kbps (inherited)
priority level 3
queue-limit (default)
Class-map (queuing): q4
shape 10000000 kbps (inherited)
priority level 4
queue-limit (default)
Class-map (queuing): q5
shape 10000000 kbps (inherited)
priority level 5
queue-limit (default)
Class-map (queuing): q6
shape 10000000 kbps (inherited)
priority level 6
queue-limit (default)
Output
Total : 1119 packets, 100461 bytes
Green : 1119 packets, 100461 bytes
Yellow : 0 packets, 0 bytes
Class-map (queuing): q7
shape 10000000 kbps (inherited)
priority level 7
queue-limit (default)
Output
Total : 56 packets, 4088 bytes
Green : 56 packets, 4088 bytes
Yellow : 0 packets, 0 bytes