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

PIM candidate BSR/RP support #16438

Merged
merged 8 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions doc/user/pim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,41 @@ PIM Routers
cannot see data flowing in better than 30 second chunks. This command is
vrf aware, to configure for a vrf, specify the vrf in the router pim block.

.. clicmd:: bsr candidate-bsr [priority (0-255)] [source [address A.B.C.D] | [interface INTERFACE] | [loopback] | [any]]

Configure the router to advertise itself as a candidate PIM-SM BSR. The candidate
with the highest priority becomes the BSR for the domain (high wins). When priority is the
same for more than one candidate BSR, the candidate with the highest IP address
becomes the BSR of the domain. The address can be configured explicitly
via ``address``, or be selecting an interface name using ``interface``.
If ``any`` is configured the highest address from any interface will be selected.
By default, the highest loopback address is selected, which can also be
configured via ``loopback``

.. clicmd:: bsr candidate-rp [interval]

Configure the router to advertise itself as a candidate PIM-SM RP at the
specified ``interval`` in seconds.


.. clicmd:: bsr candidate-rp group A.B.C.D/M

Configure the multicast group prefix that this candidate RP advertises itself for.
This command can be repeated for all desired groups that need to be added to the
candidate RP advertisement.

.. clicmd:: bsr candidate-rp [priority (0-255)] [source [address A.B.C.D] | [interface INTERFACE] | [loopback] | [any]]

Configure the router to advertise itself as a candidate PIM-SM RP. ``interval``
can be used to configure the interval in seconds to send these advertisements.
The candidate with the lowest priority becomes the RP for the domain (low wins).
When priority is the same for more than one candidate RP, the candidate with
the highest IP address becomes the BSR of the domain. The address can be
configured explicitly via ``address``, or be selecting an interface name
using ``interface``. If ``any`` is configured the highest address from any
interface will be selected.By default, the highest loopback address is
selected, which can also be configured via ``loopback``.

.. clicmd:: register-accept-list PLIST

When pim receives a register packet the source of the packet will be compared
Expand Down Expand Up @@ -611,11 +646,28 @@ cause great confusion.
Display PIM MLAG (multi-chassis link aggregation) session status and
control message statistics.

.. clicmd:: show ip pim bsr
.. clicmd:: show ip pim bsr [vrf NAME] [json]

Display current bsr, its uptime and last received bsm age.

.. clicmd:: show ip pim bsrp-info [vrf NAME] [json]
.. clicmd:: show ip pim bsr candidate-bsr [vrf NAME] [json]

Display information about the candidate BSR state on this router.

.. clicmd:: show ip pim bsr candidate-rp [vrf NAME] [json]

Display information about the candidate RP state on this router.

.. clicmd:: show ip pim bsr candidate-rp-database [vrf NAME] [json]

Display the current list of candidate RPs received by this router.

.. clicmd:: show ip pim bsr groups [vrf NAME] [json]

Display the current list of multicast group mapping received by
this router from candidate RPs.

.. clicmd:: show ip pim bsr rp-info [vrf NAME] [json]

Display group-to-rp mappings received from E-BSR.

Expand Down
44 changes: 42 additions & 2 deletions doc/user/pimv6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,29 @@ PIMv6 Router
cannot see data flowing in better than 30 second chunks. This command is
vrf aware, to configure for a vrf, specify the vrf in the router pim6 block.

.. clicmd:: bsr candidate-bsr [priority (0-255)] [source [address X:X::X:X] | [interface INTERFACE] | [loopback] | [any]]

Configure the router to advertise itself as a candidate PIM-SM BSR. The candidate
with the highest priority becomes the BSR for the domain (high wins). When priority is the
same for more than one candidate BSR, the candidate with the highest IP address
becomes the BSR of the domain. The address can be configured explicitly
via ``address``, or be selecting an interface name using ``interface``.
If ``any`` is configured the highest address from any interface will be selected.
By default, the highest loopback address is selected, which can also be
configured via ``loopback``

.. clicmd:: bsr candidate-rp [interval (1-4294967295) ] [priority (0-255)] [source [address X:X::X:X] | [interface INTERFACE] | [loopback] | [any]]

