0% found this document useful (0 votes)
117 views28 pages

Packet Classification

Multifield classification allows for more granular control over packet classification than fixed classification. With multifield classification, packets can be classified based on matching fields in the packet header, such as source IP address, destination IP address, protocol, source port, or destination port. This allows packets to be assigned to specific forwarding classes and queues based on the values of multiple fields in the packet.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views28 pages

Packet Classification

Multifield classification allows for more granular control over packet classification than fixed classification. With multifield classification, packets can be classified based on matching fields in the packet header, such as source IP address, destination IP address, protocol, source port, or destination port. This allows packets to be assigned to specific forwarding classes and queues based on the values of multiple fields in the packet.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

<CourseClassification

Packet Title>
Packet Classification

CoS Processing—Packet Classification


Classification is the first step in the class of service (CoS) process. As packets arrive at a Junos
device, they can be put into different queues to receive different treatment as they flow through the
device, and different priority as they egress the device.

2 www.juniper.net
Packet Classification

Role of Packet Classification


The primary function of packet classification is to examine traffic as it enters the Junos device.
Based on a variety of parameters, the device can separate the packets into different classes of
traffic and place the packets into queues. Packets are also assigned to a forwarding class and can
be given a packet loss priority value.

www.juniper.net 3
Packet Classification

Junos Classification Methods


Junos devices support the three methods of packet classification shown on the slide. We discuss
these three methods throughout this material.

4 www.juniper.net
Packet Classification

Forwarding Classes
The main function of forwarding classes is to determine the queue to which a packet is assigned. As
a packet enters a Junos device and passes through multifield or behavior aggregate classification,
the device assigns it to a forwarding class. In actuality, the device is placing the packet in a queue.
You can think of forwarding classes as the configuration component that represents the queues.

www.juniper.net 5
Packet Classification

Four Default Forwarding Classes


The default CoS settings on Junos devices include four default forwarding classes, as shown on the
slide. Notice in the CLI output how forwarding classes and queues are directly related.

6 www.juniper.net
Packet Classification

Configuring Custom Forwarding Classes


Four default forwarding classes often are sufficient to support a CoS strategy. However, you might
find that the four default classes are not enough, and that you require more forwarding classes. Or
perhaps you want to change the names of the existing classes.
The slide shows the syntax to configure custom forwarding classes. You can use this configuration to
create custom names for the existing classes (and leave the queue mappings untouched), or you can
create custom forwarding classes and create new mappings to queues.
On some Junos devices, you can create more forwarding classes than queues. In this situation, you
assign multiple forwarding classes to a single queue.
Note that forwarding classes are a global configuration component; the settings in this section apply
to the entire device.

Platform Support
The number of forwarding classes and queues supported varies depending on which Junos device
you are using. The slide provides the details.

www.juniper.net 7
Packet Classification

Loss Priority
Packet loss priority (PLP), also known as drop precedence, identifies a given packet’s drop-eligibility.
In other words, it determines the likelihood that a packet will be dropped under congestion. It is
important to note that having a PLP value assigned does not automatically mean that the packet will
be dropped. The PLP provides you with the option to specify that if the device experiences congestion
later in the CoS process, it should drop the packets marked with a higher PLP first.
A Junos device can assign a loss priority value (PLP) to a packet as the packet enters the device
using a multifield or behavior aggregate classifier. A policer can also assign the value sightly later in
the CoS process.
The Junos OS allows you to assign up to four PLP values to inbound traffic: low, medium-low,
medium-high, and high. By default, the system uses only low and high.

8 www.juniper.net
Packet Classification

Part of a Congestion Control Strategy


PLP can be very helpful when building a strategy to control traffic when congestion occurs. When a
device becomes congested you want to ensure that you have ways of specifying which traffic to drop,
and one of the easiest ways to do this is using PLP values. PLP allows you to specify at ingress the
relative importance of given traffic flows, which provides you with options to control which traffic is
dropped should the device become congested.

Note
When using Juniper Networks M320
Multiservice Edge Routers, Juniper Networks MX
Series 3D Universal Edge Routers, or Juniper
Networks T Series Core Routers, and you do not
have tricolor marking enabled (which is
reasonably likely), you must configure PLP within
a multifield classifier.

www.juniper.net 9
Packet Classification

Default Loss Priority Values Depend on CoS Value


By default on a Junos device, the default classifier sets the PLP value based on the least significant
bit of an incoming packet’s CoS field. If the CoS field ends with a 0, the PLP is set to low; if the CoS
field ends with a 1, the PLP is set to high.
The CLI example on the slide shows the default classifier used by Junos devices (we discuss
classifiers later). Notice how the loss priority value relates to the code point setting, following the 0 =
low, 1 = high rule.
Note that these are default values, which you are welcome to alter as you desire, using BA or MF
classifiers, or a policer.

