Supported Platforms
Configuring a Global Class of Service Profile for the Broadband Subscriber Management Solution
Junos OS CoS enables you to divide traffic into classes and offer various levels of throughput and packet loss (when congestion occurs) in accordance to service rules that you specify. The Junos OS CoS features provide a set of mechanisms that you can use to provide differentiated (video, voice, and data) services over the same network for subscribers.
Configuring a Class of Service Profile
You can configure class of service (CoS) for all subscribers that successfully establish connection to the broadband network. After you create the CoS profile, you can attach it to subscriber interfaces using a dynamic profile.
Configuring a CoS profile includes the following general steps:
- Configuring forwarding classes.
- Configuring schedulers.
- Configuring scheduler maps.
- Configuring classifiers.
- Configuring CoS interface properties.
In the configuration we build in this section, we configure three forwarding classes, each with its own scheduler, and an IP precedence classifier for the traffic destined for the access network. Table 1 provides an overview of the queue configuration:
Table 1: Class of Service Queue Configuration
Differentiated Services Classification | Bandwidth | Priority | Purpose |
---|---|---|---|
Expedited forwarding (EF) | 128 Kbps | strict high | voice traffic |
Assured forwarding (AF) | 29.4 Mbps | low | video traffic |
Best effort (BE) | remainder | low | data traffic |
![]() | Note: The network control forwarding class is not configured in this solution. |
Configuring CoS Fowarding Classes
Forwarding classes identify output queues for packets. For a classifier to assign an output queue to each packet, it must associate the packet with one of the following forwarding classes:
- Expedited forwarding (EF)—Provides a low loss, low latency, low jitter, assured bandwidth, end-to-end service.
- Assured forwarding (AF)—Provides a group of values you can define and includes four subclasses: AF1, AF2, AF3, and AF4, each with three drop probabilities: low, medium, and high.
- Best effort (BE)—Provides no service profile. For the BE forwarding class, loss priority is typically not carried in a class-of-service (CoS) value, and random early detection (RED) drop profiles are more aggressive.
- Network control (NC)—This class is typically high priority because it supports protocol control.
![]() | Note: The MX Series router enables you to configure up to eight forwarding class queues. |
To configure forwarding class queues:
- Edit the best effort queue.[edit]user@host# edit class-of-service forwarding-classes queue 0
- Name the queue.[edit class-of-service forwarding-classes queue 0]user@host# set fc_be
- Edit the expedited forwarding queue.[edit]user@host# edit class-of-service forwarding-classes queue 1
- Name the queue.[edit class-of-service forwarding-classes queue 1]user@host# set fc_ef
- Edit the assured forwarding queue.[edit]user@host# edit class-of-service forwarding-classes queue 2
- Name the queue.[edit class-of-service forwarding-classes queue 1]user@host# set fc_af
Configuring CoS Schedulers
CoS schedulers define the properties of output queues. These properties can include the amount of interface bandwidth assigned to the queue, the size of the memory buffer allocated for storing packets, the priority of the queue, and the random early detection (RED) drop profiles associated with the queue.
To configure CoS schedulers for the existing queues:
- Create a scheduler and name it for the best effort traffic.[edit]user@host# edit class-of-service schedulers sched_be
- Define the best effort scheduler buffer size.[edit class-of-service schedulers sched_be]user@host# set buffer-size remainder
- Set the priority of the best effort scheduler.[edit class-of-service schedulers sched_be]user@host# set priority low
- Create a scheduler and name it for the expedited forwarding
traffic.[edit]user@host# edit class-of-service schedulers sched_ef
- Configure the transmit rate for the expedited forwarding
scheduler.[edit class-of-service schedulers sched_ef]user@host# set transmit-rate 128k
- Define the expedited forwarding scheduler buffer size.[edit class-of-service schedulers sched_ef]user@host# set buffer-size remainder
- Set the priority of the expedited forwarding scheduler.[edit class-of-service schedulers sched_ef]user@host# set priority strict-high
- Create a scheduler and name it for the assured forwarding
traffic.[edit]user@host# edit class-of-service schedulers sched_af
- Configure the transmit rate for the assured forwarding
scheduler.[edit class-of-service schedulers sched_af]user@host# set transmit-rate 29400000
- Define the assured forwarding scheduler buffer size.[edit class-of-service schedulers sched_af]user@host# set buffer-size remainder
- Set the priority of the expedited forwarding scheduler.[edit class-of-service schedulers sched_af]user@host# set priority low
Configuring Scheduler Maps
After configuring both CoS forwarding classes and schedulers, you must use scheduler maps to associate them.
To map CoS forwarding classes to schedulers:
- Create a forwarding map and name it.[edit]user@host# edit class-of-service scheduler-maps SchedulerMap_Triple_Play_Basic
- Edit the best effort forwarding class queue.[edit class-of-service scheduler-maps SchedulerMap_Triple_Play_Basic]user@host# edit forwarding-class fc_be
- Associate the scheduler that you want this forwarding
class to use.[edit class-of-service scheduler-maps SchedulerMap_Triple_Play_Basic forwarding-class fc_be]user@host# set scheduler sched_be
- Edit the expedited forwarding class
queue.[edit class-of-service scheduler-maps SchedulerMap_Triple_Play_Basic]user@host# edit forwarding-class fc_ef
- Associate the scheduler that you want this forwarding
class to use.[edit class-of-service scheduler-maps SchedulerMap_Triple_Play_Basic forwarding-class fc_ef]user@host# set scheduler sched_ef
- Edit the assured forwarding class
queue.[edit class-of-service scheduler-maps SchedulerMap_Triple_Play_Basic]user@host# edit forwarding-class fc_af
- Associate the scheduler that you want this forwarding
class to use.[edit class-of-service scheduler-maps SchedulerMap_Triple_Play_Basic forwarding-class fc_af]user@host# set scheduler sched_af
Configuring CoS Classifiers
You can override the default IP precedence classifier by defining a custom classifier. You can then apply the classifier to a logical interface.
To define a custom CoS classifier:
- Create a Differentiated Services code point (DSCP) classifier
and name it.[edit]user@host# edit class-of-service classifiers dscp Class_DSCP
Note: DSCP classifiers handle incoming IPv4 packets.
- Edit the best effort forwarding class queue.[edit class-of-service classifiers dscp Class_DSCP]user@host# edit forwarding-class fc_be
- Edit the loss priority level for the forwarding class
queue.[edit class-of-service classifiers dscp Class_DSCP forwarding-class fc_be]user@host# edit loss-priority high
- Set code points for the loss priority level.[edit class-of-service classifiers dscp Class_DSCP forwarding-class fc_be loss-priority low]user@host# set code-points be
- Edit the expedited forwarding class queue.[edit class-of-service classifiers dscp Class_DSCP]user@host# edit forwarding-class fc_ef
- Edit the loss priority level for the forwarding class
queue.[edit class-of-service classifiers dscp Class_DSCP forwarding-class fc_ef]user@host# edit loss-priority low
- Set code points for the loss priority level.[edit class-of-service classifiers dscp Class_DSCP forwarding-class fc_ef loss-priority low]user@host# set code-points ef
- Edit the assured forwarding class queue.[edit class-of-service classifiers dscp Class_DSCP]user@host# edit forwarding-class fc_af
- Edit the loss priority level for the forwarding class
queue.[edit class-of-service classifiers dscp Class_DSCP forwarding-class fc_af]user@host# edit loss-priority low
- Set code points for the loss priority level.[edit class-of-service classifiers dscp Class_DSCP forwarding-class fc_af loss-priority low]user@host# set code-points af41
Configuring CoS Interface Properties
Configuring CoS interface properties enables the router to throttle and classify the traffic from the Internet that is sent to subscriber local loops. Limiting the traffic to the access network ensures that the traffic sent to the subscriber local loops does not exceed the current data transmission rate of those lines. Limiting traffic also ensures that changes to subscriber local loop speeds do not cause bandwidth contention at the subscriber’s residential gateway. You apply the classifier to the core-facing interface to classify incoming traffic for the queues you are using in the access network.
To configure CoS interfaces:
- Edit the core CoS interface you want to configure.[edit]user@host# edit class-of-service interfaces ge-1/3/0
- Edit the interface shaping rate.[edit class-of-service interfaces ge-1/3/0]user@host# edit class-of-service interfaces ge-1/3/0 shaping-rate
- Set the shaping rate value to throttle traffic to the
subscriber local loops.[edit class-of-service interfaces ge-1/3/0 shaping-rate]user@host# set 500m
- Edit the interface connected to the core network.[edit]user@host# edit class-of-service interfaces ge-1/3/1
- Edit the interface unit.[edit class-of-service interfaces ge-1/3/1]user@host# edit unit 0
- Edit the interface unit classifiers.[edit class-of-service interfaces ge-1/3/1 unit 0]user@host# edit classifiers
- Apply the classifier to the interface to classify traffic
coming from the Internet.[edit class-of-service interfaces ge-1/3/1 unit 0 classifiers]user@host# set dscp Class_DSCP