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

PIMD: Implement AutoRP mapping-agent #17340

Merged
merged 4 commits into from
Nov 21, 2024
Merged

Conversation

nabahr
Copy link
Contributor

@nabahr nabahr commented Nov 5, 2024

This PR completes the implementation of AutoRP by adding support for the AutoRP mapping-agent. The mapping-agent listens for AutoRP candidate RP announcement messages, resolves the available RP's and group prefixes, and advertises them to all AutoRP routers via the AutoRP discovery message.
With this addition, testing the complete AutoRP protocol can be performed within FRR without sending hardcoded packet formats, so all AutoRP testing was refactored and expanded to test all functions of AutoRP.
The whole AutoRP protocol implementation was fully flushed out and bugs were fixed that were found during testing.

@frrbot frrbot bot added pim tests Topotests, make check, etc yang labels Nov 5, 2024
@nabahr nabahr force-pushed the mapping-agent branch 3 times, most recently from 35f5550 to ed02451 Compare November 5, 2024 05:04
pimd/pim_autorp.c Outdated Show resolved Hide resolved
Copy link
Member

@rzalamena rzalamena left a comment

Choose a reason for hiding this comment

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

Overall PR looks good, I'd just reevaluate the usage of if (debug) conditionals when trying to log things that could disrupt the protocol operation so the operator can act on it (e.g. find out about bogus neighbors or local unexpected action).

pimd/pim_nb_config.c Outdated Show resolved Hide resolved
case NB_EV_APPLY:
vrf = nb_running_get_entry(args->dnode, NULL, true);
pim = vrf->info;
if (pim && pim->autorp) {
Copy link
Member

Choose a reason for hiding this comment

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

If pim->autorp doesn't exist how or when does it retrieve the value later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only way pim->autorp wouldn't exist if pim exists is if allocation and initialization of AutoRP failed when pim is enabled in a VRF. I left the check in but added an error return in the else condition.

}

DEFPY (pim_autorp_announce_scope_int,
pim_autorp_announce_scope_int_cmd,
"[no] autorp announce ![{scope (1-255) | interval (1-65535) | holdtime (0-65535)}]",
"[no] autorp announce {scope (1-255) | interval (1-65535) | holdtime (0-65535)}",
Copy link
Member

Choose a reason for hiding this comment

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

Is this intentional? Now the no command must receive arguments to be executed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Configuring AutoRP announcements (i.e. candidate RP's) was broken up in two commands:

[no] autorp announce RPADDR ![GROUP_PREFIX | group-list PREFIX_LIST] 
[no] autorp announce {scope (1-255) | interval (1-65535) | holdtime (0-65535)}

I found it confusing to allow the command no autorp announce which, as it was previously, would only reset the scope, interval, and holdtime back to defaults instead of disabling announcements altogether.
I could update that command to disable announcements completely, but I've also got work in progress that fixes the AutoRP candidate RP configuration to be consistent with how the BSR candidate RP is configured which would make this OBE.

AutoRP candidate RP announcements can still be disabled by individually disabling the configured candidate RPs.

pimd/pim_autorp.c Outdated Show resolved Hide resolved
pimd/pim_autorp.c Outdated Show resolved Hide resolved
pimd/pim_autorp.c Outdated Show resolved Hide resolved
pimd/pim_autorp.c Outdated Show resolved Hide resolved
pimd/pim_autorp.c Outdated Show resolved Hide resolved
pimd/pim_autorp.c Outdated Show resolved Hide resolved
pimd/pim_autorp.c Outdated Show resolved Hide resolved
@github-actions github-actions bot added the rebase PR needs rebase label Nov 19, 2024
Reuses the candidate selection logic from BSR configuration

Signed-off-by: Nathan Bahr <[email protected]>
Also exposes BSR cand_addrsel methods for use in AutoRP.

Signed-off-by: Nathan Bahr <[email protected]>
Fully flushed out the AutoRP implementation now with the AutoRP mapping agent.
This touched most of AutoRP in order to have common reuse of containers for each
section of AutoRP operation (Candidate RP announcement, Mapping agent, Discovery).
Many debugs had guards added and many more debug logs added.

Signed-off-by: Nathan Bahr <[email protected]>
Now with a full AutoRP implementation, we can test AutoRP in a full network setup
beginning with candidate RP announcements all the way through discovery and active RP
selection.

Signed-off-by: Nathan Bahr <[email protected]>
@nabahr
Copy link
Contributor Author

nabahr commented Nov 19, 2024

Overall PR looks good, I'd just reevaluate the usage of if (debug) conditionals when trying to log things that could disrupt the protocol operation so the operator can act on it (e.g. find out about bogus neighbors or local unexpected action).

I re-read the dev guide on logging and went through and fixed that all up so it should be better now.

@nabahr
Copy link
Contributor Author

nabahr commented Nov 19, 2024

The new Verify Source failure is because of the addition of the #define pim6_autorp_err(funcname, argtype) macro, which is modeled after the pim6_msdp_err macro. So I assume it can be ignored.

@nabahr nabahr requested review from rzalamena and Jafaral November 20, 2024 02:34
@rzalamena rzalamena merged commit a3e04a8 into FRRouting:master Nov 21, 2024
10 of 11 checks passed
@nabahr nabahr deleted the mapping-agent branch December 12, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
master pim rebase PR needs rebase size/XXL tests Topotests, make check, etc yang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants