In addition to the ES service-carving modes auto and off, the manual mode also supports the preference-based algorithm with the non-revertive option, as described in draft-rabadan-bess-evpn-pref-df.
When ES is configured to use the preference-based algorithm, the ES route is advertised with the Designated Forwarder (DF) election extended community (sub-type 0x06). Figure 1 shows the DF election extended community.
In the extended community, a DF type 2 preference algorithm is advertised with a 2-byte preference value (32767 by default) if the preference-based manual mode is configured. The Don't Preempt Me (DP) bit is set if the non-revertive option is enabled.
The following CLI excerpt shows the relevant commands to enable the preference-based DF election on a specific ES (regular or virtual):
config>service>system>bgp-evpn>ethernet-segment#
...
service-carving mode {manual|auto|off}
service-carving manual
[no] preference [create] [non-revertive]
value <value>
exit
[no] evi <evi> [to <evi>]
[no] isid <isid> [to <isid>]
# value 0..65535; default 32767
...
Where:
The preference value can be changed on an active ES without shutting down the ES, and therefore, a new DF can be forced for maintenance or other reasons.
The service-carving mode must be changed to manual mode to create the preference context.
The preference command is supported on regular or virtual ES, regardless of the multi-homing mode (single-active or all-active) or the service type (VPLS, I-VPLS, or Epipe).
By default, the highest-preference PE in the ES becomes the DF for an EVI or ISID, using the DP bit as the tiebreaker first (DP=1 wins over DP=0) and the lowest PE-IP as the last-resort tiebreaker. All the explicitly configured EVI or ISID ranges select the lowest preference PE as the DF (whereas the non-configured EVI or ISID values select the highest preference PE).
This selection is displayed as Cfg Range Type: lowest-pref in the following show command example.
*A:PE-2# show service system bgp-evpn ethernet-segment name "vES-23"
===============================================================================
Service Ethernet Segment
===============================================================================
Name : vES-23
Eth Seg Type : Virtual
Admin State : Enabled Oper State : Up
ESI : 01:23:23:23:23:23:23:23:23:23
Multi-homing : allActive Oper Multi-homing : allActive
ES SHG Label : 262141
Source BMAC LSB : 00-23
ES BMac Tbl Size : 8 ES BMac Entries : 0
Lag Id : 1
ES Activation Timer : 3 secs (default)
Svc Carving : manual Oper Svc Carving : manual
Cfg Range Type : lowest-pref
-------------------------------------------------------------------------------
DF Pref Election Information
-------------------------------------------------------------------------------
Preference Preference Last Admin Change Oper Pref Do No
Mode Value Value Preempt
-------------------------------------------------------------------------------
non-revertive 100 12/21/2016 15:16:38 100 Enabled
-------------------------------------------------------------------------------
EVI Ranges: <none>
ISID Ranges: <none>
===============================================================================
The EVI and ISID ranges configured on the service-carving context are not required to be consistent with any ranges configured for vESs.
If the non-revertive option is configured, when the former DF comes back up after a failure and checks existing ES routes, it advertises an operational preference and DP bit, which does not cause a DF switchover for the ES EVI/ISID values.
The following configuration example shows the use of the preference-based algorithm and non-revertive option in an ES defined in PE1 and PE2.
*A:PE-1>config>service>system>bgp-evpn# info
----------------------------------------------
ethernet-segment "ES1" create
esi 01:00:00:00:00:12:00:00:00:01
service-carving manual
preference non-revertive create
value 10000
exit
evi 2001 to 4000
exit
multi-homing single-active
port 1/1/1
no shutdown
/* example of vpls 1 - similar config exists for evis 2-4000 */
*A:PE-1>config>service>vpls# info
----------------------------------------------
vxlan vni 1 create
exit
bgp-evpn
evi 1
mpls bgp 1
ecmp 2
auto-bind-tunnel
resolution any
exit
sap 1/1/1:1 create
no shutdown
----------------------------------------------
*A:PE-2>config>service>system>bgp-evpn# info
----------------------------------------------
ethernet-segment "ES1" create
esi 01:00:00:00:00:12:00:00:00:01
service-carving manual
preference non-revertive create
value 5000
exit
evi 2001 to 4000
exit
multi-homing single-active
port 1/1/1
no shutdown
*A:PE-2>config>service>vpls# info
----------------------------------------------
vxlan vni 1 create
exit
bgp-evpn
evi 1
mpls bgp 1
ecmp 2
auto-bind-tunnel
resolution any
exit
sap 1/1/1:1 create
no shutdown
----------------------------------------------
Based on the configuration in the preceding example, the PE behavior is as follows:
Assuming the ES is no shutdown on both PE1 and PE2, the PEs exchange ES routes, including the [Pref, DP-bit] in the DF election extended community.
For EVIs 1 to 2000, PE2 is immediately promoted to NDF, whereas PE1 becomes the DF, and (following the es-activation-timer) brings up its SAP in EVIs 1 to 2000.
For EVIs 2001 to 4000, the result is the opposite and PE2 becomes the DF.
If port 1/1/1 on PE1 goes down, PE1 withdraws its ES route and PE2 becomes the DF for EVIs 1 to 2000.
When port 1/1/1 on PE1 comes back up, PE1 compares its ES1 preference with the preferences in the remote PEs in ES1. PE1 advertises the ES route with an ‟in-use operational” Pref = 5000 and DP=0. Because PE2's Pref is the same as PE1's operational value, but PE2's DP=1, PE2 continues to be the DF for EVIs 1 to 4000.
Note: The DP bit is the tiebreaker in case of equal Pref and regardless of the choice of highest or lowest preference algorithm.
PE1's ‟in-use” Pref and DP continue to be [5000,0] until one of the following conditions is true:
PE2 withdraws its ES route, in which case PE1 re-advertises its admin Pref and DP [10000,DP=1]
The user changes PE1's Pref configuration