05-QoS and Flow-based Redirection Configuration
05-QoS and Flow-based Redirection Configuration
Content
1
QoS and Flow-based
Redirection Configuration Content
2
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
QoS (Quality of Service) is a set of capabilities that allow you to create differentiated
services for network traffic, thereby providing better service for selected network traffic.
QoS is a guarantee for service quality of consistent and predictable data transfer service
to fulfill program requirements. QoS cannot generate extra bandwidth but provides more
effective bandwidth management according to the application requirement and network
management policy.
1-1
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
1-2
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
1-3
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
Start
N tag packet
L2 COS value
L2 COS value of the
obtained by the
packet is its own L2
packet as the default
COS
COS(*1)
N
N
Trust COS Y
N
(*2)
N tag packet
Y
Set Int-Prio as the
DSCP-to-Int-Prio
default ingress Int-
COS -to-Int-Prio conversion according to
Prio
conversion according to DSCP value of the packet
L2 COS value of the
packet
1-4
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
Note 2: Allow Trust DSCP and Trust COS to be configured at the same time, the priority is
as follows: DSCP>COS.
Policing and remark: Each packet in classified ingress traffic is assigned an internal
priority value, and can be policed and remarked.
Policing can be performed based on the flow to configure different policies that
allocate bandwidth to classified traffic, the assigned bandwidth policy may be single
bucket dual color or dual bucket three color. The traffic, will be assigned with different
color, can be discarded or passed, for the passed packets, add the remarking action.
Remarking uses a new Int-Prio value of lower priority to replace the original higher level
Int-Prio value in the packet. COS and DSCP fields will be modifed according to the new
Int-Prio at the egress. The following flowchart describes the operations.
1-5
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
Start
No Whether configure
the policy
Yes
Pass
The specific
Drop
color action
Pass
Drop the
Enter scheduling
packets
1-6
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
Queuing and scheduling: There are the internal priority for the egress packets, the
scheduling operation assigns the packets to different priority queues according to the
internal priority, and then forward the packets according to the priority queue weight and
the drop precedence. The following flowchart describes the scheduling operation.
Start
buffer is
available No
Yes
Drop the
Finish packets
1-7
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
1-8
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
1-9
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
1-10
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
1-11
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
Example 1:
Enable QoS function, change the global queue out weight to 1:1:2:2:4:4:8:8, set
port ethernet 1/0/1 in trust CoS mode without changing DSCP value, and set the default
CoS value of the port to 5.
The configuration steps are listed below:
Switch#config
1-12
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
Configuration result:
When QoS enabled in Global Mode, the egress queue bandwidth proportion of each
port is 1:1:2:2:4:4:8:8. When packets have CoS value coming in through port
ethernet1/0/1, it will be map to the internal priority according to the CoS value, CoS value
0 to 7 correspond to queue out 1, 2, 3, 4, 5, 6, 7, 8 respectively. If the incoming packet has
no CoS value, it is default to 5 and will be put in queue6. All passing packets would not
have their DSCP values changed
Example 2:
In port ethernet1/0/2, set the bandwidth for packets from segment 192.168.1.0 to 10 Mb/s,
with a burst value of 4 MB, all packets exceed this bandwidth setting will be dropped.
Configuration result:
An ACL name 1 is set to matching segment 192.168.1.0. Enable QoS globally, create
a class map named c1, matching ACL1 in class map; create another policy map named
p1 and refer to c1 in p1, set appropriate policies to limit bandwidth and burst value. Apply
this policy map on port ethernet1/0/2. After the above settings done, bandwidth for
packets from segment 192.168.1.0 through port ethernet 1/0/2 is set to 10 Mb/s, with a
1-13
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
burst value of 4 MB, all packets exceed this bandwidth setting in that segment will be
dropped.
Example 3:
Server
QoS area
Switch3
Switch2
Trunk
Switch1
1-14
QoS and Flow-based
Redirection Configuration Chapter 1 QoS Configuration
Switch(Config-PolicyMap-p1)#exit
Switch(config)#interface ethernet 1/0/1
Switch(Config-If-Ethernet1/0/1)#service-policy input p1
trust cos and EXP can be used with other trust or Policy Map.
trust dscp can be used with other trust or Policy Map. This configuration takes
effect to IPv4 and IPv6 packets.
trust exp, trust dscp and trust cos may be configured at the same time, the
priority is: EXP>DSCP>COS.
If the dynamic VLAN (mac vlan/voice vlan/ip subnet vlan/protocol vlan) is
configured, then the packet COS value equals COS value of the dynamic VLAN.
At present, it is not recommended to synchronously use policy map on VLAN and
VLAN’s port.
1-15
QoS and Flow-based
Redirection Configuration Chapter 2 Flow-based Redirection
Flow-based redirection function enables the switch to transmit the data frames
meeting some special condition (specified by ACL) to another specified port. The fames
meeting a same special condition are called a class of flow, the ingress port of the data
frame is called the source port of redirection, and the specified egress port is called the
destination port of redirection. Usually there are two kinds of application of flow-based
redirection: 1. connecting a protocol analyzer (for example, Sniffer) or a RMON monitor
to the destination port of redirection, to monitor and manage the network, and diagnose
the problems in the network; 2. Special transmission policy for a special type of data
frames.
The switch can only designate a single destination port of redirection for a same
class of flow within a source port of redirection, while it can designate different
destination ports of redirection for different classes of flows within a source port of
redirection. The same class of flow can be applied to different source ports.
Command Explanation
Physical Interface Configuration Mode
Specify flow-based
redirection for the port; the
access-group <aclname> redirect to interface
“no access-group
[ethernet <IFNAME>|<IFNAME>]
<aclname> redirect”
no access-group <aclname> redirect
command is used to delete
flow-based redirection.
2-1
QoS and Flow-based
Redirection Configuration Chapter 2 Flow-based Redirection
Example:
User’s request of configuration is listed as follows: redirecting the frames whose
source IP is 192.168.1.111 received from port 1 to port 6, that is sending the frames
whose source IP is 192.168.1.111 received from port 1 through port6.
Modification of configuration:
2-2
QoS and Flow-based
Redirection Configuration Chapter 2 Flow-based Redirection
When the configuration of flow-based redirection fails, please check that whether it
is the following reasons causing the problem:
The type of flow (ACL) can only be digital standard IP ACL, digital extensive IP ACL,
nomenclature standard IP ACL, nomenclature extensive IP ACL, digital standard
IPv6 ACL, and nomenclature standard IPv6 ACL;
Parameters of Timerange and Portrange can not be set in ACL, the type of ACL
should be Permit.
The redirection port must be 1000Mb port in the flow-based redirection function.
Do not implement the forward across VLAN for flow-based redirection.
2-3
QoS and Flow-based
Redirection Configuration Chapter 3 Egress QoS Configuration
In traditional IP networks, all packets are treated in the same way. All network
equipments treat them by the first-in-first-out policy and try best effort to send them to the
destination. However, it does not guarantee the performance like reliability and
transmission delay. Network develops so fast that new demand has been raised for the
quality of service on IP network with the continual emergence of new applications. For
example, delay-sensitive services like VoIP and video put higher demands on packet
transmission delay and users cannot accept too long transmission delay (by contrast,
E-mail and FTP services are not sensitive to the time delay). In order to support services
with different service requirement like voice, video and data service, the network is
required to be able to distinguish between different communications and provide
appropriate service. The traditional best-effort IP network cannot identify and distinguish
various kinds of communications while this ability is the very premise of providing
differentiated services for different communications. Therefore, the best-effort service
mode of traditional network cannot meet the demand of applications. The emergence of
QoS techniques is committed to solve this problem.
Egress PolicyMap is the QoS policy in egress which performs QoS control of packets
in the egress direction and provides better service for specified network communication
with kinds of techniques. Egress PolicyMap includes class-map and policy-map, of which
class-map is used for selecting packets to operate and policy-map is used for specifying
the operation to use. Not all equipments support Egress QoS currently.
3-1
QoS and Flow-based
Redirection Configuration Chapter 3 Egress QoS Configuration
Ingress Egress
Generate
internal
priority color Policing and
Classification Policing Remark scheduling remark of
Egress
According to the characters (including field values like COS and DSCP) of upstream
packets, policing and rewriting of Egress make the last QoS change on the packet prior to
the packet egress.
Policing configures different policing policy based on the flow and distributes
bandwidth for the flow classified. The distribution policy of bandwidth can be either dual
bucket dual color or dual bucket three color. Different colors can be assigned to different
flows and approaches of discard or passage can be chosen for them; you can add
rewriting action for packets with passage approach chosen. See the following flow chart
for detailed description of Egress QoS:
3-2
QoS and Flow-based
Redirection Configuration Chapter 3 Egress QoS Configuration
Start
Classify or not No
Yes
Modify QoS
(optional): Drop
Set cos/dscp
Transmit
Whether
configured No
Policing policy
Yes
结束
Description of action that modify QoS attribute according to egress remark table:
cos-cos:for cos value of packets, modify cos value of packets according to cos table of
QoS remarking
cos-dscp:for cos value of packets, modify dscp value of packets according to cos table of
QoS remarking
dscp-cos:for dscp value of packets, modify cos value of packets according to dscp table
of QoS remarking
dscp-dscp:for dscp value of packets, modify dscp value of packets according to dscp
table of QoS remarking
3-3
QoS and Flow-based
Redirection Configuration Chapter 3 Egress QoS Configuration
1. Configure a class-map
Command Explanation
Global Mode
class-map <class-map-name> Create a class-map and enter
no class-map <class-map-name> class-map mode, no command
deletes the specified class-map.
match {access-group <acl-index-or-name> Configure the matched standard of the
| ip dscp <dscp-list> | ip precedence class map to classify the data stream
<ip-precedence-list> | ipv6 dscp according to ACL, CoS, VLAN ID,
<dscp-list> | vlan <vlan-list> | cos IPv4 Precedence, DSCP, IPv6 DSCP
<cos-list> | ipv6 access-group priority; no command deletes the
<acl-index-or-name>} specific matched standard.
no match {access-group | ip dscp | ip
precedence | ipv6 dscp | vlan | cos | ipv6
access-group}
2. Configure a policy-map
Command Explanation
Global Mode
Create a policy-map and enter
policy-map <policy-map-name>
policy-map mode, no command deletes
no policy-map <policy-map-name>
the specific policy-map.
3-4
QoS and Flow-based
Redirection Configuration Chapter 3 Egress QoS Configuration
ACTION definition:
policied-cos-to-cos-transmit |
policied-cos-to-dscp-transmit |
policied-dscp-exp-to-cos-transmit |
policied-dscp-exp-to-dscp-transmit
no policy
Set statistic function for the classified
flow. After enable this function under the
accounting policy class map mode, add statistic
no accounting function to the flow of the policy class
map. In single bucket mode, packets can
only red or green when passing policy. In
3-5
QoS and Flow-based
Redirection Configuration Chapter 3 Egress QoS Configuration
3-6
QoS and Flow-based
Redirection Configuration Chapter 3 Egress QoS Configuration
Example1:
On the egress of the port1, change cos value as 4 for the packet with dscp value of 0.
Create a class map:
switch(config)#class-map 1
switch(config-classmap-1)#match ip dscp 0
switch(config-classmap-1)#exit
3-7
QoS and Flow-based
Redirection Configuration Chapter 3 Egress QoS Configuration
Example2:
On the egress of vlan10, change cos value as 4 for the packet with ipv6 dscp value of
7.
Create a class map:
switch(config)#class-map 1
switch(config-classmap-1)#match ipv6 dscp 7
switch(config-classmap-1)#exit
Example 3:
In egress of port 1, limit the speed of packets. Set the bandwidth for packets to 1 Mb/s,
with the normal burst value of 1 MB, the max burst value of 4 MB, set dscp value of 1 as
10 for green packets, set dscp value of yellow packets as 9 and drop red packets.
Create a class map
switch(config)#class-map c1
switch(config-classmap-c1)#match ip dscp 1
switch(config-classmap-c1)#exit
Create a policy map
switch(config)#policy-map p1
switch(config-policymap-p1)#class c1
switch(config-policymap-p1-class-c1)#policy 1000 1000 4000 action
policied-dscp-exp-to-dscp-transmit violate-action drop
switch(config-policymap-p1-class-c1)#exit
switch(config-policymap-p1)#exit
3-8
QoS and Flow-based
Redirection Configuration Chapter 3 Egress QoS Configuration
Not all equipments support Egress QoS presently, so please make sure the current
device supports this function.
If the policy configured cannot bind to the port or VLAN, please check whether the
match option in classification table is supported by the current device.
If terminal printing suggests lack of resource, please make sure there is enough
resource to send the current policy.
If the policy with match acl configured cannot bind to the port or VLAN, please make
sure rules including permit exist in ACL.
If modifying QoS attribute is invalid by Egress QoS remark, please ensure whether
ingress sets the correspondsing QoS attribute with trust.
If egress set QoS attributes (set cos/ip dscp) for modifying all packets, and it uses
Egress remark to modify QoS attributes for packets of different colors, previous
modification is preferential for modifying packets.
3-9
QoS and Flow-based
Redirection Configuration Chapter 4 Flexible QinQ Configuration
The match of flexible QinQ data flow uses policy-map rule of QoS to be sent, the
configuration task list is as follows:
1. Create class-map to classify different data flows
4-1
QoS and Flow-based
Redirection Configuration Chapter 4 Flexible QinQ Configuration
2. Create flexible QinQ policy-map to relate with the class-map and set the corresponding
operation
3. Bind flexible QinQ policy-map to port
4-2
QoS and Flow-based
Redirection Configuration Chapter 4 Flexible QinQ Configuration
4-3
QoS and Flow-based
Redirection Configuration Chapter 4 Flexible QinQ Configuration
As shown in the figure, the first user is assigned three VLANs that the tag values are
1001, 2001, 3001 respectively in DSLAM1. VLAN1001 corresponds to Broad Band
Network, VLAN2001 corresponds to VOIP, VLAN3001 corresponds to VOD. After the
downlink port enables flexible QinQ function, the packets will be packed with different
external tags according to VLAN ID of users. The packet with tag 1001 will be packed an
external tag 1001 directly(This tag is unique in public network), enter Broad Band
Network-VLAN1001 and classfied to BRAS device. The packet with tag 2001(or 3001) will
be packed an external tag 2001(or 3001) and classfied to SR device according to the flow
rules. The second user can be assigned different VLAN tags for different VLANs in
DSLAM2. Notice: The assigned VLAN tag of the second user may be same with the first
user and the packet with tag will be also packed an external tag. In the above figure, the
external tag of the second user is different to the first user for distinguishing DSLAM
location and locating the user finally.
The configuration in the following:
If the data flow of DSLAM1 enters the switch’s downlink port1, the configuration is as
follows:
Switch(config)#class-map c1
Switch(config-classmap-c1)#match vlan 1001
Switch(config-classmap-c1)#exit
Switch(config)#class-map c2
Switch(config-classmap-c2)#match vlan 2001
Switch(config-classmap-c2)#exit
Switch(config)#class-map c3
Switch(config-classmap-c3)#match vlan 3001
Switch(config-classmap-c3)#exit
Switch(config)#policy-map p1
Switch(config-policymap-p1)#class c1
Switch(config-policymap-p1-class-c1)# set s-vid 1001
Switch(config-policymap-p1)#class c2
Switch(config-policymap-p1-class-c2)# set s-vid 2001
Switch(config-policymap-p1)#class c3
Switch(config-policymap-p1-class-c3)# set s-vid 3001
Switch(config-policymap-p1-class-c3)#exit
Switch(config-policymap-p1)#exit
Switch(config)#interface ethernet 1/0/1
Switch(config-if-ethernet1/0/1)#service-policy input p1
If the data flow of DSLAM2 enters the switch’s downlink port1, the configuration is as
follows:
4-4
QoS and Flow-based
Redirection Configuration Chapter 4 Flexible QinQ Configuration
Switch(config)#class-map c1
Switch(config-classmap-c1)#match vlan 1001
Switch(config-classmap-c1)#exit
Switch(config)#class-map c2
Switch(config-classmap-c2)#match vlan 2001
Switch(config-classmap-c2)#exit
Switch(config)#class-map c3
Switch(config-classmap-c3)#match vlan 3001
Switch(config-classmap-c3)#exit
Switch(config)#policy-map p1
Switch(config-policymap-p1)#class c1
Switch(config-policymap-p1-class-c1)# set s-vid 1002
Switch(config-policymap-p1)#class c2
Switch(config-policymap-p1-class-c2)# set s-vid 2002
Switch(config-policymap-p1)#class c3
Switch(config-policymap-p1-class-c3)# set s-vid 3002
Switch(config-policymap-p1-class-c3)#exit
Switch(config-policymap-p1)#exit
Switch(config)#interface ethernet 1/0/1
Switch(config-if-ethernet1/0/1)# service-policy input p1
If flexible QinQ policy can not be bound to the port, please check whether the problem
is caused by the following reasons:
Make sure flexible QinQ whether supports the configured class-map and policy-map
Make sure ACL includes permit rule if the class-map matches ACL rule
Make sure the switch exists enough TCAM resource to send the binding
Priority of flexible QinQ and vlan ingress filtering for processing packets is: flexible
QinQ > vlan ingress filtering
4-5