-
Notifications
You must be signed in to change notification settings - Fork 103
ESI-LAG: Initial draft implementation #2425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1932204
ESI-LAG: Initial draft implementation
ssasso d05bfa4
FRR: support for ESI-LAG
ssasso 24002c9
ESI: move implementation to plugin
ssasso cf54023
Update LAG transformation tests
ssasso cb99679
Allow evpn.es attribute on interfaces when connected to vlan
ssasso 1acface
EVPN ESI: finalized plugin data model
ssasso 1a764f5
evpn.es: improved validation and junos template
ssasso 977207e
Finalize basic plugin for evpn.es
ssasso d390618
removed old comments from junos evpn.es
ssasso bb65d36
evpn.multihoming updates based on feedbacks
ssasso fbaa4c2
ESI LAG on cumulus_nvue
ssasso b7aa207
evpn.multihoming: updating doc for cumulus
ssasso 7390ad4
EVPN Multihoming: allow netlab to auto generate IDs
ssasso 0b4b83d
LAG: update intf_to_neighbor
ssasso bed13eb
evpn.multihoming: update plugin code with suggestions
ssasso c643093
Streamline box-handling code
ipspace File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| (plugin-evpn-multihoming)= | ||
| # EVPN Multihoming (EVPN Ethernet Segment) | ||
|
|
||
| This plugin allows for simple EVPN Ethernet Segment configuration, also know as EVPN Multihoming. | ||
|
|
||
| For now, the plugin supports: | ||
| * ES definition on LAG or "physical" interfaces (depending on platform support) | ||
| * Only `all-active` multihoming | ||
| * Manual or Auto-Generated (based on LACP) Ethernet Segment Identifier | ||
|
|
||
| ## Supported Platforms | ||
|
|
||
| The plugin includes Jinja2 templates for the following platforms: | ||
|
|
||
| | Operating system | ES on LAG (ESI-LAG) | ES on other interfaces | Auto ESI | | ||
| | ------------------- | :--: | :--: | :--: | | ||
| | Arista EOS | ✅ | ✅ | ✅ | | ||
| | Cumulus NVUE | ✅ | ❌ | ❌ | | ||
| | vJunos Switch | ✅ | ✅ | ✅ | | ||
|
|
||
|
|
||
| ## Using the Plugin (auto mode) | ||
|
|
||
| * Add `plugin: [ evpn.multihoming ]` to the lab topology. | ||
| * Include the **evpn.es** attribute in the device interface | ||
|
|
||
| netlab will generate, for each *Ethernet Segment*, ESI value (*Ethernet Segment ID*) and LACP System ID (for *ESI-LAG*). | ||
|
|
||
| **NOTE**: Ethernet Segments ID will be generated starting from an integer value, which will be used as the first 5 most significant bytes (excluding the initial `0x00`). This is to: | ||
|
|
||
| * be able to generate a 6-bytes LACP System ID starting with `0x02`. | ||
| * be able to generate unique *ES-Import* target for each auto generated ESI value. | ||
|
|
||
| ## Using the Plugin (manual mode) | ||
|
|
||
| It is also possible to manually define ESI values for your *Ethernet Segments*. In that case: | ||
|
|
||
| * Add `plugin: [ evpn.multihoming ]` to the lab topology. | ||
| * Define a set of *ethernet segments* on the topology top-level | ||
| * Include the **evpn.es** attribute in the device interface | ||
|
|
||
| **NOTE**: EVPN Multihoming, for ESI-LAG, requires that all LAG interfaces belonging to the same *ethernet segment* share the same (unique) LACP System ID. This can be achieved using the `lag.lacp_system_id` attribute - which can accept a "real" mac address value or an integer (*1-65535*) value: in that case it will generate a mac value in the format `02:xx:yy:xx:yy:00` (i.e., `1` will become `02:00:01:00:01:00`). | ||
|
|
||
| ### Supported attributes | ||
|
|
||
| The plugin adds the following attributes defined at topology level: | ||
| * **evpn.ethernet_segments** (dict) -- Key is the **ethernet segment** name. Each item is a *dict* with the following attributes: | ||
| * **id** (esi_id, mandatory) -- ESI in format `00:XX:XX:XX:XX:XX:XX:XX:XX:XX` (only Type-0 ESI is supported for now) | ||
| * **auto** (bool) -- Use ESI auto generation based on LACP System ID. If both `id` and `auto` are specified, explicit `id` takes over. | ||
|
|
||
| Interface level attributes: | ||
| * **evpn.es** (str) -- ethernet segment name (can be defined on `evpn.ethernet_segments`). | ||
|
|
||
| ## Example (auto mode) | ||
|
|
||
| ``` | ||
| plugin: [ 'evpn.multihoming' ] | ||
|
|
||
| bgp.as: 65000 | ||
|
|
||
| groups: | ||
| _auto_create: true | ||
| switches: | ||
| members: [ s1, s2 ] | ||
| module: [ vlan, vxlan, ospf, bgp, evpn, lag ] | ||
| probes: | ||
| members: [ x1 ] | ||
| module: [ lag, vlan ] | ||
| device: eos | ||
| hosts: | ||
| members: [ h1, h2, h3 ] | ||
| device: linux | ||
| provider: clab | ||
|
|
||
| vlans: | ||
| red: | ||
| mode: bridge | ||
| links: [ h1-x1, h2-s1, h3-s2 ] | ||
|
|
||
| links: | ||
| # EVPN/VXLAN Switch to Switch Link | ||
| - s1: | ||
| s2: | ||
| mtu: 1600 | ||
| # ESI-LAG | ||
| - lag: | ||
| members: | ||
| - s1: | ||
| evpn.es: seg_1 | ||
| x1: | ||
| - s2: | ||
| evpn.es: seg_1 | ||
| x1: | ||
| vlan.access: red | ||
| ``` | ||
|
|
||
| ## Example (manual mode) | ||
|
|
||
| ``` | ||
| plugin: [ 'evpn.multihoming' ] | ||
|
|
||
| bgp.as: 65000 | ||
|
|
||
| evpn.ethernet_segments: | ||
| seg_1.id: 00:11:22:33:44:55:66:77:88:99 | ||
|
|
||
| groups: | ||
| _auto_create: true | ||
| switches: | ||
| members: [ s1, s2 ] | ||
| module: [ vlan, vxlan, ospf, bgp, evpn, lag ] | ||
| probes: | ||
| members: [ x1 ] | ||
| module: [ lag, vlan ] | ||
| device: eos | ||
| hosts: | ||
| members: [ h1, h2, h3 ] | ||
| device: linux | ||
| provider: clab | ||
|
|
||
| vlans: | ||
| red: | ||
| mode: bridge | ||
| links: [ h1-x1, h2-s1, h3-s2 ] | ||
|
|
||
| links: | ||
| # EVPN/VXLAN Switch to Switch Link | ||
| - s1: | ||
| s2: | ||
| mtu: 1600 | ||
| # ESI-LAG | ||
| - lag: | ||
| members: | ||
| - s1: | ||
| lag.lacp_system_id: 1 | ||
| evpn.es: seg_1 | ||
| x1: | ||
| - s2: | ||
| lag.lacp_system_id: 1 | ||
| evpn.es: seg_1 | ||
| x1: | ||
| vlan.access: red | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| {% for i in interfaces if i.type == 'lag' and i.evpn._esi is defined %} | ||
| {% if loop.first %} | ||
| - set: | ||
| evpn: | ||
| enable: on | ||
| multihoming: | ||
| enable: on | ||
| startup-delay: 1 | ||
| mac-holdtime: 30 | ||
| neighbor-holdtime: 30 | ||
| interface: | ||
| {% endif %} | ||
| {{ i.ifname }}: | ||
| evpn: | ||
| multihoming: | ||
| segment: | ||
| enable: on | ||
| mac-address: {{i.lag.lacp_system_id}} | ||
| identifier: {{i.evpn._esi.id}} | ||
| {% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # evpn.multihoming: Support EVPN Multihoming (Ethernet Segments) | ||
| # | ||
| --- | ||
| devices: | ||
| vjunos-switch: | ||
| features.evpn.multihoming: | ||
| # support ES definition on LAG interfaces (ESI-LAG) | ||
| lag: true | ||
| # support ES definition on "standard" ethernet interfaces | ||
| interface: true | ||
| # ESI Auto value based on LACP System ID | ||
| esi_auto: true | ||
| modes: [ 'all-active' ] # not used yet | ||
| eos: | ||
| features.evpn.multihoming: | ||
| lag: true | ||
| interface: true | ||
| esi_auto: true | ||
| modes: [ 'all-active' ] # not used yet | ||
| cumulus_nvue: | ||
| features.evpn.multihoming: | ||
| lag: true | ||
| interface: false | ||
| esi_auto: false | ||
| modes: [ 'all-active' ] # not used yet | ||
| # for validation | ||
| none: | ||
| features.evpn.multihoming: | ||
| # support ES definition on LAG interfaces (ESI-LAG) | ||
| lag: true | ||
| # support ES definition on "standard" ethernet interfaces | ||
| interface: true | ||
| # ESI Auto value based on LACP System ID | ||
| esi_auto: true | ||
| modes: [ 'all-active' ] # not used yet | ||
|
|
||
|
|
||
| # data model: | ||
| # -- global: evpn.ethernet_segments | ||
| # -- on interface: es: xxx (must be a valid ethernet_segment reference) | ||
| evpn: | ||
| attributes: | ||
| global: | ||
| ethernet_segments: | ||
| type: dict | ||
| _keytype: id | ||
| _subtype: _es_item | ||
| node: | ||
| ethernet_segments: { copy: global } | ||
| interface: | ||
| es: id | ||
| # specific attributes | ||
| _es_item: | ||
| auto: bool | ||
| id: esi_value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| {% for intf in interfaces if intf.evpn._esi is defined %} | ||
| interface {{ intf.ifname }} | ||
| evpn ethernet-segment | ||
| {% if intf.evpn._esi.auto|default(false) %} | ||
| identifier auto lacp | ||
| {% else %} | ||
| {# Arista wants it in format: 0000:0000:0000:0000:0000 (generated by device quirk) #} | ||
| identifier {{intf.evpn._esi._eos_id}} | ||
| {% endif %} | ||
| ! | ||
| {% endfor %} | ||
| ! | ||
| router bgp {{ bgp.as }} | ||
| address-family evpn | ||
| route type ethernet-segment route-target auto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/bin/bash | ||
|
|
||
| {### STILL NOT WORKING - to be better investigated ###} | ||
|
|
||
| # ESI-LAG config in FRR | ||
| cat >/tmp/esi_lag_config <<CONFIG | ||
| evpn mh startup-delay 1 | ||
| ! | ||
| {% for intf in interfaces if intf.type == 'lag' and intf.evpn._esi is defined %} | ||
| interface {{ intf.ifname }} | ||
| evpn mh es-id {{intf.evpn._esi.id}} | ||
| ! | ||
| {% endfor %} | ||
| ! | ||
| do write | ||
| CONFIG | ||
| vtysh -f /tmp/esi_lag_config | ||
| vtysh -c 'clear bgp *' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.