OcNOS DC : Quality of Service Guide : Quality of Service Configuration Guide : Explicit Congestion Notification (ECN) Configuration
Explicit Congestion Notification (ECN) Configuration
Explicit congestion notification (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.
WRED drops packets, based on the average queue length exceeding a specific threshold value, to indicate congestion. ECN is an extension to WRED in that ECN marks packets instead of dropping them when the average queue length exceeds a specific threshold value. When configured with the WRED -- Explicit Congestion Notification feature, routers and end hosts would use this marking as a signal that the network is congested and slow down sending packets.
ECN requires an ECN-specific field that has two bits--the ECN-capable Transport (ECT) bit and the CE (Congestion Experienced) bit--in the IP header. The ECT bit and the CE bit can be used to make four ECN field combinations of 00 to 11. The first number is the ECT bit and the second number is the CE bit. The table below lists each of the ECT and CE bit combination settings in the ECN field and what the combinations indicate.
 
Table 19-1 explains the output fields.
 
Table 19-1: show bfd fields
ECT Bit
CE Bit
Combination Indicates
0
0
Not- ECN capable
0
1
Endpoints of the transport protocol are ECN capable
1
0
Endpoints of the transport protocol
1
1
Congestion experienced
 
The ECN field combination 00 indicates that a packet is not using ECN. The ECN field combinations of 01 and 10 called as ECT(1) and ECT(0) respectively. This sets by the data sender to indicate that the endpoints of the transport protocol are ECN-capable. Routers treat those two field combinations identically. Data senders can use either one or both of these two combinations.
ECN is Enabled
If the number of packets in the queue is below the minimum threshold, packets are transmitted. This happens whether or not ECN is enabled, and this treatment is identical to the treatment a packet receives when WRED only is being used on the network.
If the number of packets in the queue is between the minimum threshold and the maximum threshold, one of the following three scenarios can occur:
If the ECN field on the packet indicates that the endpoints are ECN-capable (that is, the ECT bit is set to 1 and the CE bit is set to 0, or the ECT bit is set to 0 and the CE bit is set to 1)--and the WRED algorithm determines that the packet should have been dropped based on the drop probability--the ECT and CE bits for the packet are changed to 1, and the packet is transmitted. This happens because ECN is enabled and the packet gets marked instead of dropped.
If the ECN field on the packet indicates that neither endpoint is ECN-capable (that is, the ECT bit is set to 0 and the CE bit is set to 0), the packet might be dropped based on the WRED drop probability. This is the identical treatment that a packet receives when WRED is enabled without ECN configured on the router.
If the ECN field on the packet indicates that the network is experiencing congestion (that is, both the ECT bit and the CE bit are set to 1), the packet is transmitted. No further marking is required.
If the number of packets in the queue is above the maximum threshold, packets are dropped based on the drop probability. This is the identical treatment a packet receives when WRED is enabled without ECN configured on the router.
 
Topology
Simple configuration of ECN
Configuring ECN on L3 Interface
Do the following to configure ECN on anL3 interface.
 
#configure terminal
Enter inside configure mode
(config)#qos enable
Enable QoS on configuration mode.
(config)#qos statistics Enable
QoS statistics on configuration mode.
(config)#class-map match-any cmap
Enter Class-map mode
(cmap-qos-match-any-mode)#match precedence 3
Configure match criteria as precedence with Value 3
(config-pmap-qos)#policy-map pmap
Enter policy-map mode
(config-pmap-qos)#class cmap
Assign Class cmap to Policy-map pmap
(cmap-qos-match-any-mode)#match precedence 3
Configure match criteria as precedence with Value 3
(config-pmap-qos)#policy-map pmap
Enter policy-map mode
(config-pmap-qos)#class cmap
Assign Class cmap to Policy-map pmap
(config-pmap-c-qos)# police cir 328 mbps pir 556 mbps conform transmit exceed transmit violate transmit
Police Precedence 3 frames @ Committed information rate of 328 mbps and pir 556 mbps conform transmit exceed transmit violate transmit.
(config-pmap-c-qos)#end
Exit out of policy-class-map mode
#configure terminal
Enter inside configure mode
(config)#interface xe29
Enter interface mode
(config-if)#service-policy type qos input pmap
Assign service-policy to interface on in-direction
(config-if)#exit
Exit interface mode
(config)#policy-map type queuing default xyz
Enter policy-map queuing mode
(config-pmap-que-def)#class type queuing default q3
Enter class-map type queuing
(config-pmap-c-que-def)#shape percent 80
Configure shape percent 80 in q3
(config-pmap-c-que-def)# random-detect min-threshold 100 max-threshold 200 packets ecn
Configure ECN with Random Early Detection which includes minimum and maximum threshold in packets
#configure terminal
Enter configure mode
(config)#interface xe30
Enter interface mode
(config-if)#service-policy type queuing output xyz
Attach policy on egress interface
OcNOS(config-if)#exit
Exit configure mode
Validation
Enter the commands listed in the sections below to confirm the configurations.
OcNOS#show policy-map interface xe30
Interface xe30
Global statistics status : enabled
Service-policy (queuing) output: xyz
-----------------------------------
Class-map (queuing): q0
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q1
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q2
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q3
shape percent 80
priority level 1
random-detect min-threshold 100 max-threshold 200 packets ecn
output : 44808 packets, 67210500 bytes
dropped : 10516 packets, 15774000 bytes
Class-map (queuing): q4
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q5
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q6
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q7
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q0
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q2
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q3
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q4
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q5
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q6
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q7
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Wred Drop Statistics:
green : 0 packets
yellow : 0 packets
red : 0 packets
 
 
Topology
Simple configuration of ECN
Configuring ECN on L2 Interface
Do the following to configure ECN on anL2 interface.
 
#configure terminal
Enter inside configure mode
(config)#bridge 1 protocol mstp
Configure bridge 1 as MSTP aware
(config)#interface xe29
Enter interface mode
(config-if)#switchport
Configure xe29 as a layer 2 port
(config-if)#bridge-group 1
Associate bridge to an interface
(config-if)#switchport mode trunk
Configure port as trunk
(config-if)#switchport trunk allowed vlan all
Allow all the vlan on the interface xe29
(config-if)#exit
Exit the xe29 interface mode
(config)#interface xe30
Enter interface mode
(config-if)#switchport
Configure xe30 as a layer 2 port
(config-if)#bridge-group 1
Associate bridge to an interface
(config-if)#switchport mode trunk
Configure port as trunk
(config-if)#switchport trunk allowed vlan all
Allow all the vlan on the interface xe30
(config-if)#exit
Exit the xe30 interface mode
(config)#qos enable
Enable QoS on configuration mode
(config)#qos statistics
Enable QoS statistics on configuration mode
(config)#class-map match-any cmap
Enter Class-map mode
(cmap-qos-match-any-mode)#match precedence 3
Configure match criteria as precedence with Value 3
(config-pmap-qos)#policy-map pmap
Enter policy-map mode
(config-pmap-qos)#class cmap
Assign Class cmap to Policy-map pmap
(config-pmap-c-qos)# police cir 328 mbps pir 556 mbps conform transmit exceed transmit violate transmit
Police Precedence 3 frames @ Committed information rate of 328 mbps and pir 556 mbps conform transmit exceed transmit violate transmit.
(config-pmap-c-qos)#end
Exit out of policy-class-map mode
#configure terminal
Enter inside configure mode
(config)#interface xe29
Enter interface mode
(config-if)#trust dscp
Configure trust DSCP on the interface xe29
(config-if)#service-policy type qos input pmap
Assign service-policy to interface on in-direction
(config-if)#exit
Exit interface mode
(config)#policy-map type queuing default xyz
Enter policy-map queuing mode
(config-pmap-que-def)#class type queuing default q3
Enter class-map type queuing
(config-pmap-c-que-def)#shape average 900 mbps
Configure shape average 900 in q3
(config-pmap-c-que-def)#random-detect green 1000 2000 yellow 3000 4000 red 5000 6000 bytes ecn
Configure ECN with Random Early Detection which includes minimum and maximum threshold for green, yellow and red packets
(config-pmap-c-que-def)#end
Exit pmap mode
#configure terminal
Enter configure mode
(config)#interface xe30
Enter interface mode
(config-if)#service-policy type queuing output xyz
Attach policy on egress interface
OcNOS(config-if)#exit
Exit configure mode
Validation
Enter the commands listed in the sections below to confirm the configurations.
OcNOS#show policy-map interface xe30
Interface xe30
Global statistics status : enabled
Service-policy (queuing) output: xyz
-----------------------------------
Class-map (queuing): q0
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q1
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q2
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q3
shape average 900 mbps
priority level 1
random-detect green min-threshold 1000 max-threshold 2000 yellow minimu
m-threshold 3000 max-threshold 4000 red min-threshold 5000 maximum-thres
hold 6000 bytes ecn
output : 308318 packets, 462477000 bytes
dropped : 29774 packets, 44661000 bytes
Class-map (queuing): q4
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q5
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q6
priority level 1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q7
priority level 1
output : 3 packets, 369 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q0
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
 
Class-map (queuing): mc-q1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q2
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q3
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q4
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q5
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q6
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q7
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Wred Drop Statistics :
----------------------
green : 0 packets
yellow : 0 packets
red : 0 packets