Configuring CoS for Traffic Processed by a Services PIC (Next Gen Services)
Configuring CoS Rules
- Configure a name for the CoS rule.user@host# edit services cos rule rule-name
- Specify the traffic flow direction for the CoS rule.[edit services cos rule rule-name]user@host# set match-direction (input | input-output | output)
If this CoS rule is applied to an interface-type service set, the direction is determined by whether a packet is entering or leaving the interface on which the service set is applied. If this CoS rule is applied to a next-hop service set, the direction is input if the inside interface is used to route the packet, and the direction is output if the outside interface is used to route the package.
If you configure input-output, the rule is applied to sessions initiated from either direction.
- Configure a name for a CoS rule policy. [edit services cos rule rule-name]user@host# set policy policy-name
You can configure multiple policies for a CoS rule. Each policy identifies the matching conditions for packet source and destination addresses and for packet applications, and the CoS actions to take on those packets. Once a policy in the rule matches a packet, that policy is applied and no other policies in the rule are processed.
- Specify one or more port-based applications that match
the policy.[edit services cos rule rule-name policy policy-name]user@host# set match application [application-names]
- Specify the destination address that matches the policy.[edit services cos rule rule-name policy policy-name]user@host# set match destination-address address
- Specify a range of destination addresses that match the
policy.[edit services cos rule rule-name policy policy-name]user@host# set match destination-address-range low minimum-value high maximum-value
- Specify the destination port number that matches the policy.[edit services cos rule rule-name policy policy-name]user@host# set match destination-port port-number
- Specify the source address that matches the policy.[edit services cos rule rule-name policy policy-name]user@host# set match source-address address
- Specify a range of source addresses that match the policy.[edit services cos rule rule-name policy policy-name]user@host# set match source-address-range low minimum-value high maximum-value
- Specify a prefix list of source address prefixes that
match the policy.[edit services cos rule rule-name policy policy-name]user@host# set match source-prefix-list list-name
You configure a prefix list by using the prefix-list statement at the [edit policy-options] hierarchy level.
- Specify the application profile that defines the CoS policy
actions for FTP and SIP traffic.[edit services cos rule rule-name policy policy-name]user@host# set then application-profile profile-name
- Specify the DSCP value to apply to the packet.[edit services cos rule rule-name policy policy-name]user@host# set then dscp (alias | bits)
The DSCP can be either a code point alias or a DSCP bit value.
- Specify the forwarding class name to apply to the packet.[edit services cos rule rule-name policy policy-name]user@host# set then forwarding-class class-name
The choices are:
assured-forwarding
best-effort
expedited-forwarding
network-control
user-defined classifiers.
You can define classifiers under [edit class-of-service classifiers dscp] hierarchy.
- Configure system logging for the CoS rule policy.
- Specify the treatment of flows in the reverse direction
of the matching direction. Perform only one of the following:
- Configure unique values for the reverse direction:[edit services cos rule rule-name policy policy-name]user@host# set then reverse application-profile profile-nameuser@host# set then reverse dscp (alias | bits)user@host# set then reverse forwarding-class class-name
- Apply the CoS rule policy actions to flows in the reverse
direction as well as to flows in the matching direction.[edit services cos rule rule-name policy policy-name]user@host# set then reflexive
- Store the DSCP and forwarding class of a packet that is
received in the match direction of the rule and then apply that DSCP
and forwarding class to packets that are received in the reverse direction
of the same session.[edit services cos rule rule-name policy policy-name]user@host# set then revert
- Configure unique values for the reverse direction:
Configuring Application Profiles for CoS Rules
Configure CoS actions for FTP and SIP traffic. The application profile can then be used in CoS rule actions.
- Configure a name for the application profile.user@host# edit services cos application-profile profile-name
- Specify the DSCP value to apply to the FTP or SIP (voice
or video) packets.
For FTP traffic:
For SIP voice or video traffic:
The DSCP can be either a code point alias or a DSCP bit value.
- Specify the forwarding class to apply to FTP or SIP packets.
For FTP traffic:
[edit services cos application-profile profile-name]For SIP voice or video traffic:
[edit services cos application-profile profile-name]The choices are:
assured-forwarding
best-effort
expedited-forwarding
network-control
Configuring CoS Rule Sets
A CoS rule set lets you specify a set of services CoS rules. You can then assign the rule set to a service set, which processes the rules in the order they appear. Once a rule matches the packet, the router performs the corresponding action, and no further rules in the rule set are applied.
- Configure a name for the CoS rule set.user@host# edit services cos rule-set rule-set-name
- Specify the CoS rules that belong to the rule set.[edit services cos rule-set rule-set-name]user@host# set rule [rule-name]
Configuring the Service Set for CoS
You must apply CoS rules to a service set before the rules can be applied to traffic. Only stateful firewall and NAT rules can be used with CoS rules in a service set.
To configure a service set with CoS rules:
- Define the service set.[edit services]user@host# edit service-set service-set-name
- Configure either an interface service set, which requires
a single service interface, or a next-hop service set, which requires
an inside and outside service interface.[edit services service-set service-set-name]user@host# set interface-service service-interface interface-name
or
[edit services service-set service-set-name]user@host# set next-hop-service inside-service-interface interface-name outside-service-interface interface-name - Specify the CoS rules to be used with the service set.
You can either specify individual rules or rule sets.
To apply individual CoS rules:
[edit services service-set service-set-name]user@host# set cos-rules [cos-rule-name]To apply CoS rule sets:
[edit services service-set service-set-name]user@host# set cos-rule-sets [cos-rule-set-name]The service set processes the CoS rules or rule sets in the order in which they appear in the service set configuration.
- (Optional) Assign at least one stateful firewall rule or NAT rule to the service set.
- (Optional) Configure the service set to create a CoS session
even if a packet is first received in the reverse direction of the
matching direction of the CoS rule. The CoS rule values are then applied
as soon as a packet in the correct match direction is received.[edit services service-set service-set-name]user@host# set cos-options match-rules-on-reverse-flow