C H A P T E R  24

Configuring Differentiated Services

This chapter describes how to configure Differentiated Services (DiffServ).

This chapter contains the following topics:


Understanding Differentiated Services (DiffServ)

Differentiated Services (DiffServ) is one technique for implementing Quality of Service (QoS) policies. Using DiffServ in your network allows you to directly configure the relevant parameters on the switches and routers rather than using a resource reservation protocol.This section explains how to configure the Sun Netra CP3240 switch to identify which traffic class a packet belongs to, and how it should be handled to provide the desired quality of service. As implemented on the Sun Netra CP3240 switch, DiffServ allows you to control what traffic is accepted and what traffic is discarded.

Traffic to be processed by the DiffServ feature requires an IP header if the system uses IP Precedence or IP DSCP marking.

How you configure DiffServ support on a Sun Netra CP3240 switch varies depending on the role of the switch in your network:

Before configuring DiffServ on a particular Sun Netra CP3240 switch, you must determine the QoS requirements for the network as a whole. The requirements are expressed in terms of rules, which are used to classify inbound traffic on a particular interface. FASTPATH does not support DiffServ in the outbound direction.

During configuration, you define DiffServ rules in terms of classes, policies and services:


Configuring Differentiated Services via CLI

This example shows how a network administrator can provide equal access to the Internet (or other external network) to different departments within a company. Each of four departments has its own Class B subnet that is allocated 25% of the available bandwidth on the port accessing the Internet.

FIGURE 24-1 DiffServ Internet Access Example Network Diagram


Enabling DiffServ Inbound

Ensure DiffServ operation is enabled for the switch.


config
  diffserv

Create a DiffServ class of type “all” for each of the departments, and name them. Define the match criteria -- Source IP address -- for the new classes.


CODE EXAMPLE 24-1 Creating a Diffserv Class Type All
class-map match-all finance_dept
 match srcip 172.16.10.0 255.255.255.0
exit
 
class-map match-all marketing_dept
 match srcip 172.16.20.0 255.255.255.0
exit
 
class-map match-all test_dept
 match srcip 172.16.30.0 255.255.255.0
exit
 
class-map match-all development_dept
 match srcip 172.16.40.0 255.255.255.0
exit

Create a DiffServ policy for inbound traffic named 'internet_access', adding the previously created department classes as instances within this policy.

This policy uses the assign-queue attribute to put each department's traffic on a different egress queue. This is how the DiffServ inbound policy connects to the CoS queue settings established in the following example.


CODE EXAMPLE 24-2 Creating a Diffserv Policy for Inbound Traffic
policy-map internet_access in
 class finance_dept
   assign-queue 1
 exit
 class marketing_dept
   assign-queue 2
 exit
 class test_dept
   assign-queue 3
 exit
 class development_dept
   assign-queue 4
 exit
exit

Configuring DiffServ on FASTPATH Software

Attach the defined policy to interfaces 1/0/1 through 1/0/4 in the inbound direction


CODE EXAMPLE 24-3 Attaching the Policy to Interfaces
interface 1/0/1
 service-policy in internet_access
exit
interface 1/0/2
 service-policy in internet_access
exit
interface 1/0/3
 service-policy in internet_access
exit
interface 1/0/4
 service-policy in internet_access
exit

Set the CoS queue configuration for the (presumed) egress interface 1/0/5 such that each of queues 1, 2, 3 and 4 get a minimum guaranteed bandwidth of 25%. All queues for this interface use weighted round robin scheduling by default. The DiffServ inbound policy designates that these queues are to be used for the departmental traffic through the assign-queue attribute. It is presumed that the switch will forward this traffic to interface 1/0/5 based on a normal destination address lookup for internet traffic.


CODE EXAMPLE 24-4 Setting CoS Queue for Egress
interface 1/0/5
 cos-queue min-bandwidth 0 25 25 25 25 0 0
exit
exit


Configuring Differentiated Services via Web Interface

Use the following screens to perform the same configuration using the Graphical User Interface:

FIGURE 24-2 DiffServ Configuration


FIGURE 24-3 \DiffServ Class Configuration


FIGURE 24-4 DiffServ Class Configuration


FIGURE 24-5 Source IP Address


FIGURE 24-6 DiffServ Class Configuration


FIGURE 24-7 DiffServ Class Summary


FIGURE 24-8 DiffServ Policy Configuration


FIGURE 24-9 DiffServ Policy Configuration


FIGURE 24-10 DiffServ Policy Class Definition


FIGURE 24-11 Assign Queue


FIGURE 24-12 DiffServ Policy Attribute Summary


FIGURE 24-13 DiffServ Policy Attribute Summary


FIGURE 24-14 DiffServ Service Configuration


FIGURE 24-15 DiffServ Service Summary

FIGURE 24-16 DiffServ VoIP Example Network Diagram



Configuring DiffServ for Voice Over IP (VoIP)

One of the most valuable uses of DiffServ is to support Voice over IP (VoIP). VoIP traffic is inherently time-sensitive: for a network to provide acceptable service, a guaranteed transmission rate is vital. This example shows one way to provide the necessary quality of service: how to set up a class for UDP traffic, have that traffic marked on the inbound side, and then expedite the traffic on the outbound side. The configuration script is for Router 1 in the accompanying diagram: a similar script should be applied to Router 2.


Enter Global Config mode. Set queue 5 on all ports to use strict priority mode. This queue shall be used for all VoIP packets. Activate DiffServ for the switch.


CODE EXAMPLE 24-5 Setting Queue on All Ports
config 
  cos-queue strict 5  
  diffserv 

Create a DiffServ classifier named 'class_voip' and define a single match criterion to detect UDP packets. The class type "match-all" indicates that all match criteria defined for the class must be satisfied in order for a packet to be considered a match.


CODE EXAMPLE 24-6 Creating a Diffserv Classifier
class-map match-all class_voip
 match protocol udp
exit

Create a second DiffServ classifier named 'class_ef' and define a single match criterion to detect a DiffServ code point (DSCP) of 'EF' (expedited forwarding). This handles incoming traffic that was previously marked as expedited elsewhere in the network.


CODE EXAMPLE 24-7 Creating a Second Diffserv Classifier
class-map match-all class_ef
 match ip dscp ef
exit

Create a DiffServ policy for inbound traffic named 'pol_voip', then add the previously created classes 'class_ef' and 'class_voip' as instances within this policy.

This policy handles incoming packets already marked with a DSCP value of 'EF' (per 'class_ef' definition), or marks UDP packets per the 'class_voip' definition) with a DSCP value of 'EF'. In each case, the matching packets are assigned internally to use queue 5 of the egress port to which they are forwarded.


CODE EXAMPLE 24-8 Creating a Diffserv Policy
policy-map pol_voip in
 class class_ef
   assign-queue 5
 exit
 class class_voip
   mark ip-dscp ef
   assign-queue 5
 exit
exit

Attach the defined policy to an inbound service interface.


CODE EXAMPLE 24-9 Attaching the Policy to Inbound Interface
interface 1/0/2
 service-policy in pol_voip
exit
exit