Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Example: Configuring ECN

 

This example shows how to enable explicit congestion notification (ECN) on an output queue.

Requirements

This example uses the following hardware and software components:

  • One switch.

  • Junos OS Release 13.2X51-D25 or later for the QFX Series or Junos OS Release 14.1X53-D20 for the OCX Series

Overview

ECN enables end-to-end congestion notification between two endpoints on TCP/IP based networks. The two endpoints are an ECN-enabled sender and an ECN-enabled receiver. ECN must be enabled on both endpoints and on all of the intermediate devices between the endpoints for ECN to work properly. Any device in the transmission path that does not support ECN breaks the end-to-end ECN functionality

A weighted random early detection (WRED) packet drop profile must be applied to the output queues on which ECN is enabled. ECN uses the WRED drop profile thresholds to mark packets when the output queue experiences congestion.

ECN reduces packet loss by forwarding ECN-capable packets during periods of network congestion instead of dropping those packets. (TCP notifies the network about congestion by dropping packets.) During periods of congestion, ECN marks ECN-capable packets that egress from congested queues. When the receiver receives an ECN packet that is marked as experiencing congestion, the receiver echoes the congestion state back to the sender. The sender then reduces its transmission rate to clear the congestion.

ECN is disabled by default. You can enable ECN on best-effort traffic. ECN should not be enabled on lossless traffic queues, which uses priority-based flow control (PFC) for congestion notification, and ECN should not be enabled on strict-high priority traffic queues.

To enable ECN on an output queue, you not only need to enable ECN in the queue scheduler, you also need to:

  • Configure a WRED packet drop profile.

  • Configure a queue scheduler that includes the WRED drop profile and enables ECN. (This example shows only ECN and drop profile configuration; you can also configure bandwidth, priority, and buffer settings in a scheduler.)

  • Map the queue scheduler to a forwarding class (output queue) in a scheduler map.

  • Starting in Junos OS 15.1, enhanced transmission selection (ETS) hierarchical scheduling is supported. If you are using enhanced transmission selection (ETS) hierarchical scheduling, add the forwarding class to a forwarding class set (priority group).

  • If you are using ETS, associate the queue scheduler map with a traffic control profile (priority group scheduler for hierarchical scheduling).

  • If you are using ETS, apply the traffic control profile and the forwarding class set to an interface. On that interface, the output queue uses the scheduler mapped to the forwarding class, as specified by the scheduler map attached to the traffic control profile. This enables ECN on the queue and applies the WRED drop profile to the queue.

    If you are using port scheduling, apply the scheduler map to an interface. On that interface, the output queue uses the scheduler mapped to the forwarding class in the scheduler map, which enables ECN on the queue and applies the WRED drop profile to the queue.

Table 1 shows the configuration components for this example.

Table 1: Components of the ECN Configuration Example

Component

Settings

Hardware

QFX Series switch

Drop profile (with two fill level/drop probability pairs)

Name: be-dp

Drop start fill level: 30 percent

Drop end fill level: 75 percent

Drop probability at drop start (minimum drop rate): 0 percent

Drop probability at drop end (maximum drop rate): 80 percent

Scheduler

Name: be-sched

ECN: enabled

Drop profile: be-dp

Transmit rate: 25%

Buffer size: 25%

Priority: low

Scheduler map

Name: be-map

Forwarding class: best-effort

Scheduler: be-sched

Note: By default, the best-effort forwarding class is mapped to output queue 0.

Forwarding class set (ETS only)

Name: be-pg

Forwarding class: best-effort (queue 0)

Traffic control profile (ETS only)

Name: be-tcp

Scheduler map: be-map

Interface (ETS only)

Name: xe-0/0/20

Forwarding class set: be-pg

(Output) traffic control profile: be-tcp

Interface (port scheduling only)

Name: xe-0/0/20

Note

Only switches that support ETS hierarchical scheduling support forwarding class set and traffic control profile configuration. Direct port scheduling does not use the hierarchical scheduling structure.

Note

On QFX5100, EX4600, QFX3500, and QFX3600 switches, and on QFabric systems, the WRED drop profile also controls packet drop behavior for traffic that is not ECN-capable (packets marked non-ECT, ECN bit code 00).

On QFX10000 switches, when ECN is enabled on a queue, the WRED drop profile only sets the ECN thresholds, it does not control packet drop on non-ECN packets. On ECN-enabled queues, QFX10000 switches use the tail-drop algorithm on non-ECN packets during periods of congestion. If you do not enable ECN, then the queue uses the WRED packet drop mechanism.

Configuration

CLI Quick Configuration