10 www.juniper.net
Packet Classification

Fixed Classification—”All or Nothing” Method


The simplest way to classify incoming packets is to use fixed classification. With fixed classification,
you assign a single forwarding class to a logical interface or VLAN (under the class-of-service
stanza). The device assigns all traffic arriving at that interface to the defined forwarding class, and by
extension to the related queue.
Fixed classification can be a good approach when you specifically want to assign all inbound traffic
from a neighbor to a specific forwarding class and queue. For example, perhaps you have a customer
attached to a given port, and all of that customer’s traffic should be treated in a specific way. Fixed
classification provides the easiest way to complete this task.
While fixed classification is simple and efficient, it has no granularity. If you require any
differentiation of traffic ingressing the interface, fixed classification will not meet your needs.

www.juniper.net 11
Packet Classification

Multifield Classification—Granular Method


When you need granular control to apply CoS values to inbound traffic, use multifield classification.
MF classification allows you to match against a variety of fields in a packet header—a source IP
address, for example. When packets arriving on a given logical interface or VLAN match against the
desired parameters, the device can assign a specific forwarding class and PLP value.

MF Application Examples
The slide provides some examples of where multifield classification can be helpful.

12 www.juniper.net
Packet Classification

MF Classification Uses Firewall Filters


Junos devices use standard firewall filters to perform MF classification. Firewall filters provide very
granular control, allowing you to match against many fields in a packet header.
The configuration process is the same as if you were performing firewall filtering: create a firewall
filter, and then apply it to an interface. In the example on the slide, traffic arriving at interface ge-0/
0/1.0 passes through a filter named apply-cos-markings. Where this filter differs from a
standard firewall filter is within term A. The term’s then statement includes a modifying action that
assigns the matching traffic to a specific forwarding class. Traffic not matching this term is still
accepted (by the next term), but it does not receive any CoS treatment.

Note
Traffic that does not explicitly receive CoS
treatment from the device is assigned to the
best-effort forwarding class.

www.juniper.net 13
Packet Classification

Apply MF Classification at Network Ingress


In general, the best place to use MF classification is at the network edge. In general, you should
consider traffic that comes from another network untrusted, and as you have little or no control over
it, you cannot rely on any existing CoS values on the traffic. The network edge is also a logical place
to make use of the granular controls provided by firewall filters, allowing you to collect broad or
narrow amounts of traffic and assign them very specifically to forwarding classes and queues.

14 www.juniper.net
Packet Classification

PE1 Configuration Sample


The command output in the slide shows the relevant configuration components for the PE1 device in
the diagram on the previous page. In step 1, the firewall filter contains three terms, two of which
contain modifying actions that assign matching traffic to the expedited-forwarding forwarding
class. In step 2, the filter is applied to the fe-1/1/1 interface in the inbound direction.

www.juniper.net 15
Packet Classification

Behavior Aggregate Classification—CoS Marking-Based Method


When traffic coming from a neighboring node already has CoS markings, you can use BA
classification. BA classification can be applied per logical interface or VLAN, and it provides a simple
way to directly map a marked packet to a forwarding class and PLP value.
BA classification is more efficient than MF classification because it requires less packet analysis.
The efficiency benefit makes BA classification a good choice for devices with high traffic volumes,
such as routers in a network core.
BA classification is based entirely on existing CoS markings. It treats all traffic with a given CoS value
in the same way; that is, the Junos device assigns all inbound traffic with a given CoS marking to the
same forwarding class and queue.

BA Application Examples
The slide provides some examples of where multifield classification can be helpful.

16 www.juniper.net
Packet Classification

BA Classifiers Match Against Several Incoming CoS Markings


The slide lists the CoS types you can match against when using BA classification.

www.juniper.net 17
Packet Classification

Primary Default BA Classifier


BA classifiers, in their simplest form, are mappings of code points to forwarding classes and PLP
values. The Junos OS provides several default classifiers, but by default all logical interfaces use an
IP precedence classifier named ipprec-compatibility. This classifier provides basic
capabilities, with only best-effort and network-control forwarding classes. To assign
inbound traffic to other forwarding classes, you must use a different classifier that supports more
forwarding classes.
Note that when MPLS is enabled on an interface, the interface uses the default MPLS EXP classifier
(except on M Series devices with standard, nonenhanced FPCs).

18 www.juniper.net
Packet Classification

