Configuring CoS Components with a Configuration Editor
To configure the device as a node in a network supporting CoS, read the section Before You Begin, determine your needs, and select the tasks you need to perform from the following list. For information about using the J-Web and CLI configuration editors, see the the J-Web Interface User Guide and the Junos CLI User Guide.
- Configuring a Policer for a Firewall Filter
- Configuring and Applying a Firewall Filter for a Multifield Classifier
- Assigning Forwarding Classes to Output Queues
- Example: Configuring Up to Eight Forwarding Classes
- Configuring and Applying Rewrite Rules
- Configuring and Applying Behavior Aggregate Classifiers
- Configuring RED Drop Profiles for Congestion Control
- Configuring Schedulers
- Configuring and Applying Scheduler Maps
- Scheduler Maps: Sample Configuration
- Schedulers: Sample Configuration
- Configuring and Applying Virtual Channels
- Configuring and Applying an Adaptive Shaper
Configuring a Policer for a Firewall Filter
You configure a policer to detect packets that exceed the limits established for expedited forwarding. The packets that exceed these limits are given a higher loss priority than packets within the bandwidth and burst size limits.
The following example shows how to configure a policer called ef-policer that identifies for likely discard expedited forwarding packets with a burst size greater than 2000 bytes and a bandwidth greater than 10 percent.
For more information about firewall filters, see the JUNOS Software Routing Protocols and Policies Configuration Guide for Security Devices and the JUNOS Policy Framework Configuration Guide.
To configure an expedited forwarding policer for a firewall filter for the Services Router:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 22.
- Go on to Configuring and Applying a Firewall Filter for a Multifield Classifier.
Table 22: Configuring a Policer for a Firewall Filter
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Firewall level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit firewall |
Create the policer for expedited forwarding, and give the policer a name—for example, ef-policer. |
| Enter edit policer ef-policer |
Set the burst limit for the policer—for example, 2k. Set the bandwidth limit or percentage for the bandwidth allowed for this type of traffic—for example, use a bandwidth percent of 10. |
| Enter set if-exceeding burst-limit-size 2k set if-exceeding bandwidth-percent 10 |
Enter the loss priority for packets exceeding the limits established by the policer—for example, high. |
| Enter set then loss-priority high |
Configuring and Applying a Firewall Filter for a Multifield Classifier
You configure a multifield (MF) classifier to detect packets of interest to CoS and assign the packet to the proper forwarding class independently of the DiffServ code point (DSCP). To configure a multifield classifier on a customer-facing or host-facing link, configure a firewall filter to classify traffic. Packets are classified as they arrive on an interface.
One common way to detect packets of CoS interest is by source or destination address. The destination address is used in this example, but many other matching criteria for packet detection are available to firewall filters.
This example shows how to configure the firewall filter mf-classifier and apply it to the Services Router's Gigabit Ethernet interface ge-0/0/0. The firewall filter consists of the rules (terms) listed in Table 23.
Table 23: Sample mf-classifier Firewall Filter Terms
Rule (Term) | Purpose | Contents |
|---|---|---|
assured forwarding | Detects packets destined for 192.168.44.55, assigns them to an assured forwarding class, and gives them a low likelihood of being dropped. | Match condition: destination address 192.168.44.55 Forwarding class: af-class Loss priority: low |
expedited-forwarding | Detects packets destined for 192.168.66.77, assigns them to an expedited forwarding class, and subjects them to the EF policer configured in Configuring a Policer for a Firewall Filter. | Match condition: destination address 192.168.66.77 Forwarding class: ef-class Policer: ef-policer |
network control | Detects packets with a network control precedence and forwards them to the network control class. | Match condition: precedence net-control Forwarding class: nc-class |
best-effort-data | Detects all other packets and assigns them to the best effort class. | Forwarding class: be-class |
For more information about firewalls filters see JUNOS Software Routing Protocols and Policies Configuration Guide for Security Devices and the JUNOS Policy Framework Configuration Guide.
To configure a firewall filter for a multifield classifier for the Services Router:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 24.
- Go on to Assigning Forwarding Classes to Output Queues.
Table 24: Configuring and Applying a Firewall Filter for a Multifield Classifier
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Firewall level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit firewall |
Create the multifield classifier filter and name it—for example, mf-classifier. |
| Enter edit filter mf-classifier set interface-specific |
Create the term for the assured forwarding traffic class, and give it a name—for example, assured-forwarding. |
| Enter edit term assured-forwarding |
Create the match condition for the assured forwarding traffic class. Use the destination address for assured forwarding traffic—for example, 192.168.44.55. |
| Enter set from destination-address 192.168.44.55 |
Create the forwarding class for assured forwarding DiffServ traffic—for example, af-class. Set the loss priority for the assured forwarding traffic class—for example, low. |
| Enter set then forwarding-class af-class set then loss-priority low |
Create the term for the expedited forwarding traffic class, and give it a name—for example, expedited-forwarding. |
| From the [edit firewall filter mf-classifier] hierarchy level, enter edit term expedited-forwarding |
Create the match condition for the expedited forwarding traffic class. Use the destination address for expedited forwarding traffic—for example, 192.168.66.77. |
| Enter set from destination-address 192.168.66.77 |
Create the forwarding class for expedited forwarding DiffServ traffic—for example, ef-class. Apply the policer for the expedited forwarding traffic class. Use the EF policer previously configured for expedited forwarding DiffServ traffic—ef-policer. |
| Enter set then forwarding-class ef-class set then policer ef-policer |
Create the term for the network control traffic class, and give it a name—for example, network-control. |
| From the [edit firewall filter mf-classifier] hierarchy level, enter edit term network-control |
Create the match condition for the network control traffic class. |
| Enter set from precedence net-control |
Create the forwarding class for the network control traffic class, and give it a name—for example, nc-class. |
| Enter set then forwarding-class nc-class |
Create the term for the best-effort traffic class, and give it a name—for example, best-effort-data. |
| From the [edit firewall filter mf-classifier] hierarchy level, enter edit term best-effort-data |
Create the forwarding class for the best-effort traffic class, and give it a name—for example, be-class. (Because this is the last term in the filter, it has no match condition.) |
| Enter set then forwarding-class be-class |
Navigate to the Interfaces level in the configuration hierarchy. | On the main Configuration page next to Interfaces, click Configure or Edit. | From the [edit] hierarchy level, enter edit interfaces |
Apply the multifield classifier firewall filter mf-classifier as an input filter on each customer-facing or host-facing interface that needs the filter—for example, on ge-0/0/0, unit 0. |
| Enter set ge-0/0/0 unit 0 family inet filter input mf-classifier |
Assigning Forwarding Classes to Output Queues
You must assign the forwarding classes established by the mf-classifier multifield classifier to output queues. This example assigns output queues as shown in Table 25.
Table 25: Sample Output Queue Assignments for mf-classifier Forwarding Queues
mf-classifier Forwarding Class | For Traffic Type | Output Queue |
|---|---|---|
be-class | Best-effort traffic | Queue 0 |
ef-class | Expedited forwarding traffic | Queue 1 |
af-class | Assured forwarding traffic | Queue 2 |
nc-class | Network control traffic | Queue 3 |
For multifield classifier details, see Configuring and Applying a Firewall Filter for a Multifield Classifier.
To assign forwarding classes to output queues:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 26.
- Go on to Configuring and Applying Rewrite Rules.
Table 26: Assigning Forwarding Classes to Output Queues
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Class of service level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit class-of-service |
Assign best-effort traffic to queue 0. |
| Enter set forwarding-classes queue 0 be-class |
Assign expedited forwarding traffic to queue 1. |
| Enter set forwarding-classes queue 1 ef-class |
Assign assured forwarding traffic to queue 2. |
| Enter set forwarding-classes queue 2 af-class |
Assign network control traffic to queue 3. |
| Enter set forwarding-classes queue 3 nc-class |
Configuring Forwarding Classes
To configure CoS forwarding classes on an SRX Series device, include the following statements at the [edit class-of-service] hierarchy level of the configuration:
You cannot commit a configuration that assigns the same forwarding class to two different queues.
Assigning a Forwarding Class to an Interface
On an SRX Series device, you can configure fixed classification on a logical interface by specifying a forwarding class to be applied to all packets received by the logical interface, regardless of the packet contents.
To assign a forwarding class configuration to the input logical interface, include the forwarding-class statement at the [edit class-of-service interfaces interface-name unit logical-unit-number] hierarchy level:
You can include interface wildcards for interface-name and logical-unit-number.
In the following example, all packets coming into the device from the ge-3/0/0.0 interface are assigned to the assured-forwarding forwarding class:
Example: Configuring Up to Eight Forwarding Classes
By default on all platforms, four output queues are mapped to four forwarding classes as shown in Table 8. On J Series or SRX Series devices, you can configure up to eight forwarding classes and eight queues.
To configure up to eight forwarding classes, include the queue statement at the [edit class-of-service forwarding-classes] hierarchy level:
The output queue number can be from 0 through 7, and you must map the forwarding classes one-to-one with the output queues. The default scheduler transmission rate and buffer size percentages for queues 0 through 7 are 95, 0, 0, 5, 0, 0, 0, and 0 percent.
For example, to configure a one-to-one mapping between eight forwarding classes and eight queues: you would use the following configuration:
Defining Eight Classifiers
Adding Eight Schedulers to a Scheduler Map
Configure a custom scheduler map that applies globally to all interfaces, except those that are restricted to four queues:
Configuring an IP Precedence Classifier and Rewrite Tables
Configuring and Applying Rewrite Rules
You can configure rewrite rules to replace DiffServ code points (DSCPs) on packets received from the customer or host with the values expected by other devices. You do not have to configure rewrite rules if the received packets already contain valid DSCPs. Rewrite rules apply the forwarding class information and packet loss priority used internally by the device to establish the DSCP on outbound packets. Once configured, you must apply the rewrite rules to the correct interfaces.
The following example shows how to create the rewrite rules rewrite-dscps and apply them to the device's Gibabit Ethernet interface ge-0/0/0. The rewrite rules replace the DSCPs on packets in the four forwarding classes, as shown in Table 27.
Table 27: Sample rewrite-dscps Rewrite Rules to Replace DSCPs
mf-classifier Forwarding Class | For CoS Traffic Type | rewrite-dscps Rewrite Rules |
|---|---|---|
be-class | Best-effort traffic | Low-priority code point: 000000 High-priority code point: 000001 |
ef-class | Expedited forwarding traffic | Low-priority code point: 101110 High-priority code point: 101111 |
af-class | Assured forwarding traffic | Low-priority code point: 001010 High-priority code point: 001100 |
nc-class | Network control traffic | Low-priority code point: 110000 High-priority code point: 110001 |
To configure and apply rewrite rules for the device:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 28.
- Go on to Configuring and Applying Behavior Aggregate Classifiers .
Table 28: Configuring and Applying Rewrite Rules
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Class of service level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit class-of-service |
Configure rewrite rules for DiffServ CoS. |
| Enter edit rewrite-rules dscp rewrite-dscps |
Configure best-effort forwarding class rewrite rules. |
| Enter set forwarding-class be-class loss-priority low code-point 000000 set forwarding-class be-class loss-priority high code-point 000001 |
Configure expedited forwarding class rewrite rules. |
| Enter set forwarding-class ef-class loss-priority low code-point 101110 set forwarding-class ef-class loss-priority high code-point 101111 |
Configure assured forwarding class rewrite rules. |
| Enter set forwarding-class af-class loss-priority low code-point 001010 set forwarding-class af-class loss-priority high code-point 001100 |
Configure network control class rewrite rules. |
| Enter set forwarding-class nc-class loss-priority low code-point 110000 set forwarding-class nc-class loss-priority high code-point 110001 |
Apply rewrite rules to an interface. (See the interface naming conventions in JUNOS Software Interfaces Configuration Guide for Security Devices.) |
| From the [edit class of service] hierarchy level, enter set interfaces ge-0/0/0 unit 0 rewrite-rules dscp rewrite-dscps |
Configuring and Applying Behavior Aggregate Classifiers
You configure behavior aggregate classifiers to classify packets that contain valid DSCPs to appropriate queues. Once configured, you must apply the behavior aggregate classifier to the correct interfaces.
The following example shows how to configure the DSCP behavior aggregate classifier ba-classifier as the default DSCP map, and apply it to the device's Gigabit Ethernet interface ge-0/0/0. The behavior aggregate classifier assigns loss priorities, as shown in Table 29, to incoming packets in the four forwarding classes.
Table 29: Sample ba-classifier Loss Priority Assignments
mf-classifier Forwarding Class | For CoS Traffic Type | ba-classifier Assignments |
|---|---|---|
be-class | Best-effort traffic | High-priority code point: 000001 |
ef-class | Expedited forwarding traffic | High-priority code point: 101111 |
af-class | Assured forwarding traffic | High-priority code point: 001100 |
nc-class | Network control traffic | High-priority code point: 110001 |
To configure and apply behavior aggregate classifiers for the device:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 30.
- Go on to Configuring RED Drop Profiles for Congestion Control .
Table 30: Configuring and Applying Behavior Aggregate Classifiers
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Class of service level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit class-of-service |
Configure behavior aggregate classifiers for DiffServ CoS. |
| Enter edit classifiers dscp ba-classifier set import default |
Configure a best-effort forwarding class classifier. |
| Enter set forwarding-class be-class loss-priority high code-points 000001 |
Configure an expedited forwarding class classifier. |
| Enter set forwarding-class ef-class loss-priority high code-points 101111 |
Configure an assured forwarding class classifier. |
| Enter set forwarding-class af-class loss-priority high code-points 001100 |
Configure a network control class classifier. |
| Enter set forwarding-class nc-class loss-priority high code-points 110001 |
Apply the behavior aggregate classifier to an interface. (See the interface naming conventions in JUNOS Software Interfaces Configuration Guide for Security Devices.) |
| From the [edit class of service] hierarchy level, enter set interfaces ge-0/0/0 unit 0 classifiers dscp ba-classifier |
Example: Defining Aliases for Bits
When you configure classes and define classifiers, you can refer to the markers by alias names. You can configure user-defined classifiers in terms of alias names. If the value of an alias changes, it alters the behavior of any classifier that references it.
To define a code-point alias on an SRX Series device, include the code-point-aliases statement at the [edit class-of-service] hierarchy level:
The CoS marker types are as follows:
- dscp—Handles incoming IPv4 packets.
- exp—Handles MPLS packets using Layer 2 headers.
- ieee-802.1—Handles Layer 2 CoS.
- inet-precedence—Handles incoming IPv4 packets. IP precedence mapping requires only the upper three bits of the DSCP field.
For example, you can set up the following configuration:
The sample configuration produces this mapping:
user@host>show class-of-service code-point-aliases
dscpAlias Bit pattern ef/my2 101110 af11 001010 af12 001100 af13 001110 af21 010010 af22 010100 af23 010110 af31 011010 af32 011100 af33 011110 af41 100010 af42 100100 af43 100110 be 000001 cs1 001000 cs2 010000 cs3 011000 cs4 100000 cs5 101000 nc1/cs6/cs7 110000 nc2 111000 my1 110001
The following notes explain certain results in the mapping:
- my1 110001:
- 110001 was not mapped to anything before, and my1 is a new alias.
- Nothing in the default mapping table is changed by this statement.
- my2 101110:
- 101110 is now mapped to my2 as well as ef.
- be 000001:
- be is now mapped to 000001.
- The old value of be, 000000, is not associated with any alias. Packets with this DSCP value are now mapped to the default forwarding class.
- cs7 110000:
- cs7 is now mapped to 110000, as well as nc1 and cs6.
- The old value of cs7, 111000, is still mapped to nc2.
Configuring RED Drop Profiles for Congestion Control
If the device must support assured forwarding, you can control congestion by configuring random early detection (RED) drop profiles. RED drop profiles use drop probabilities for different levels of buffer fullness to determine which scheduling queue on the device is likely to drop assured forwarding packets under congested conditions. The device can drop packets when the queue buffer becomes filled to the configured percentage.
Assured forwarding traffic with the PLP (packet loss priority) bit set is more likely to be discarded than traffic without the PLP bit set. This example shows how to configure a drop probability and a queue fill level for both PLP and non-PLP assured forwarding traffic. It is only one example of how to use RED drop profiles.
The example shows how to configure the RED drop profiles listed in Table 31.
Table 31: Sample RED Drop Profiles
Drop Profile | Drop Probability | Queue Fill Level |
|---|---|---|
af-normal—For non-PLP (normal) assured forwarding traffic | Between 0 (never dropped) and 100 percent (always dropped) | Between 95 and 100 percent |
af-with-plp—For PLP (aggressive packet dropping) assured forwarding traffic | Between 95 and 100 percent (always dropped) | Between 80 and 95 percent |
To configure RED drop profiles for assured forwarding congestion control on the device:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 32.
- If you are finished configuring the device, commit the configuration.
- Go on to one of the following tasks:
- To assign resources, priorities, and profiles to output queues, see Configuring Schedulers.
- To apply rules to logical interfaces, see Configuring and Applying Virtual Channels .
- To use adaptive shapers to limit bandwidth for Frame Relay, see Configuring Adaptive Shaping for Frame Relay.
- To check the configuration, see Verifying a CoS Configuration.
Table 32: Configuring RED Drop Profiles for Assured Forwarding Congestion Control
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Class of service level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit class-of-service |
Configure the lower drop probability for normal, non-PLP traffic. |
| Enter edit drop-profiles af-normal interpolate set drop-probability 0 set drop-probability 100 |
Configure a queue fill level for the lower non-PLP drop probability. |
| Enter set fill-level 95 set fill-level 100 |
Configure the higher drop probability for PLP traffic. |
| From the [edit class of service] hierarchy level, enter edit drop-profiles af-with-PLP interpolate set drop-probability 95 set drop-probability 100 |
Configure a queue fill level for the higher PLP drop probability. |
| Enter set fill-level 80 set fill-level 95 |
Example: Configuring RED Drop Profiles
Create a segmented configuration and an interpolated configuration that correspond to the graphs in Figure 4. The values defined in the configuration are matched to represent the data points in the graph line. In this example, the drop probability is 25 percent when the queue is 50 percent full. The drop probability increases to 50 percent when the queue is 75 percent full.
Figure 4: Segmented and Interpolated Drop Profiles

