Quality of Service (QoS) configuration on Switch
Quality of Service (QoS) allows you to prioritize and manage network traffic to ensure that critical applications and services receive the necessary bandwidth and low latency while less important traffic is appropriately throttled. On Cisco switches, you can configure QoS using various techniques. Below are some commands to configure QoS on a Cisco switch, along with descriptions and a use case:
Use Case for QoS on a Switch: Imagine you have a Cisco switch in a network where both voice over IP (VoIP) traffic and regular data traffic share the same network infrastructure. You want to ensure that VoIP traffic receives higher priority and bandwidth to maintain call quality.
1. Access Configuration Mode:
- Description: Access the switch's command-line interface (CLI) and enter configuration mode.
bashSwitch> enable
Switch# configure terminal
2. Enable QoS Globally:
- Description: Enable QoS globally on the switch.
bashSwitch(config)# mls qos
3. Define QoS Class Maps:
- Description: Create class maps to classify traffic based on specific criteria, such as IP addresses, protocols, or access control lists (ACLs).
bashSwitch(config)# class-map match-all voip
Switch(config-cmap)# match ip dscp ef
- Example: In this example, a class map called "voip" is created to match traffic with a Differentiated Services Code Point (DSCP) value of "ef," which is typically used for VoIP traffic.
4. Create QoS Policy Maps:
- Description: Create policy maps to define QoS policies, including setting priority or bandwidth allocation for specific classes of traffic.
bashSwitch(config)# policy-map voip-policy
Switch(config-pmap)# class voip
Switch(config-pmap-c)# priority percent 30
Switch(config-pmap)# class class-default
Switch(config-pmap-c)# fair-queue
- Example: In this example, a policy map called "voip-policy" is created. It assigns 30% of the bandwidth to the "voip" class and uses a fair queuing algorithm for the "class-default" class, which includes all other traffic.
5. Apply the QoS Policy to Interfaces:
- Description: Apply the QoS policy map to the switch interfaces where you want to enforce QoS.
bashSwitch(config)# interface range GigabitEthernet0/1 - 24
Switch(config-if-range)# service-policy input voip-policy
- Example: This applies the "voip-policy" policy map to GigabitEthernet interfaces 0/1 through 0/24.
6. Verify the QoS Configuration:
- Description: To verify the QoS configuration on the switch, use the following commands:
bashSwitch# show mls qos
Switch# show policy-map interface GigabitEthernet0/1
- Description: These commands display information about the global QoS settings and the applied policy map on specific interfaces.
7. Save the Configuration:
- Description: After configuring QoS, be sure to save the configuration to the startup configuration to ensure it persists after a reboot.
bashSwitch# write memory
In this use case, QoS is configured on a Cisco switch to prioritize VoIP traffic over regular data traffic. This ensures that voice calls maintain acceptable quality, even when the network is under heavy load. QoS class maps and policy maps are used to classify and prioritize traffic, and these policies are applied to specific switch interfaces where VoIP traffic may traverse.
=======================================================
Basic QOS Configuration
1. Access Configuration Mode:
- Access the router's or switch's command-line interface (CLI) and enter configuration mode.
bashRouter> enable
Router# configure terminal
2. Enable QoS Globally:
- Enable QoS globally on the router or switch.
bashRouter(config)# mls qos
- Enabling QoS sets the stage for configuring QoS policies and mechanisms.
3. Define QoS Class Maps:
- Create class maps to classify traffic based on specific criteria, such as IP addresses, protocols, or access control lists (ACLs).
bashRouter(config)# class-map match-all voip
Router(config-cmap)# match ip dscp ef
- In this example, a class map named "voip" is created to match traffic with a Differentiated Services Code Point (DSCP) value of "ef," which is typically used for VoIP traffic.
4. Create QoS Policy Maps:
- Create policy maps to define QoS policies, including setting priority or bandwidth allocation for specific classes of traffic.
bashRouter(config)# policy-map voip-policy
Router(config-pmap)# class voip
Router(config-pmap-c)# priority percent 30
Router(config-pmap)# class class-default
Router(config-pmap-c)# fair-queue
- In this example, a policy map named "voip-policy" is created. It assigns 30% of the bandwidth to the "voip" class and uses a fair queuing algorithm for the "class-default" class, which includes all other traffic.
5. Apply the QoS Policy to Interfaces:
- Apply the QoS policy map to the router or switch interfaces where you want to enforce QoS.
bashRouter(config)# interface GigabitEthernet0/0
Router(config-if)# service-policy input voip-policy
- This applies the "voip-policy" policy map to the GigabitEthernet0/0 interface.
6. Verify the QoS Configuration:
- To verify the QoS configuration on the router or switch, use the following commands:
bashRouter# show mls qos
Router# show policy-map interface GigabitEthernet0/0
- These commands display information about the global QoS settings and the applied policy map on specific interfaces.
7. Save the Configuration:
- After configuring QoS, save the configuration to the startup configuration to ensure it persists after a reboot.
bashRouter# write memory
Basic QoS configurations like the one outlined above help ensure that critical traffic, such as VoIP, receives the necessary resources and priority on the network.
===========================================================
Auto QOS
To configure and verify Auto-QoS on a Cisco Catalyst 2960 switch, you can follow these steps:
Configuration Steps:
Access Configuration Mode:
- Access the switch's command-line interface (CLI) and enter configuration mode.
bashSwitch> enable Switch# configure terminalEnable Auto-QoS:
- Enable Auto-QoS globally on the switch.
bashSwitch(config)# auto qos voip trust- This command tells the switch to trust incoming QoS markings on VoIP traffic, which is a common practice to ensure that voice traffic is properly prioritized.
Apply Auto-QoS to an Interface:
- Apply Auto-QoS to the specific interface where you want to enable it. This is typically done on interfaces connected to VoIP phones.
bashSwitch(config-if)# interface interface_type interface_number Switch(config-if)# auto qos voip cisco-phone- The
auto qos voip cisco-phonecommand enables Auto-QoS for VoIP traffic from Cisco IP phones. You can use other options likeauto qos voip trustfor non-Cisco devices.
Verify the Auto-QoS Configuration:
- To verify the Auto-QoS configuration on the switch, use the following commands:
bashSwitch# show auto qos Switch# show interfaces interface_type interface_number- These commands display information about the Auto-QoS settings and the interface-specific QoS configurations.
Verification Steps:
After configuring Auto-QoS, you can verify its operation to ensure that it is correctly prioritizing VoIP traffic. Here's how to do that:
Check QoS Settings on an Interface:
- Use the following command to check the QoS settings on an interface:
bashSwitch# show interfaces interface_type interface_number switchport- Look for the "trust" setting in the output, which indicates that Auto-QoS is enabled and trusting QoS markings from incoming traffic.
Verify Queue Statistics:
- Check the queue statistics to see how traffic is being classified and queued:
bashSwitch# show platform hardware qfp active feature qos interface interface_type interface_number- This command displays statistics related to packet classification and queuing on the interface.
Monitor Traffic and QoS Markings:
- Monitor the traffic on the interface to see how QoS markings are applied to packets:
bashSwitch# show mls qos interface interface_type interface_number statistics- This command displays statistics related to QoS markings and traffic on the interface.
By configuring and verifying Auto-QoS on a Cisco Catalyst 2960 switch, you can simplify the QoS configuration process and ensure that VoIP traffic is properly prioritized for optimal network performance.
Comments
Post a Comment