Other Default Classifiers


As mentioned on the previous page, the Junos OS provides several default classifiers. Some
examples are shown in full below.
Classifier: exp-default, Code point type: exp, Index: 10
Code point Forwarding class Loss priority
000 best-effort low
001 best-effort high
010 expedited-forwarding low
011 expedited-forwarding high
100 assured-forwarding low
101 assured-forwarding high
110 network-control low
111 network-control high
Continued on next page.

www.juniper.net 19
Packet Classification
Other Default Classifiers (contd.)
Classifier: ieee8021p-default, Code point type: ieee-802.1, Index: 11
Code point Forwarding class Loss priority
000 best-effort low
001 best-effort high
010 expedited-forwarding low
011 expedited-forwarding high
100 assured-forwarding low
101 assured-forwarding high
110 network-control low
111 network-control high

20 www.juniper.net
Packet Classification

BA Classification Using Default Classifiers


As mentioned previously, all logical interfaces use the ipprec-compatibility classifier by default. To
use another classifier, apply it to an interface within the class-of-service stanza.
In the example on the slide, the ge-0/0/0.0 interface has several classifiers applied to it. As the
device receives traffic with existing CoS values on this interface, the system applies the related
default classifier and automatically assigns a forwarding class (queue) and PLP value.

www.juniper.net 21
Packet Classification

BA Classification Using Custom Classifiers


If the default classifiers do not meet your needs, you can create your own custom classifiers under
the class-of-service classifiers stanza. When the custom classifier is fully defined, apply it to
an interface, again under the class-of-service stanza.
In the example on the slide, a custom dscp classifier has several forwarding classes defined, each
with one or more PLP values. Each entry is also related to a code point value. In practice the process
works somewhat in reverse. The configuration example on the slide essentially says the following:
when a packet with a dscp code point of, for example, 000000 arrives at interface ge-0/0/3, assign
the packet to the BestEffort forwarding class with high PLP. The same process applies for packets
with different dscp code points.

Note
If you do not have tricolor marking enabled when
using M320 Multiservice Edge Routers, MX
Series 3D Universal Edge Routers, or T Series
Core Routers (which is reasonably likely), you
must configure PLP within a multifield classifier.

22 www.juniper.net
Packet Classification

Using “Import” to Simplify Classifier Configuration


When creating a custom classifier, it is common to reuse several of the same settings that are found
in the related default classifier of the same CoS type. Perhaps the default classifier works almost
entirely for your needs, and you need to change just two of the settings. In cases such as this, you
can use an existing classifier as a kind of template to simplify the configuration process.
To configure a new classifier that reuses settings from an existing classifier, use the import
statement under the class-of-service classifier stanza and specify a default or custom
classifier to use as a template, and then define custom entries to create your specific requirements.
The result is a merging of the template with the custom entries, with the new entries overriding the
corresponding values in the underlying template.
In the example on the slide, a custom classifier uses the default EXP classifier as a template.
(exp-default has PLP set to low for code point 000.) In addition, a custom entry specifies that for
code point 000, the PLP is low. The resulting custom classifier reuses many of the default EXP
classifier’s settings, and the explicit configuration statement overrides the default setting for code
point 000.

www.juniper.net 23
Packet Classification

Apply BA Classification Within a Network


In general, the best place to use BA classification is within a network. Because traffic has already
passed through your edge network device, you can trust any CoS values on packets. Furthermore,
you can leverage the traffic’s existing CoS values and use the more efficient BA classification
method to minimize the CoS processing workload on the other devices in the network.

24 www.juniper.net
Packet Classification

PE2 Configuration Example


The command output on the slide shows the relevant configuration components for the PE2 device
in the diagram on the previous page. In step 1, a custom classifier uses the dscp default classifier
as a template, along with two customized settings. In step 2, the fe-1/1/1 and fe-3/0/2 interfaces
perform BA classification using the custom classifier.

www.juniper.net 25
Packet Classification

Guidelines When Applying Multiple BA Classifiers


In general you can configure multiple BA classifiers on a logical interface. However, many variations
and restrictions exist for what is supported on a given platform. Often the hardware installed in a
chassis is also a factor. For detailed information on supported BA classification combinations for a
given platform, refer to the Junos Class of Service Configuration Guide.

26 www.juniper.net
Packet Classification

Guidelines When Mixing MF and BA Classifiers


You can apply both MF and BA classifiers to a logical interface. Because BA classification is
performed before MF classification, the latter overrides the former if a conflict occurs.

www.juniper.net 27
Packet Classification

28 www.juniper.net

You might also like