Skip to content
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

lag: Support M:M MLAG topologies #1604

Merged
merged 31 commits into from
Dec 9, 2024
Merged

lag: Support M:M MLAG topologies #1604

merged 31 commits into from
Dec 9, 2024

Conversation

jbemmel
Copy link
Collaborator

@jbemmel jbemmel commented Dec 3, 2024

  • Enables 3 lag scenarios: 1:1 regular lag, 1:2 mlag and 2:2 dual mlag
  • Include lag.ifindex attributes on interfaces
  • Check node devices being the same for peerlinks
  • Add check for peerlink when MLAG is used

Fixes #1602

To be discussed:

  • Most intuitive name for peer group id - currently "lag.mlag.peergroup" but could also be "peerlink" or plain "lag.mlag.id"
  • Include explicit mlag flag or not? Currently left out
  • Should we calculate the set of vlans to temporarily trunk across peerlinks, to enable correct address allocation?

@jbemmel jbemmel requested a review from ipspace December 3, 2024 00:29
@ipspace
Copy link
Owner

ipspace commented Dec 3, 2024

The 'determine_mlag_sides' function makes my head explode. There must be an easier way to get that done.

Its sole purpose is to figure out which nodes are on the left- and the right- side of the bundle, right?

@jbemmel
Copy link
Collaborator Author

jbemmel commented Dec 3, 2024

The 'determine_mlag_sides' function makes my head explode. There must be an easier way to get that done.

Its sole purpose is to figure out which nodes are on the left- and the right- side of the bundle, right?

Probably because it's done incrementally, we could do it in one shot upfront:

  • For all members, count how often each node appears
  • If there is 1 node that occurs as many times as there are members, that's the unique "1" side node of an mlag
  • If there are 2 such nodes, it's a regular lag
  • Else, it's a M:M mlag (absent self-links which should report an error)

Note that we could auto-detect the user's intent, without requiring a mlag: True flag.
However, I kind of like the explicit flag in the configuration - makes it more clear. Any preference?

@jbemmel jbemmel marked this pull request as draft December 3, 2024 18:52
@jbemmel jbemmel marked this pull request as ready for review December 5, 2024 06:17
Copy link
Owner

@ipspace ipspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't review this. The diffs are a spaghetti mess. I will make a few suggestions and after you look at them merge it as-is (it shouldn't break anything else anyway) and then maybe take a look at individual functions.

Copy link
Owner

@ipspace ipspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least the documentation should be changed to include the diagram.

docs/module/lag.md Outdated Show resolved Hide resolved
docs/module/lag.md Show resolved Hide resolved
netsim/modules/lag.py Outdated Show resolved Hide resolved
netsim/modules/lag.py Outdated Show resolved Hide resolved
netsim/modules/lag.py Show resolved Hide resolved
netsim/modules/lag.py Outdated Show resolved Hide resolved
@jbemmel jbemmel marked this pull request as draft December 8, 2024 21:47
@jbemmel jbemmel marked this pull request as ready for review December 8, 2024 22:54
@@ -84,7 +84,8 @@ def normalized_members(l: Box, topology: Box, peerlink: bool = False) -> list:
for idx,member in enumerate(l.lag.members):
member = links.adjust_link_object(member,f'{l._linkname}.{_name}[{idx+1}]',topology.nodes)
if 'lag' in member: # Catch potential sources for inconsistency
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, list(member.lag.keys()) == ['ifindex'] would be way easier to understand, but whatever.

@ipspace ipspace merged commit 0ab7211 into ipspace:dev Dec 9, 2024
5 checks passed
@ipspace
Copy link
Owner

ipspace commented Dec 9, 2024

Merged as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LAG: Support M:N MLAG configurations
2 participants