Traffic shapers and policers use packet traffic descriptors to ensure adherence to the service level agreement in QoS. However,
when traffic flows from one hop to another in a network, headers added or removed at interim hops affect the packet bytes
being accounted for by QoS at each hop. When your end-user network measures the packet bytes to ensure they receive the payload
as agreed, these additional header bytes cause a discrepancy.
QoS overhead accounting provides the flexibility to operators to decide which header bytes can be excluded by the traffic
shaper and policer and which can be included, depending on the end user’s requirements and device capabilities, to meet the
committed payload in units of bytes.
For example, if the QoS commitment includes the additional header bytes, the overhead accounting feature allows your router
to account for this overhead and reduces the traffic policing and shaping rates accordingly. This is also called a positive accounting overhead.
If however, the committed rate doesn’t include the additional bytes, overhead accounting allows your router to adjust the
core stream traffic such that the traffic policing and shaping rates are increased. This is also called a negative accounting overhead.
To summarize, QoS overhead accounting enables the router to account for packet overhead when shaping and policing traffic
to a specific rate. This accounting ensures that the router runs QoS features on the actual bandwidth that the subscriber
traffic consumes.
Any interface that supports QoS policies supports overhead accounting.
Note
|
You can enable user overhead accounting using the optional configuration of accounting user-defined
<overhead size in bytes> while attaching the service policy on the egress interface.
|
Prerequisites and Restrictions
-
Overhead accounting for ingress shaping is not supported.
-
Overhead accounting is not reflected in any QoS counters (classification, policing, or queuing). In other words, when you
run show policy-map statistics, the results do not include the overhead bytes but display the actual packet sizes.
-
Dynamic changing of accounting overhead after application of the policy on the interface is not supported.
-
You must remove the service policy from the interface and apply it back with the required overhead value. You can, however,
remove and reapply the service policy in a single configuration commit.
Configuring for Overhead Accounting
To configure overhead accounting, you must:
-
Create a policy map and configure QoS actions for that map.
-
Configure overhead accounting and attach the map to an interface.
/* create QoS policy */
Router#configure terminal
Router(config)#policy-map policer
Router(config-pmap)#class class-default
Router(config-pmap-c)#police rate percent 10
Router(config-pmap-c-police)#commit
/* configure account overhead value while attaching the QoS policy to interface */
Router(config)#int hundredGigE 0/0/0/2
Router(config-if)#service-policy input policer account user-defined 12
Router(config-if)#commit
Router(config-if)#root
Router(config)#end
Running ConfigurationRouter#sh run int hundredGigE 0/0/0/2
interface HundredGigE0/0/0/2
service-policy input policer account user-defined 12
!
Verification
Router#sh qos-ea int hundredGigE 0/0/0/2 input detail
Interface: HundredGigE0_0_0_2 input policy: policer
Total number of classes: 1
Total number of UBRL classes: 0
Total number of CAC classes: 0
-------------------------------------------------------
Policy name: policer
Hierarchical depth 1
Interface type HundredGigE
Interface rate 100000000 kbps
Port Shaper rate 0 kbps
Interface handle 0x00000680
ul_ifh 0x00000000, ul_id 0x00000080
uidb index 0x0003
qos_ifh 0x10200020800003
Local port 16, NP 0
Policy map id 0x6018, format 8, uidb index 0x0003
-------------------------------------------------------
Index 0 Level 0 Class name class-default service_id 0x0 Policy name policer
Node flags: LEAF DEFAULT DEFAULT-ALL
Stats flags: Policer type 1 Max category 0
Node Config:
Police Color aware 0 Type 1 CIR/CBS/PIR/PBS: 10000000kbps/125000000B/0kbps/0B
Node Result: Class-based stats:Stat ID 0x00000310
Queue: N/A Stat ID(Commit): 0x00000000
Stat ID(Drop Curve 0): 0x00000000
Stat ID(Drop Curve 1): 0x00000000
Stat ID(Drop Curve 2): 0x00000000
Stat ID(Drop Curve 3): 0x00000000
Police ID (Token/Conform/Exceed/Violate/Parent-Drop):0x00000008/0x00000310/0x00000311/0x00000312/0x00000313
Hash key (host format):
0x55b44c6b93dd: 02 00 00 00 00 14 00 14
UIDB Index: 0x0000 (0)
Class ID : 0x0000 (0)
SW SOURCE-PORT: 0x14 (20)
HW NP-PORT: 0x14 (20)
hash result (host format):
0x55b44c6b939b: 02 00 33 00 00 00 00 00
0x55b44c6b93a3: 00 00 00 00 08 00 00 00
0x55b44c6b93ab: 00 00 00 00 00 00 00 00
0x55b44c6b93b3: 10 03 00 00 00 00 00 00
0x55b44c6b93bb: 00 00 00 00 00 00 00 00
0x55b44c6b93c3: 00 00 00 00 00 00 00 00
0x55b44c6b93cb: 00 00 00 00 00 00 00 00
0x55b44c6b93d3: 00 00 00 00 00 00 00 00
0x55b44c6b93db: 0000
FID0 : 0x00000000 (0)
FID1 : 0x00000000 (0)
Token Bucket : 0x000008 (8)
Parent Token Bucket : 0x000000 (0)
Stats ID : 0x000310 (784)
Parent Stats ID : 0x000000 (0)
COS : 0x000003 (3)
L1 Overhead Size : 0x00000C (12)
L1 Overhead Negative: 0x000000 (0)
hash result (ucode format):
03000000000014004000000000000000800310a88000000c000000000000000000000000000000000000000000000000
hash_tbl_id = 0 (0x0)
uidb_index = 3 (0x3)
class_id = 0 (0x0)
np_port = 0 (0x0)
sat_icl_bundle_port = 0 (0x0)
ctrl_egress = 0 (0x0)
ctrl_ingress = 0 (0x0)
RESULT:
q_action_valid = 1 (0x1)
turbo = 0 (0x0)
l1_oh_neg = 0 (0x0)
match = 1 (0x1)
queue_stats_offset = 4 (0x4)
c_stat = 8389392 (0x800310)
p_stat = 8388608 (0x800000)
val = 12 (0xc)
c_tb = 0 (0x0)
p_tb = 0 (0x0)
gp_tb = 0 (0x0)
queue_en = 0 (0x0)
profile_table_ptr = 0 (0x0)
queue_id 0
offset_table_ptr = 0 (0x0)
offset_array_0 = 0 (0x0)
= 0 0 0 0 0 0 0 0
offset_array_1 = 0 (0x0)
= 0 0 0 0 0 0 0 0
tcam result (host format):
0x55b44c6b9374: 80 41 00 03 00 00 00 00
0x55b44c6b937c: 4A FF 00 00 FF 00 00 FF
0x55b44c6b9384: 00 00 40 FF 00 00 FF 00
0x55b44c6b938c: 00 FF 00 00 00 00 00 00
0x55b44c6b9394: 00000000000000
The following example shows how to configure a negative overhead accounting value:
Router#conf
Router(config)#int hundredGigE 0/0/0/2
Router(config-if)#service-policy input policer account user-defined -12
Router(config-if)#commit
The following example shows how to verify the negative overhead accounting value you configured in the preceding example:
Router#sh qos-ea int hundredGigE 0/0/0/2 input detail
Interface: HundredGigE0_0_0_2 input policy: policer
RP/0/RSP0/CPU0:Router#sh qos-ea int hundredGigE 0/0/0/2 input detail
Interface: HundredGigE0_0_0_2 input policy: policer
Total number of classes: 1
Total number of UBRL classes: 0
Total number of CAC classes: 0
-------------------------------------------------------
Policy name: policer
Hierarchical depth 1
Interface type HundredGigE
Interface rate 100000000 kbps
Port Shaper rate 0 kbps
Interface handle 0x00000680
ul_ifh 0x00000000, ul_id 0x00000080
uidb index 0x0003
qos_ifh 0x10200020800003
Local port 16, NP 0
Policy map id 0x601C, format 8, uidb index 0x0003
-------------------------------------------------------
Index 0 Level 0 Class name class-default service_id 0x0 Policy name policer
Node flags: LEAF DEFAULT DEFAULT-ALL
Stats flags: Policer type 1 Max category 0
Node Config:
Police Color aware 0 Type 1 CIR/CBS/PIR/PBS: 10000000kbps/125000000B/0kbps/0B
Node Result: Class-based stats:Stat ID 0x00000310
Queue: N/A Stat ID(Commit): 0x00000000
Stat ID(Drop Curve 0): 0x00000000
Stat ID(Drop Curve 1): 0x00000000
Stat ID(Drop Curve 2): 0x00000000
Stat ID(Drop Curve 3): 0x00000000
Police ID (Token/Conform/Exceed/Violate/Parent-Drop):0x00000010/0x00000310/0x00000311/0x00000312/0x00000313
Hash key (host format):
0x55c9fa43d3dd: 02 00 00 00 00 14 00 14
UIDB Index: 0x0000 (0)
Class ID : 0x0000 (0)
SW SOURCE-PORT: 0x14 (20)
HW NP-PORT: 0x14 (20)
hash result (host format):
0x55c9fa43d39b: 82 00 33 00 00 00 00 00
0x55c9fa43d3a3: 00 00 00 00 10 00 00 00
0x55c9fa43d3ab: 00 00 00 00 00 00 00 00
0x55c9fa43d3b3: 10 03 00 00 00 00 00 00
0x55c9fa43d3bb: 00 00 00 00 00 00 00 00
0x55c9fa43d3c3: 00 00 00 00 00 00 00 00
0x55c9fa43d3cb: 00 00 00 00 00 00 00 00
0x55c9fa43d3d3: 00 00 00 00 00 00 00 00
0x55c9fa43d3db: 0000
FID0 : 0x00000000 (0)
FID1 : 0x00000000 (0)
Token Bucket : 0x000010 (16)
Parent Token Bucket : 0x000000 (0)
Stats ID : 0x000310 (784)
Parent Stats ID : 0x000000 (0)
COS : 0x000003 (3)
L1 Overhead Size : 0x00000C (12)
L1 Overhead Negative: 0x000001 (1)
hash result (ucode format):
03000000000014004000000000000000800310b88000000c000000000000000000000000000000000000000000000000
hash_tbl_id = 0 (0x0)
uidb_index = 3 (0x3)
class_id = 0 (0x0)
np_port = 0 (0x0)
sat_icl_bundle_port = 0 (0x0)
ctrl_egress = 0 (0x0)
ctrl_ingress = 0 (0x0)
RESULT:
RP/0/RSP0/CPU0:Router#
To modify an overhead accounting value, you must:
-
Remove the existing QoS policy and re-add it.
-
Configure the new overhead accounting value.
Router#conf
Router(config)#int hundredGigE 0/0/0/2
Router(config-if)#no service-policy input policer
Router(config-if)#service-policy input policer account user-defined -20
Router(config-if)#commit
Router#sh run int hundredGigE 0/0/0/2
interface HundredGigE0/0/0/2
service-policy input policer account user-defined -20
!
To verify the modified overhead accounting value:
Router#sh qos-ea int hundredGigE 0/0/0/2 input detail
Interface: HundredGigE0_0_0_2 input policy: policer
Total number of classes: 1
Total number of UBRL classes: 0
Total number of CAC classes: 0
-------------------------------------------------------
Policy name: policer
Hierarchical depth 1
Interface type HundredGigE
Interface rate 100000000 kbps
Port Shaper rate 0 kbps
Interface handle 0x00000680
ul_ifh 0x00000000, ul_id 0x00000080
uidb index 0x0003
qos_ifh 0x10200020800003
Local port 16, NP 0
Policy map id 0x6020, format 8, uidb index 0x0003
-------------------------------------------------------
Index 0 Level 0 Class name class-default service_id 0x0 Policy name policer
Node flags: LEAF DEFAULT DEFAULT-ALL
Stats flags: Policer type 1 Max category 0
Node Config:
Police Color aware 0 Type 1 CIR/CBS/PIR/PBS: 10000000kbps/125000000B/0kbps/0B
Node Result: Class-based stats:Stat ID 0x00000314
Queue: N/A Stat ID(Commit): 0x00000000
Stat ID(Drop Curve 0): 0x00000000
Stat ID(Drop Curve 1): 0x00000000
Stat ID(Drop Curve 2): 0x00000000
Stat ID(Drop Curve 3): 0x00000000
Police ID (Token/Conform/Exceed/Violate/Parent-Drop):0x00000018/0x00000314/0x00000315/0x00000316/0x00000317
Hash key (host format):
0x557e9a5ad3dd: 02 00 00 00 00 14 00 14
UIDB Index: 0x0000 (0)
Class ID : 0x0000 (0)
SW SOURCE-PORT: 0x14 (20)
HW NP-PORT: 0x14 (20)
hash result (host format):
0x557e9a5ad39b: 82 00 53 00 00 00 00 00
0x557e9a5ad3a3: 00 00 00 00 18 00 00 00
0x557e9a5ad3ab: 00 00 00 00 00 00 00 00
0x557e9a5ad3b3: 14 03 00 00 00 00 00 00
0x557e9a5ad3bb: 00 00 00 00 00 00 00 00
0x557e9a5ad3c3: 00 00 00 00 00 00 00 00
0x557e9a5ad3cb: 00 00 00 00 00 00 00 00
0x557e9a5ad3d3: 00 00 00 00 00 00 00 00
0x557e9a5ad3db: 0000
FID0 : 0x00000000 (0)
FID1 : 0x00000000 (0)
Token Bucket : 0x000018 (24)
Parent Token Bucket : 0x000000 (0)
Stats ID : 0x000314 (788)
Parent Stats ID : 0x000000 (0)
COS : 0x000003 (3)
L1 Overhead Size : 0x000014 (20)
L1 Overhead Negative: 0x000001 (1)
hash result (ucode format):
03000000000014004000000000000000800314b880000014000000000000000000000000000000000000000000000000
hash_tbl_id = 0 (0x0)
uidb_index = 3 (0x3)
class_id = 0 (0x0)
np_port = 0 (0x0)
sat_icl_bundle_port = 0 (0x0)
ctrl_egress = 0 (0x0)
ctrl_ingress = 0 (0x0)
Positive Accounting Use Case
If QoS commitment includes Preamble, Frame Delimiter & Interframe Gap and has the following configuration:service-policy input <foo> account user-defined +20
For QoS purposes, your router treats this packet as a packet of size = Actual Packet size + 20. Hence, the effective policing
and shaping is reduced to match the downstream interface.
Negative Accounting Use Case
If QoS commitment to ASR9000 does not include VLAN header information, and has the following configuration:
service-policy input <foo> account user-defined -4
For QoS purposes, your router treats this packet as a packet of size = Actual Packet size – 4. Hence, the effective policing
and shaping is increased to match the downstream interface.
Associated Commands
service-policy (overhead accounting)