Configure the router to advertise itself as a candidate PIM-SM RP. ``interval``
can be used to configure the interval in seconds to send these advertisements.
The candidate with the lowest priority becomes the RP for the domain (low wins).
When priority is the same for more than one candidate RP, the candidate with
the highest IP address becomes the BSR of the domain. The address can be
configured explicitly via ``address``, or be selecting an interface name
using ``interface``. If ``any`` is configured the highest address from any
interface will be selected.By default, the highest loopback address is
selected, which can also be configured via ``loopback``.

.. clicmd:: spt-switchover infinity-and-beyond [prefix-list PLIST]

On the last hop router if it is desired to not switch over to the SPT tree
Expand Down Expand Up @@ -391,11 +414,28 @@ General multicast routing state
Display total number of S,G mroutes and number of S,G mroutes
installed into the kernel for all vrfs.

.. clicmd:: show ipv6 pim bsr
.. clicmd:: show ipv6 pim bsr [vrf NAME] [json]

Display current bsr, its uptime and last received bsm age.

.. clicmd:: show ipv6 pim bsrp-info [vrf NAME] [json]
.. clicmd:: show ipv6 pim bsr candidate-bsr [vrf NAME] [json]
Jafaral marked this conversation as resolved.
Show resolved Hide resolved

Display information about the candidate BSR state on this router.

.. clicmd:: show ipv6 pim bsr candidate-rp [vrf NAME] [json]

Display information about the candidate RP state on this router.

.. clicmd:: show ipv6 pim bsr candidate-rp-database [vrf NAME] [json]

Display the current list of candidate RPs received by this router.

.. clicmd:: show ipv6 pim bsr groups [vrf NAME] [json]

Display the current list of multicast group mapping received by
this router from candidate RPs.

.. clicmd:: show ipv6 pim bsr rp-info [vrf NAME] [json]

Display group-to-rp mappings received from E-BSR.

Expand Down
147 changes: 147 additions & 0 deletions pimd/pim6_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,62 @@ DEFPY (no_ipv6_pim_ucast_bsm,
return pim_process_no_unicast_bsm_cmd(vty);
}

DEFPY (pim6_bsr_candidate_bsr,
pim6_bsr_candidate_bsr_cmd,
"[no] bsr candidate-bsr [{priority (0-255)|source <address X:X::X:X|interface IFNAME|loopback$loopback|any$any>}]",
NO_STR
BSR_STR
"Make this router a Candidate BSR\n"
"BSR Priority (higher wins)\n"
"BSR Priority (higher wins)\n"
"Specify IP address for BSR operation\n"
"Local address to use\n"
"Local address to use\n"
"Interface to pick address from\n"
"Interface to pick address from\n"
"Pick highest loopback address (default)\n"
"Pick highest address from any interface\n")
{
return pim_process_bsr_candidate_cmd(vty, FRR_PIM_CAND_BSR_XPATH, no,
false, any, ifname, address_str,
priority_str, NULL);
}

DEFPY (pim6_bsr_candidate_rp,
pim6_bsr_candidate_rp_cmd,
"[no] bsr candidate-rp [{priority (0-255)|interval (1-4294967295)|source <address X:X::X:X|interface IFNAME|loopback$loopback|any$any>}]",
NO_STR
"Bootstrap Router configuration\n"
"Make this router a Candidate RP\n"
"RP Priority (lower wins)\n"
"RP Priority (lower wins)\n"
"Advertisement interval (seconds)\n"
"Advertisement interval (seconds)\n"
"Specify IP address for RP operation\n"
"Local address to use\n"
"Local address to use\n"
"Interface to pick address from\n"
"Interface to pick address from\n"
"Pick highest loopback address (default)\n"
"Pick highest address from any interface\n")
{
return pim_process_bsr_candidate_cmd(vty, FRR_PIM_CAND_RP_XPATH, no,
true, any, ifname, address_str,
priority_str, interval_str);
}

DEFPY (pim6_bsr_candidate_rp_group,
pim6_bsr_candidate_rp_group_cmd,
"[no] bsr candidate-rp group X:X::X:X/M",
NO_STR
"Bootstrap Router configuration\n"
"Make this router a Candidate RP\n"
"Configure groups to become candidate RP for\n"
"Multicast group prefix\n")
{
return pim_process_bsr_crp_grp_cmd(vty, group_str, no);
}

