39
© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-1 Classification and Marking Configuring LAN Classification and Marking

Classification and Marking

  • Upload
    mali

  • View
    73

  • Download
    0

Embed Size (px)

DESCRIPTION

Classification and Marking. Configuring LAN Classification and Marking. LAN-Based Classification and Marking. Classification and marking should typically be performed as close to the source of the traffic as possible. - PowerPoint PPT Presentation

Citation preview

Page 1: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-1

Classification and Marking

Configuring LAN Classification and Marking

Page 2: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-2

LAN-Based Classification and Marking

• Classification and marking should typically be performed as close to the source of the traffic as possible.

• Defining trust boundaries is important when performing classification and marking in the LAN.

• For QoS marking transparency, mapping between Layer 2 and Layer 3 classification schemes must be accomplished.

• Cisco Catalyst switches have classification and marking capabilities and are ideal locations for performing these critical QoS functions.

• Classification and marking mechanisms of workgroup switches are based on DSCP and CoS, but compatibility with IP precedence can be achieved because DiffServ is backwards-compatible.

• Only ports that have been configured as ISL or 802.1Q trunks can carry Layer 2 CoS values.

Page 3: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-3

QoS Trust Boundaries in the LAN

Benefits of applying QoS at the edge of the network:• Provides the ability to classify and mark traffic immediately

• Minimizes upstream congestion

• Frees up router processing power

Page 4: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-4

QoS Trust Boundary in the LANClassify and Mark Where?

• Cisco QoS model assumes that the CoS carried in a frame may or may not be trusted by the network device.

• Classification should be done as close to the edge as possible.

• End hosts like user PCs can mostly not be trusted to tag a packet priority correctly.

Page 5: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-5

Connecting the IP Phone

• 802.1Q trunking between the switch and IP Phone for multiple VLAN support (separation of voice and data traffic) is preferred.

• The 802.1Q header contains the VLAN information and the CoS 3-bit field, which determines the priority of the packet.

• For most Cisco IP Phone configurations, traffic sent from the IP Phone to the switch is trusted to ensure that voice traffic is properly prioritized over other types of traffic in the network.

• The trusted boundary feature uses CDP to detect an IP Phone and otherwise disables the trusted setting on the switch port to prevent misuse of a high-priority queue.

Page 6: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-6

Classification and Marking onCatalyst Switches

6500 (PFC)

4500 (Sup II plus, III, IV,V) 3750 3550 , 3560 (2970) 2950

Trust

Capabilities

CoS

DSCP

IP Precedence

(Module-Dependent)

Extend Trust to IP Phone

CoS

DSCP

---

(Module

Dependent)

Extend Trust to IP Phone

CoS

DSCP

IP Precedence

IP Phone

Extend Trust to IP Phone

CoS

DSCP

IP Precedence

IP Phone

Extend Trust to IP Phone

CoS

DSCP

---

IP Phone

Extend Trust to IP Phone

CoS to DSCP and DSCP to CoS

Mapping TablesYes Yes Yes Yes Yes

IPP to DSCP Mapping Table Yes No Yes Yes No

DSCP Options (pass-thru, mutation)

Yes

Yes

(no mutation) Yes Yes

Yes

(no mutation)

ACL Yes Yes Yes Yes

Yes

(no port range)

Class-Based Markings Yes Yes Yes Yes Yes

Page 7: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-7

Classification and Marking onCatalyst 2950 Switches

• Port can be configured to trust CoS, DSCP, or Cisco IP Phone (default = untrusted)

• Has default CoS-to-DSCP and DSCP-to-CoS maps

• Can set the default CoS by port

• Can use class-based marking to set DSCP

• No VLAN-based classification

• Limited ACLs—no port range

Page 8: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-8

Catalyst Trust Boundary Options

Trust CoS incoming CoS --> cos-dscp map -> internal dscp -> dscp-cos map -> egress queue

| -> egress cos

| | -------------------------------------->

egress dscpTrust DSCPincoming dscp -> internal dscp -> dscp-cos map -> egress queue

| -> egress CoS|| -------------------------------------> egress dscp

Trust CoS (passthru DSCP)incoming CoS --> cos-dscp map -> internal dscp -> dscp-cos map -> egress queue

-> egress cos

incoming dscp -----------------------------------------------------------------------> egress dscp

4-123

Page 9: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-9

Catalyst 2950: Aggregate QoS Model

• QoS ACLs using Layer 2, 3, and 4 access control parameters

– Source/destination MAC address, 16-bit Ethertype, source/destination IP address, TCP/UDP source or destination port number