To quickly configure the drop profile, scheduler with ECN enabled, and to map the scheduler to an output queue on an interface, copy the following commands, paste them in a text file, remove line breaks, change variables and details to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

ETS Quick Configuration

[edit class-of-service]

set drop-profile be-dp interpolate fill-level 30 fill-level 75 drop-probability 0 drop-probability 80

set schedulers be-sched explicit-congestion-notification

set schedulers be-sched drop-profile-map loss-priority low protocol any drop-profile be-dp

set schedulers be-sched transmit-rate percent 25

set schedulers be-sched buffer-size percent 25

set schedulers be-sched priority low

set scheduler-maps be-map forwarding-class best-effort scheduler be-sched

set forwarding-class-sets be-pg class best-effort

set traffic-control-profiles be-tcp scheduler-map be-map

set interfaces xe-0/0/20 forwarding-class-set be-pg output-traffic-control-profile be-tcp

Port Scheduling Quick Configuration (QFX10000 Switches)

[edit class-of-service]

set drop-profile be-dp interpolate fill-level 30 fill-level 75 drop-probability 0 drop-probability 80

set schedulers be-sched explicit-congestion-notification

set schedulers be-sched drop-profile-map loss-priority low protocol any drop-profile be-dp

set schedulers be-sched transmit-rate percent 25

set schedulers be-sched buffer-size percent 25

set schedulers be-sched priority low

set scheduler-maps be-map forwarding-class best-effort scheduler be-sched

set interfaces xe-0/0/20 scheduler-map be-map

Configuring ECN

Step-by-Step Procedure

To configure ECN:

  1. Configure the WRED packet drop profile be-dp. This example uses a drop start point of 30 percent, a drop end point of 75 percent, a minimum drop rate of 0 percent, and a maximum drop rate of 80 percent:
    [edit class-of-service]

    user@switch# set drop-profile be-dp interpolate fill-level 30 fill-level 75 drop-probability 0 drop-probability 80



  2. Create the scheduler be-sched with ECN enabled and associate the drop profile be-dp with the scheduler:
    [edit class-of-service]

    user@switch# set schedulers be-sched explicit-congestion-notification

    user@switch# set schedulers be-sched drop-profile-map loss-priority low protocol any drop-profile be-dp

    user@switch# set be-sched transmit-rate percent 25

    user@switch# set be-sched buffer-size percent 25

    user@switch# set be-sched priority low



  3. Map the scheduler be-sched to the best-effort forwarding class (output queue 0) using scheduler map be-map:
    [edit class-of-service]

    user@switch# set scheduler-maps be-map forwarding-class best-effort scheduler be-sched



  4. If you are using ETS, add the forwarding class best-effort to the forwarding class set be-pg; if you are using direct port scheduling, skip this step:
    [edit class-of-service]

    user@switch# set forwarding-class-sets be-pg class best-effort



  5. If you are using ETS, associate the scheduler map be-mapwith the traffic control profile be-tcp; if you are using direct port scheduling, skip this step:
    [edit class-of-service]

    user@switch# set traffic-control-profiles be-tcp scheduler-map be-map



  6. If you are using ETS, associate the traffic control profile be-tcp and the forwarding class set be-pg with the interface on which you want to enable ECN on the best-effort queue:
    [edit class-of-service]

    user@switch# set interfaces xe-0/0/20 forwarding-class-set be-pg output-traffic-control-profile be-tcp

    If you are using direct port scheduling, associate the scheduler map be-map with the interface on which you want to enable ECN on the best-effort queue:

    [edit class-of-service]

    user@switch# set interfaces xe-0/0/20 scheduler-map be-map



Verification

Verifying That ECN Is Enabled

Purpose

Verify that ECN is enabled in the scheduler be-sched by showing the configuration for the scheduler map be-map.

Action

Display the scheduler map configuration using the operational mode command show class-of-service scheduler-map be-map:

user@switch> show class-of-service scheduler-map be-map

Meaning

The show class-of-service scheduler-map operational command shows the configuration of the scheduler associated with the scheduler map and the forwarding class mapped to that scheduler. The output shows that:

  • The scheduler associated with the scheduler map is be-sched.

  • The scheduler map applies to the forwarding class best-effort (output queue 0).

  • The scheduler be-sched has a transmit rate of 25 percent, a queue buffer size of 25 percent, and a drop priority of low.

  • Explicit congestion notification state is enable.

  • The WRED drop profile used for low drop priority traffic is be-dp.

Release History Table
Release
Description
Starting in Junos OS 15.1, enhanced transmission selection (ETS) hierarchical scheduling is supported.