DEFPY (pim6_ssmpingd,
pim6_ssmpingd_cmd,
"ssmpingd [X:X::X:X]$source",
Expand Down Expand Up @@ -1719,6 +1775,90 @@ DEFPY (show_ipv6_pim_secondary,
return pim_show_secondary_helper(vrf, vty);
}

DEFPY (show_ipv6_pim_bsr_cand_bsr,
show_ipv6_pim_bsr_cand_bsr_cmd,
"show ipv6 pim bsr candidate-bsr [vrf NAME$vrfname] [json$json]",
SHOW_STR
IPV6_STR
PIM_STR
BSR_STR
"Current PIM router candidate BSR state\n"
VRF_CMD_HELP_STR
JSON_STR)
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx, !!json);

if (!vrf || !vrf->info)
return CMD_WARNING;

return pim_show_bsr_cand_bsr(vrf, vty, !!json);
}

DEFPY (show_ipv6_pim_bsr_cand_rp,
show_ipv6_pim_bsr_cand_rp_cmd,
"show ipv6 pim bsr candidate-rp [vrf VRF_NAME] [json$json]",
SHOW_STR
IPV6_STR
PIM_STR
BSR_STR
"Current PIM router candidate RP state\n"
VRF_CMD_HELP_STR
JSON_STR)
{
struct vrf *vrf = pim_cmd_lookup(vty, vrf_name);

if (!vrf || !vrf->info)
return CMD_WARNING;

return pim_show_bsr_cand_rp(vrf, vty, !!json);
}

DEFPY (show_ipv6_pim_bsr_rpdb,
show_ipv6_pim_bsr_rpdb_cmd,
"show ipv6 pim bsr candidate-rp-database [vrf VRF_NAME] [json$json]",
SHOW_STR
IPV6_STR
PIM_STR
BSR_STR
"Candidate RPs database on this router (if it is the BSR)\n"
VRF_CMD_HELP_STR
JSON_STR)
{
struct vrf *vrf = pim_cmd_lookup(vty, vrf_name);

if (!vrf || !vrf->info)
return CMD_WARNING;

struct pim_instance *pim = vrf->info;
struct bsm_scope *scope = &pim->global_scope;

return pim_crp_db_show(vty, scope, !!json);
}

DEFPY (show_ipv6_pim_bsr_groups,
show_ipv6_pim_bsr_groups_cmd,
"show ipv6 pim bsr groups [vrf VRF_NAME] [json$json]",
SHOW_STR
IPV6_STR
PIM_STR
"boot-strap router information\n"
"Candidate RP groups\n"
VRF_CMD_HELP_STR
JSON_STR)
{
struct vrf *vrf = pim_cmd_lookup(vty, vrf_name);

if (!vrf || !vrf->info)
return CMD_WARNING;

struct pim_instance *pim = vrf->info;
struct bsm_scope *scope = &pim->global_scope;

return pim_crp_groups_show(vty, scope, !!json);
}


DEFPY (show_ipv6_pim_statistics,
show_ipv6_pim_statistics_cmd,
"show ipv6 pim [vrf NAME] statistics [interface WORD$word] [json$json]",
Expand Down Expand Up @@ -2650,6 +2790,9 @@ void pim_cmd_init(void)
install_element(PIM6_NODE, &no_pim6_rp_prefix_list_cmd);
install_element(PIM6_NODE, &pim6_ssmpingd_cmd);
install_element(PIM6_NODE, &no_pim6_ssmpingd_cmd);
install_element(PIM6_NODE, &pim6_bsr_candidate_rp_cmd);
install_element(PIM6_NODE, &pim6_bsr_candidate_rp_group_cmd);
install_element(PIM6_NODE, &pim6_bsr_candidate_bsr_cmd);

install_element(CONFIG_NODE, &ipv6_mld_group_watermark_cmd);
install_element(VRF_NODE, &ipv6_mld_group_watermark_cmd);
Expand Down Expand Up @@ -2705,6 +2848,10 @@ void pim_cmd_init(void)
install_element(VIEW_NODE, &show_ipv6_pim_rpf_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_rpf_vrf_all_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_secondary_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_bsr_cand_bsr_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_bsr_cand_rp_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_bsr_rpdb_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_bsr_groups_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_statistics_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_upstream_cmd);
install_element(VIEW_NODE, &show_ipv6_pim_upstream_vrf_all_cmd);
Expand Down
1 change: 1 addition & 0 deletions pimd/pim6_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ static const struct frr_yang_module_info *const pim6d_yang_modules[] = {
&frr_routing_info,
&frr_pim_info,
&frr_pim_rp_info,
&frr_pim_candidate_info,
&frr_gmp_info,
};

Expand Down
Loading
Loading