• QoS based on DSCP classification; Support for 13 widely used, well-known DSCP values (0, 8, 10, 16, 18, 24, 26, 32, 34, 40, 46, 48, and 56)

• CoS override per port

Page 10: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-10

Default QoS Configuration: Catalyst 2950 and 3550 Switches

Default QoS values:

• The default port CoS value is 0.

• The default port trust state is “untrusted.”

• The CoS value of 0 is assigned to all incoming packets (exception 2950: received CoS and DSCP markings are not overwritten on untrusted ports)

• Default CoS assignment to priority queues is:– CoS 6 to 7: Queue 4

– CoS 4 to 5: Queue 3

– CoS 2 to 3: Queue 2

– CoS 0 to 1: Queue 1

• Default CoS assignment can be altered during configuration.

Page 11: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-11

Mapping Tables: Catalyst 2950 and 3550 Switches

• During QoS processing, the switch represents the priority of all traffic (including non-IP traffic) with an internal DSCP value.

• During classification, QoS uses configurable mapping tables to derive the internal DSCP (a six-bit value) from received CoS value.

• Before the traffic reaches the scheduling stage, QoS uses the configurable DSCP-to-CoS map to derive a CoS value from the internal DSCP value.

Page 12: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-12

Mapping Tables Example 1:Life of a High-Priority (VoIP) Packet

Page 13: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-13

Mapping Tables Example 2:Life of a High-Priority (VoIP) Packet

mls qos trust dscp

Page 14: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-14

mls qos trust [cos [pass-through dscp] | device cisco-phone | dscp]

Switch(config-if)#

• Configures the port to trust state on an interface.

• When a port is configured with trust DSCP and the incoming packet is a tagged non-IP packet, the CoS value for the packet is set to 0, and the DSCP-to-CoS map is not applied.

• If DSCP is trusted, the DSCP field of the IP packet is not modified, but it is still possible that the CoS value of the packet is modified according to the DSCP-to-CoS map.

mls qos cos {default-cos | override}

Switch(config-if)#

• Defines the default CoS value of a port or assigns the default CoS to all incoming packets on the port.

Configuring Classification and Marking on Catalyst 2950 Switches

Page 15: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-15

mls qos map cos-dscp dscp1...dscp8mls qos map cos-dscp dscp1...dscp8

Switch(config)#

• Defines the CoS-to-DSCP mapping.

• For dscp1...dscp8, enter eight DSCP values that correspond to CoS values 0 to 7. Separate each DSCP value with a space.

• The supported DSCP values are 0, 8, 10, 16, 18, 24, 26, 32, 34, 40, 46, 48, and 56.

mls qos map dscp-cos dscp-list to cosmls qos map dscp-cos dscp-list to cos

Switch(config)#

• Defines the DSCP-to-CoS mapping.

• For dscp-list, enter up to 13 DSCP values separated by spaces. Then enter the to keyword. The supported DSCP values are 0, 8, 10, 16, 18, 24, 26, 32, 34, 40, 46, 48, and 56.

• For cos, enter the CoS value to which the DSCP values correspond. The CoS range is 0 to 7.

Configuring Classification and Marking on Catalyst 2950 Switches (Cont.)

Page 16: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-16

Configuring Classification and Marking on Catalyst 2950 Switches (Cont.)

Page 17: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-17

Classification and marking can also be performed using MQC (class maps and policy maps):

1. Create an IP standard or extended ACL for IP traffic, or a Layer 2 MAC ACL for non-IP traffic.

2. Create a class map and define the match criteria to classify traffic.

3. Create a service policy to perform the appropriate QoS action (mark, police, and so on).

4. Apply the service policy to a switch interface.

Configuring Classification and Marking on Catalyst 2950 Switches (Cont.)

Page 18: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-18

access-list access-list-number {deny | permit | remark} {source source-wildcard | host source | any}

Switch(config)#

• Configures a standard IP access control list that is based on source address only.

• The default standard ACL is always terminated by an implicit deny statement for all packets.

access-list access-list-number {deny | permit | remark} protocol {source source-wildcard | host source | any} [operator port] {destination destination-wildcard | host destination | any} [operator port] [dscp dscp-value] [time-range time-range-name]

Switch(config)#

• Configures an extended IP access control list that can be based on source, destination, port, DSCP value, or a time range.

• The default extended ACL is always terminated by an implicit deny statement for all packets.

Configuring Classification and Marking on Catalyst 2950 Switches (Cont.)

Page 19: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-19

class-map class-map-name

Switch(config)#

• Creates a class map to be used for matching packets.

