Example: Configuring Forwarding Classes
Forwarding classes group packets for transmission. Forwarding classes map to output queues, so the packets assigned to a forwarding class use the output queue mapped to that forwarding class.
Requirements
This example uses the following hardware and software components for two configuration examples:
Configuring forwarding classes for switches except QFX10000
One switch except QFX10000
Any supported Junos release
Configuring forwarding classes for QFX10000 switches
One QFX10000 switch
Any supported Junos release
Overview
The QFX10000 switch supports eight forwarding classes. Other switches support up to 12 forwarding classes. To forward traffic, you must map (assign) the forwarding classes to output queues. On the QFX10000 switch, queues 0 through 7 are for both unicast and multidestination traffic. On other switches, queues 0 through 7 are for unicast traffic, and queues 8 through 9 (QFX5200 switch) or 8 through 11 (other switches) are for multidestination traffic.
The switch provides four default forwarding classes, and except on QFX10000 switches, these four forwarding classes are unicast, plus one default multidestination forwarding class. You can define the remaining forwarding classes and configure them as unicast or multidestination forwarding classes by mapping them to unicast or multidestination queues. The type of queue, unicast or multidestination, determines the type of forwarding class.
The four default forwarding classes (unicast except on QFX10000) are:
-
be—Best-effort traffic -
fcoe—Guaranteed delivery for Fibre Channel over Ethernet traffic (do not use on OCX Series switches) -
no-loss—Guaranteed delivery for TCP no-loss traffic (do not use on OCX Series switches) -
nc—Network control traffic
Except on QFX10000 switches, the default multidestination forwarding class is:
-
mcast—Multidestination traffic
Map forwarding classes to queues using the class statement. You can
map more than one forwarding class to a single queue, but all forwarding classes
mapped to a particular queue must be of the same type:
-
Except on QFX10000 switches, all forwarding classes mapped to a particular queue must be either unicast or multicast. You cannot mix unicast and multicast forwarding classes on the same queue.
-
On QFX10000 switches, all forwarding classes mapped to a particular queue must have the same packet drop attribute: all of the forwarding classes must be lossy, or all of the forwarding classes mapped to a queue must be lossless.
[edit class-of-service forwarding-classes] user@switch# set class class-name queue-num queue-number;
You can include the no-loss packet drop attribute in explicit forwarding class configurations to configure a lossless forwarding class.
Hierarchical scheduling controls output queue forwarding. When you define a forwarding class and classify traffic into it, you must also define a scheduling policy for the forwarding class. Defining a scheduling policy means:
-
Mapping a scheduler to the forwarding class in a scheduler map
-
Including the forwarding class in a forwarding class set
-
Associating the scheduler map with a traffic control profile
-
Attaching the traffic control profile to a forwarding class set and applying the traffic control profile to an interface
On QFX10000 switches, you can define a scheduling policy using port scheduling:
-
Mapping a scheduler to the forwarding class in a scheduler map.
-
Applying the scheduler map to one or more interfaces.
Example 1: Configuring Forwarding Classes for Switches Except QFX10000
Configuration
Step-by-Step Procedure
Table 1 shows the configuration forwarding-class-to-queue mapping for this example:
Forwarding Class |
Queue |
|---|---|
best-effort |
|
nc |
|
mcast |
|
To configure CoS forwarding classes for switches except QFX10000:
Map the
best-effortforwarding class to queue0:[edit class-of-service forwarding-classes] user@switch# set class best-effort queue-num 0
Map the
ncforwarding class to queue7:[edit class-of-service forwarding-classes] user@switch# set class nc queue-num 7
Map the
mcast-beforwarding class to queue8:[edit class-of-service forwarding-classes] user@switch# set class mcast-be queue-num 8
Verification
Verifying the Forwarding-Class-to-Queue Mapping
Purpose
Verify the forwarding-class-to-queue mapping. (The system shows only the explicitly configured forwarding classes; it does not show default forwarding classes such as fcoe and no-loss.)
Action
Verify the results of the forwarding class configuration using the operational mode command show configuration class-of-service forwarding-classes:
user@switch> show configuration class-of-service forwarding-classes class best-effort queue-num 0; class network-control queue-num 7; class mcast queue-num 8;
Example 2: Configuring Forwarding Classes for QFX10000 Switches
Configuration
Step-by-Step Procedure
Table 2 shows the configuration forwarding-class-to-queue mapping for this example:
Forwarding Class |
Queue |
|---|---|
best-effort |
|
be1 |
|
nc |
|
To configure CoS forwarding classes for QFX10000 switches:
Map the
best-effortforwarding class to queue0:[edit class-of-service forwarding-classes] user@switch# set class best-effort queue-num 0
Map the
be1forwarding class to queue1:[edit class-of-service forwarding-classes] user@switch# set class be1 queue-num 1
Map the
ncforwarding class to queue7:[edit class-of-service forwarding-classes] user@switch# set class nc queue-num 7
Verification
Verifying the Forwarding-Class-to-Queue Mapping
Purpose
Verify the forwarding-class-to-queue mapping. (The system shows only the
explicitly configured forwarding classes; it does not show default
forwarding classes such as fcoe and
no-loss.)
Action
Verify the results of the forwarding class configuration using the
operational mode command show configuration class-of-service
forwarding-classes:
user@switch> show configuration class-of-service forwarding-classes class best-effort queue-num 0; class be1 queue-num 1; class network-control queue-num 7;
Platform-Specific Behavior
Use the following table to review platform-specific behaviors for your platforms.
|
Platform |
Difference |
|---|---|
|
QFX10000 Series |
|