Configuring traffic templates
In order to define mappings of 802.1p priorities to queues, traffic class groups (traffic groups) are defined as part of a traffic template. A traffic group consists of a set of 802.1p priorities that are mapped to the same egress queue. A traffic template consists of a set of traffic groups that cover all priorities 0- 7. The number of traffic groups allowed within a traffic template is equal to the number of queues configured on a platform, although a queue may have no priorities mapped to it.
For example, if you want to configure a switch with a priority to queue mapping that matches a connected networking device’s queue configuration, and the neighbor device has 3 queues configured, all priorities should be mapped to the 3 highest priority queues on the switch in a manner that matches the configuration of the neighbor device.
Once defined, the traffic template is then assigned in its entirety to all ports of the switch.
Two predefined traffic templates are provided that correspond to the IEEE 802.1p traffic group specification (default-tcgt) and the 802.1q update (dot1q.tcgt). These predefined templates may be applied as is, or they may be used as the basis for defining a custom template.
Displaying traffic template information
To display a summary of all traffic templates,
enter the show qos traffic-template
command.
List of the currently defined traffic templates and their status
switch(config)# show qos traffic-template System default template: default-tcgt Template Name Status Queues ------------- ------ ------ example Valid 4 dot1q-tcgt (predefined) Valid 4 default-tcgt (predefined) Active 4
To display detailed information about a single
traffic template, enter the show qos traffic-template <template-name>
command.
List of the currently defined traffic templates and their status
switch(config)# show qos traffic-template default-tcgt Template Name: default-tcgt (predefined) Status : Active Queue-no Priorities Name -------- ------------- -------------------- 1 1,2 background-tcg 2 0,3 best-effort-tcg 3 4,5 controlled-load-tcg 4 6,7 control-tc
Note: The Name column shows the descriptive names assigned to the traffic group to help identify their purpose.
Creating a traffic template
A traffic template can be created, modified, or deleted by entering this command in the global configuration context.
Syntax:
[no]qos traffic-template
<template-name>
Enter the Traffic Template Configuration level or execute one command for that level. With no additional parameters specified, the
qos traffic-template
command changes the context to Traffic Template Configuration level for execution of configuration changes to the named template.If
does not exist already, the template will be created as a copy of default-tcgt and the traffic template context is entered. The maximum length is 40 characters.
<template-name>
If
already exists, the traffic template context for that template is entered and you can make modifications to the template.
<namestring>
qos traffic-template
<template-name>
<copy-from-name>
When executed, a new template is created with the name
as a copy of the existing template named
<template-name>
.
<copy-from-name>
no qos traffic-template
<template-name>
Deletes the specified traffic template. Predefined templates and the currently active template may not be deleted.
show qos traffic-template
[
<template-name>
]
When entered without the name of a specific traffic template, displays a list of the current traffic templates and their status - active, valid, or invalid.
When executed with the name of a specific traffic template, detailed information for that traffic template displays.
After executing the qos traffic-template
command
in the global configuration context, you are in traffic template context
and can begin modifying a newly created template or an existing template.<template-name>
Creating a new traffic template and entering traffic template configuration context
switch(config)# qos traffic-template example switch(cfg-tcgt-example )# show qos traffic-template example Template Name: example Status : Valid Queue-no Priorities Name -------- ------------- -------------------- 1 1,2 background-tcg 2 0,3 best-effort-tcg 3 4,5 controlled-load-tcg 4 6,7 control-tcg
You should always check the traffic template
status using the show qos traffic-template
command
to make sure that the template is valid. Invalid templates cannot
be applied to ports. A traffic template will be invalid if the priorities
are not mapped to an egress queue. This can happen, for example, if
you delete a priority from a queue and do not reassign it to another
queue.
If a template has been applied, it is considered
to be in use and cannot be deleted. The show qos queue-config
command
displays the currently active traffic template.
Displaying the currently active traffic template
HP-Switch(config)# show qos queue-config Egress Queue Configuration Queue servicing: weighted-round-robin simple-red enabled Traffic Template: example 802.1p Queue Priority ----- -------- 1 1,2 2 0,3 3 4,5 4 6,7
Configuring traffic groups within a traffic template
When in the traffic template context, you can modify traffic groups within that template by changing which priorities are assigned to what queues, as well as assigning a name to each group.
Syntax:
[no] map-traffic-group
<queue-num>
priority <priority>
[name <namestring>
]
Allows configuration of traffic groups with a traffic template.
The
no
form of the command removes a priority from the currently mapped queue.
: ranges from 1 to the number of active queues, which can vary from 1 to 8 queues. The number of queues is configured with the
<queue-num>
qos queue-config
command.
priority <0-7>
: Specifies an 802.1p priority to assign this queue. This command may be repeated to assign multiple priorities to the same queue.
name
: Optional, a name that can be assigned to help identify the purpose of a particular traffic group. Maximum length is 40 characters.<namestring>
The
no
form of the command removes the descriptive name from the group.
Moving a priority from one traffic group to another
Typically, when modifying a traffic template,
priorities are reassigned to different queues. When moving a priority
from one traffic group to another, you must first delete that priority
from the traffic group it is currently mapped to (no map-traffic-group
and
then add it the desired traffic group.<queue-num>
priority <priority>
NOTE: Before changing the traffic groups’ priority mappings from the defaults, it is important to examine the current policies that act on 802.1p priorities to ensure that the policies best serve the behavior desired on the network, including DSCP, VLAN, interface, or protocol rules. | |
Removing priorities from a traffic group
switch(cfg-tcgt-example)# no map-traffic-group 2 priority 0 switch(cfg-tcgt-example)# show qos traffic-template example Template Name: example Status : Invalid Queue-no Priorities Name -------- ------------- -------------------- 1 0,1,2 background-tcg 2 3 best-effort-tcg 3 4,5 controlled-load-tcg 4 6,7 control-tcg
After removing the priority from the currently mapped queue, the template becomes invalid because priority 0 is no longer mapped to any queue.
Mapping the priority to a new queue results in a valid traffic template again.
Invalid traffic template because a priority is unmapped
switch(cfg-tcgt-example)# show qos traffic-template example TRAFFIC-TEMPLATE: example Status : Invalid Queue-no Priorities Name -------- ------------- -------------------- 1 1,2 background-tcg 2 3 best-effort-tcg 3 4,5 controlled-load-tcg 4 6,7 control-tcg
Valid traffic template with remapped queue
switch(cfg-tcgt-example)# map-traffic-group 1 priority 0 switch(cfg-tcgt-example)# show qos traffic-template example Template Name: example Status : Valid Queue Priorities Name -------- ------------- -------------------- 1 1,2 background-tcg 2 3,0 best-effort-tcg 3 4,5 controlled-load-tcg 4 6,7 control-tcg
After modifying a traffic template, you must apply it to the switch to activate the new mapping. See Applying a traffic template.
Applying a traffic template
After creating a traffic template with the desired queue assignments, you must apply it. The same traffic templates must be applied to the all ports in the entire switch. A reboot is required for the new template to take effect.
Syntax:
qos queue-config
traffic-template
<template-name>
Applies the specified traffic template to all the ports and reboots the switch.
Applying a traffic template to a switch
HP-Switch(config)# qos queue-config traffic-template example This command will modify the current running configuration, execute 'write memory' to replace the startup configuration, and then reboot. Egress queues will be configured as follows: 4-queues Queue servicing: weighted-round-robin simple-red disabled Traffic template: example Do you want to save current configuration [y/n/^C]? y Device will be rebooted, do you want to continue [y/n]? y