• Only one match criterion per class map is supported. For example, when defining a class map, only one match command can be entered.

match {access-group acl-index | access-group name acl-name | ip dscp dscp-list}

Switch(config-cmap)#

• Defines the match criteria to classify traffic.

• Only IP access groups, MAC access groups, and classification based on DSCP values are supported.

Configuring Classification and Marking on Catalyst 2950 Switches (Cont.)

Page 20: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-20

policy-map policy-map-name

Switch(config)#

• Creates or modifies a policy map that can be attached to multiple interfaces

class class-map-name [access-group name acl-index-or-name]

Switch(config-pmap)#

• Defines a traffic classification for the policy to act on using the class-map name or access group

set ip dscp new-dscp

Switch(config-pmap-c)#

• Used to mark packets with a new DSCP value. Supported DSCP values are 0, 8, 10, 16, 18, 24, 26, 32, 34, 40, 46, 48, and 56

Configuring Classification and Marking on Catalyst 2950 Switches (Cont.)

Page 21: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-21

service-policy input policy-map-name

Switch(config-if)#

• Applies a policy map defined by the policy-map command to the input of a particular interface

mac access-list extended maclist1 permit host 0001.0000.0001 host 0002.0000.0001 !class-map macclass1 match access-group name maclist1 !policy-map macpolicy1 class macclass1 set ip dscp 26 !interface gigabitethernet0/1 switchport mode trunk mls qos trust cos service-policy input macpolicy1

Configuring Classification and Marking on Catalyst 2950 Switches (Cont.)

Page 22: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-22

Monitoring QoS onCatalyst 2950 Switches

show mls qos interface [interface-id] [policers]

Switch>

• Displays QoS information at the interface level

Switch> show mls qos interface fastethernet0/1

FastEthernet0/1 trust state:trust cos trust mode:trust cos COS override:dis default COS:0 pass-through:none trust device:cisco-phone

Page 23: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-23

Monitoring QoS onCatalyst 2950 Switches (Cont.)

show mls qos maps [cos-dscp | dscp-cos]

Switch>

• Displays QoS mapping information

Switch> show mls qos maps

Dscp-cos map: dscp: 0 8 10 16 18 24 26 32 34 40 46 48 56 ----------------------------------------------- cos: 0 1 1 2 2 3 3 4 4 5 5 6 7

Cos-dscp map: cos: 0 1 2 3 4 5 6 7 -------------------------------- dscp: 0 8 16 24 32 40 48 56

Page 24: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-24

Summary

• QoS classification and marking on workgroup switches are based on DiffServ and CoS. There must be mapping between Layer 2 and Layer 3.

• For most Cisco IP Phone configurations, the traffic sent from the telephone to the switch may be trusted to ensure that voice traffic is properly prioritized over other types of traffic in the network.

• Several types of classification and marking are available on Cisco Catalyst 6500, 4000, 3750, 3500, and 2950 switches.

• CoS-to-DSCP and DSCP-to-CoS mappings can be manually configured.

• QoS assigns the CoS value specified with mls qos cos interface configuration command to untagged frames received on trusted and untrusted ports.

• Use the show mls qos interface command to display general QoS information.

Page 25: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-25

Page 26: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-26

Congestion Management

Configuring LAN Congestion Management

Page 27: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-27

• Multiple queues protect the queue containing important traffic (voice) from drops.

• The number of queues available depends upon the switch model and port type.

• On some switches, “drop thresholds” can be assigned to each queue.

• On some switches, queues can have normal tail drop or WRED dropping.

• Drops happen in data-only queue(s).

Queuing on Catalyst Switches

Page 28: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-28

• Key queuing features depend upon the switch hardware:– The number of queues per port

– The type of queues (priority or standard)

– The capability to have drop thresholds for a queue

– The number of drop thresholds per queue

– The type of drop thresholds (tail drop or WRED)

• Switch queuing capabilities are shown as:– 2Q2T:

• Two queues

• Two drop thresholds for each queue

– 1P2Q2T:

• One priority queue

• Two additional queues

• Two drop thresholds for each queue

Queuing on Catalyst Switches (Cont.)

Page 29: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-29

Queuing on Catalyst Switches (Cont.)

& 3560

Page 30: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-30

Queuing on Catalyst Switches (Cont.)

Catalyst 2950 Switches• 4 transmit queues

(1P3Q or 4Q)

• Need to configure PQ and ensure that CoS 5 traffic is assigned to the PQ

– Configurable PQ for queue 4

– Configurable CoS to specific queue

– Configurable queue weight