Segmented
To create the profile’s graph line, the software begins at the bottom-left corner, representing a 0 percent fill level and a 0 percent drop probability. This configuration draws a line directly to the right until it reaches the first defined fill level, 25 percent for this configuration. The software then continues the line vertically until the first drop probability is reached. This process is repeated for all of the defined levels and probabilities until the top-right corner of the graph is reached.
Create a smoother graph line by configuring the profile with the interpolate statement. This allows the software to automatically generate 64 data points on the graph beginning at (0, 0) and ending at (100, 100). Along the way, the graph line intersects specific data points, which you define as follows:
Interpolated
Configuring Schedulers
You configure schedulers to assign resources, priorities, and drop profiles to output queues. By default, only queues 0 and 3 have resources assigned.
![]() | Note: SRX Series devices support hierarchical schedulers, including per-unit-schedulers. For more information, see Configuring CoS Hierarchical Schedulers. |
This example creates the schedulers listed in Table 33.
Table 33: Sample Schedulers
Scheduler | For CoS Traffic Type | Assigned Priority | Allocated Portion of Queue Buffer | Assigned Bandwidth (Transmit Rate) |
|---|---|---|---|---|
be-scheduler | Best-effort traffic | Low | 40 percent | 10 percent |
ef-scheduler | Expedited forwarding traffic | High | 10 percent | 10 percent |
af-scheduler | Assured forwarding traffic | High | 45 percent | 45 percent |
nc-scheduler | Network control traffic | Low | 5 percent | 5 percent |
To configure schedulers for the device:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 34.
- Go on to Configuring and Applying Scheduler Maps .
Table 34: Configuring Schedulers
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Class of service level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit class-of-service |
Configure a best-effort scheduler. |
| Enter edit schedulers be-scheduler |
Configure a best-effort scheduler priority and buffer size. |
| Enter set priority low set buffer-size percent 40 |
Configure a best-effort scheduler transmit rate. |
| Enter set transmit-rate percent 10 |
Configure an expedited forwarding scheduler. |
| From the [edit class of service] hierarchy level, enter edit schedulers ef-scheduler |
Configure an expedited forwarding scheduler priority and buffer size. |
| Enter set priority high set buffer-size percent 10 |
Configure an expedited forwarding scheduler transmit rate. |
| Enter set transmit-rate percent 10 |
Configure an assured forwarding scheduler. |
| From the [edit class of service] hierarchy level, enter edit schedulers af-scheduler |
Configure an assured forwarding scheduler priority and buffer size. |
| Enter set priority high set buffer-size percent 45 |
Configure an assured forwarding scheduler transmit rate. |
| Enter set transmit-rate percent 45 |
(Optional) Configure a drop profile map for assured forwarding low and high priority. (DiffServ can have a RED drop profile associated with assured forwarding.) |
| Enter set drop-profile-map loss-priority low protocol any drop-profile af-normal set drop-profile-map loss-priority high protocol any drop-profile af-with-PLP |
Configure a network control scheduler. |
| From the [edit class of service] hierarchy level, enter edit schedulers nc-scheduler |
Configure a network control scheduler priority and buffer size. |
| Enter set priority low set buffer-size percent 5 |
Configure a network control scheduler transmit rate. |
| Enter set transmit-rate percent 5 |
Configuring and Applying Scheduler Maps
You configure a scheduler map to assign a forwarding class to a scheduler, then apply the scheduler map to any interface that must enforce DiffServ CoS.
The following example shows how to create the scheduler map diffserv-cos-map and apply it to the device's Ethernet interface ge-0/0/0. The map associates the mf-classifier forwarding classes configured in Configuring and Applying a Firewall Filter for a Multifield Classifier to the schedulers configured in Configuring Schedulers, as shown in Table 35.
Table 35: Sample diffserv-cos-map Scheduler Mapping
mf-classifier Forwarding Class | For CoS Traffic Type | diffserv-cos-map Scheduler |
|---|---|---|
be-class | Best-effort traffic | be-scheduler |
ef-class | Expedited forwarding traffic | ef-scheduler |
af-class | Assured forwarding traffic | af-scheduler |
nc-class | Network control traffic | nc-scheduler |
To configure and apply scheduler maps:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 36.
- If you are finished configuring the device, commit the configuration.
- Go on to one of the following tasks:
- To apply rules to logical interfaces, see Configuring and Applying Virtual Channels .
- To use adaptive shapers to limit bandwidth for Frame Relay, see Configuring Adaptive Shaping for Frame Relay.
- To check the configuration, see Verifying a CoS Configuration.
Table 36: Configuring Scheduler Maps
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Class of service level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit class-of-service |
Configure a scheduler map for DiffServ CoS. |
| Enter edit scheduler-maps diffserv-cos-map |
Configure a best-effort forwarding class and scheduler. |
| Enter set forwarding-class be-class scheduler be-scheduler |
Configure an expedited forwarding class and scheduler. |
| Enter set forwarding-class ef-class scheduler ef-scheduler |
Configure an assured forwarding class and scheduler. |
| Enter set forwarding-class af-class scheduler af-scheduler |
Configure a network control class and scheduler. |
| Enter set forwarding-class nc-class scheduler nc-scheduler |
Apply the scheduler map to an interface. (See the interface naming conventions in JUNOS Software Interfaces Configuration Guide for Security Devices.) |
| From the [edit class of service] hierarchy level, enter set interfaces ge-0/0/0 scheduler-map diffserv-cos-map |
Scheduler Maps: Sample Configuration
Once you define a scheduler, you can include it in a scheduler map, which maps a specified forwarding class to a scheduler configuration. To do this, include the scheduler-maps statement at the [edit class-of-service] hierarchy level:
After you have defined the scheduler map, you can associate it with an output interface. To do this, include the scheduler-map statement at the [edit class-of-service interfaces interface-name] hierarchy level:
Interface wildcards are supported.
Schedulers: Sample Configuration
You use schedulers to define the properties of output queues. These properties 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.
You associate the schedulers with forwarding classes by means of scheduler maps. You can then associate each scheduler map with an interface, thereby configuring the hardware queues, packet schedulers, and RED processes that operate according to this mapping.
To configure class-of-service (CoS) schedulers, use the following sample configuration at the [edit class-of-service] hierarchy level:
![]() | Note: For J Series devices and SRX210, SRX240, and SRX650 devices, when configuring the “protocol parameter” in the drop-profile-map statement, tcp and non-tcp values are not supported, only the value “any” is supported. |
Configuring and Applying Virtual Channels
You configure a virtual channel to set up queuing, packet scheduling, and accounting rules to be applied to one or more logical interfaces. You then must apply the virtual channel to a particular logical interface. Virtual channels can be applied in different ways. For more information on virtual channels, see Configuring Virtual Channels. In the example here, an output firewall filter is used for directing traffic to a particular virtual channel.
The following example shows how to create the virtual channels branch1–vc, branch2–vc, and branch3–vc and apply them in the firewall filter choose-vc to the Services Router's T3 interface t3-1/0/0.
To configure and apply virtual channels for the Services Router:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 37.
- If you are finished configuring the router, commit the configuration.
- Go on to one of the following tasks:
- To assign resources, priorities, and profiles to output queues, see Configuring Schedulers.
- To use adaptive shapers to limit bandwidth for Frame Relay, see Configuring Adaptive Shaping for Frame Relay.
- To check the configuration, see Verifying a CoS Configuration.
Table 37: Configuring and Applying Virtual Channels
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Class of service level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit class-of-service |
Define the virtual channels branch1–vc, branch2–vc, branch3–vc, and the default virtual channel. You must specify a default virtual channel. |
|
|
Define the virtual channel group wan-vc-group to include the four virtual channels, and assign each virtual channel the scheduler map bestscheduler. |
|
|
Specify a shaping rate of 2 Mbps for each virtual channel within the virtual channel group. |
|
|
Apply the virtual channel group to the logical interface t3–1/0/0.0. (See the interface naming conventions in JUNOS Software Interfaces Configuration Guide for Security Devices.) |
| From the [edit class of service] hierarchy level, enter set interfaces t3–1/0/0 unit 0 virtual-channel-group wan-vc-group |
Create the firewall filter choose-vc to select the traffic that is transmitted on a particular virtual channel. |
|
|
Apply the firewall filter choose-vc to output traffic on the t3–1/0/0.0 interface. |
|
|
Configuring and Applying an Adaptive Shaper
You can use adaptive shaping to limit the bandwidth of traffic flowing on a Frame Relay logical interface. If you configure and apply adaptive shaping, the device checks the backward explicit congestion notification (BECN) bit within the last inbound (ingress) packet received on the interface. For more information on adaptive shaping, see Configuring Adaptive Shaping for Frame Relay.
![]() | Note: Adaptive shaping is not available on SRX3400, SRX3600, SRX5600, and SRX5800 devices. |
The following example shows how to create an adaptive shaper fr-shaper and apply it to the device's T1 interface t1-0/0/2. The adapter shaper limits the transmit bandwidth on the interface to 64 Kbps.
To configure and apply an adaptive shaper for the device:
- Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
- Perform the configuration tasks described in Table 38.
- If you are finished configuring the device, commit the configuration.
- Go on to one of the following tasks:
- To assign resources, priorities, and profiles to output queues, see Configuring Schedulers.
- To apply rules to logical interfaces, see Configuring and Applying Virtual Channels .
- To check the configuration, see Verifying a CoS Configuration.
Table 38: Configuring and Applying an Adaptive Shaper
Task | J-Web Configuration Editor | CLI Configuration Editor |
|---|---|---|
Navigate to the Class of service level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit class-of-service |
Define the adaptive shaper name and maximum transmit rate. |
| Enter set adaptive-shapers fr-shaper trigger becn shaping-rate 64k |
Apply the adaptive shaper to the logical interface t1-0/0/2.0. (See the interface naming conventions in JUNOS Software Interfaces Configuration Guide for Security Devices.) |
| Enter set interfaces t1-0/0/2 unit 0 adaptive-shaper fr-shaper |