Page 31: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-31

Weighted Round Robin

• WRR overcomes the problem of having PQ starving out the lower priority queues.

• WRR scheduling prevents queues with a lower weight from being completely starved during periods of heavy high-priority traffic.

• Different weights are assigned to each queue.

• For example, in one scheduling round, the WRR scheduler will transmit:

– Three frames from a queue assigned weight 3

– Four frames from a queue assigned weight 4

• WRR with an expedite queue: When WRR is configured on a Catalyst 2950, the option exists to configure queue 4 as a priority queue—an “expedite queue.”

Page 32: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-32

Configuring PQ on Catalyst 2950 Switches

wrr-queue cos-map quid cos1...cosn

Switch(config)#

• Assigns CoS values to CoS priority queues

• quid: Specifies the queue ID of the CoS priority queue. (Ranges are 1 to 4 where 1 is the lowest CoS priority queue.)

• cos1...cosn: Specifies the CoS values that are mapped to the queue ID.

• Default ID values are:

Queue ID CoS Values

1 0, 1

2 2, 3

3 4, 5

4 6, 7

Page 33: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-33

Configuring WRR on Catalyst 2950 Switches

wrr-queue bandwidth weight1...weight4

Switch(config)#

• Assigns WRR weights to the four egress queues

• Ranges for the WRR values:

– For weight1,weight2, and weight3, the range is 1 to 255.

– For weight4, the range is 0 to 255 (when weight4 is set to 0, queue 4 is configured as the expedite queue).

! Queueing Configuration is done globally on the Catalyst 2950! wrr-queue bandwidth 20 1 80 0 no wrr-queue cos-map wrr-queue cos-map 1 0 1 2 4 wrr-queue cos-map 3 3 6 7 wrr-queue cos-map 4 5!interface GigabitEthernet0/12

Page 34: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-34

Monitoring Queuing on Catalyst 2950 Switches

show mls qos maps [cos-dscp | dscp-cos]

Switch>

• Displays QoS mapping information.

• This command is available with enhanced software image switches.

Switch> show mls qos maps

Dscp-cos map: dscp: 0 8 10 16 18 24 26 32 34 40 46 48 56 ----------------------------------------------- cos: 0 1 1 2 2 3 3 4 4 5 5 6 7

Cos-dscp map: cos: 0 1 2 3 4 5 6 7 -------------------------------- dscp: 0 8 16 24 32 40 48 56

Page 35: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-35

Monitoring Queuing on Catalyst 2950 Switches (Cont.)

show wrr-queue cos-map

Switch>

• Displays the mapping of the CoS priority queues

show wrr-queue bandwidth

Switch>

• Displays the WRR bandwidth allocation for the CoS priority queues

Switch> show wrr-queue bandwidth WRR Queue : 1 2 3 4 Bandwidth : 10 20 30 40

Switch> show wrr-queue cos-map CoS Value : 0 1 2 3 4 5 6 7 Priority Queue : 1 1 2 2 3 3 4 4

Page 36: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-36

show mls qos interface [interface-id] [policers]

Switch>

• Displays QoS information at the interface level

Switch> show mls qos interface fastethernet0/1 FastEthernet0/1 trust state:trust cos trust mode:trust cos COS override:dis default COS:0 pass-through:none trust device:cisco-phone

Monitoring Queuing on Catalyst 2950 Switches (Cont.)

Page 37: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-37

Summary

• The number and capabilities of queues on Catalyst switches depend upon the model of the switch, supervisor, and line cards. PQ and WRR are the two queuing methods used for Catalyst switches. The use of PQ can starve lower-priority queues.

• With WRR, different weights are assigned to each queue. Use of WRR scheduling prevents the low-priority queues from being completely neglected during periods of high-priority traffic. On most Catalyst switches, a single priority queue can be configured with WRR to ensure priority dispatch of voice traffic.

• To configure CoS-to-queue mappings for PQ on the Catalyst 2950 switch, specify the queue ID of the CoS priority queue. (Ranges are 1 to 4 where 1 is the lowest CoS priority queue.) Then, specify the CoS values that are mapped to the queue ID. Use the wrr-queue cos-map quid cos1...cosn command.

Page 38: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-38

Summary (Cont.)

• The wrr-queue bandwidth global configuration command is used to assign WRR weights to the four CoS priority queues on the Catalyst 2950 switch.

• The show mls qos maps command is used to display QoS mapping information on the Catalyst 2950 switch.

Page 39: Classification and Marking

© 2006 Cisco Systems, Inc. All rights reserved. QoS v2.2—4-39