Skip to content

Commit

Permalink
pimd: Indicating the rp in the msdp sa message
Browse files Browse the repository at this point in the history
Indicating the configured PIM Rendezvous Point (RP) in the MSDP SA
message

The RFC-3618, section 12.2.1, describes the fields included in the MSDP
SA message. The "RP address" field is "the address of the RP in the
domain the source has become active in".

In the most common case, we will establish an MSDP connection from RP to
RP. However, there are cases where we want to establish a MSDP
connection from an interface/address that is not the RP. Section 3 of
RFC-3618 describes that scenario as "intermediate MSDP peer". Moreover,
the RP could be another router in the PIM domain - not the one
establishing the MSDP connection.

The current implementation could be problematic even with a single
router per PIM domain. Consider the following scenario:
* There are two PIM domains, each one with a single router.
* The two routers are connected via two independent networks. Let's say
that is to provide redundancy.
* The routers are configured to establish two MSDP connections, one on
each network (redundancy again).
* A multicast source becomes active on the router 1. It will be
communicated to router 2 via two independent MSDP SA messages, one per
MSDP connection.
* Without these changes, each MSDP SA message will indicate a different
RP.
* Both RP addresses will pass the RPF check, and both MSDP sources will
be accepted.
* If the router has clients interested in that multicast group, it will
send PIM Join messages to both RPs and start receiving the multicast
traffic from both.

With the changes included in this commit, the multicast source available
in router 1 would still be communicated to router 2 twice. But both MSDP
SA messages would indicate the same RP, and one of them would be
discarded due to failure in the RPF-check failure. Also, the changes
allow us to define the RP that will be included in the MSDP SA message,
and it could be one of the interfaces used to establish the MSDP
connection, some other interface on the router, a loopback interface, or
another router in the PIM domain.

These changes should not create compatibility issues. As I mentioned, we
usually establish MSDP connections from RP to RP. In this case, the
result will be the same. We would still indicate the address used to
establish the MSDP connection if the RP is not set - I wonder if that
should even be a valid configuration.

Signed-off-by: Adriano Marto Reis <[email protected]>
  • Loading branch information
adrianomarto committed Oct 4, 2023
1 parent 3651803 commit 95e31a6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
10 changes: 10 additions & 0 deletions pimd/pim_msdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ void pim_msdp_sa_ref(struct pim_instance *pim, struct pim_msdp_peer *mp,
pim_sgaddr *sg, struct in_addr rp)
{
struct pim_msdp_sa *sa;
struct rp_info *rp_info;
struct prefix grp;

sa = pim_msdp_sa_add(pim, sg, rp);
if (!sa) {
Expand Down Expand Up @@ -406,6 +408,14 @@ void pim_msdp_sa_ref(struct pim_instance *pim, struct pim_msdp_peer *mp,
sa->sg_str);
}
/* send an immediate SA update to peers */
pim_addr_to_prefix(&grp, sa->sg.grp);
rp_info = pim_rp_find_match_group(pim, &grp);
if (rp_info) {
sa->rp = rp_info->rp.rpf_addr;
} else
{
sa->rp = pim->msdp.originator_id;
}
sa->rp = pim->msdp.originator_id;
pim_msdp_pkt_sa_tx_one(sa);
}
Expand Down
18 changes: 15 additions & 3 deletions pimd/pim_msdp_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

#include "pimd.h"
#include "pim_instance.h"
#include "pim_rp.h"
#include "pim_str.h"
#include "pim_util.h"
#include "pim_errors.h"

#include "pim_msdp.h"
Expand Down Expand Up @@ -387,6 +389,9 @@ static void pim_msdp_pkt_sa_gen(struct pim_instance *pim,
{
struct listnode *sanode;
struct pim_msdp_sa *sa;
struct rp_info *rp_info;
struct prefix group_all;
struct in_addr rp;
int sa_count;
int local_cnt = pim->msdp.local_cnt;

Expand All @@ -395,8 +400,15 @@ static void pim_msdp_pkt_sa_gen(struct pim_instance *pim,
zlog_debug(" sa gen %d", local_cnt);
}

local_cnt = pim_msdp_pkt_sa_fill_hdr(pim, local_cnt,
pim->msdp.originator_id);
rp = pim->msdp.originator_id;
if (pim_get_all_mcast_group(&group_all)) {
rp_info = pim_rp_find_match_group(pim, &group_all);
if (rp_info) {
rp = rp_info->rp.rpf_addr;
}
}

local_cnt = pim_msdp_pkt_sa_fill_hdr(pim, local_cnt, rp);

for (ALL_LIST_ELEMENTS_RO(pim->msdp.sa_list, sanode, sa)) {
if (!(sa->flags & PIM_MSDP_SAF_LOCAL)) {
Expand All @@ -418,7 +430,7 @@ static void pim_msdp_pkt_sa_gen(struct pim_instance *pim,
local_cnt);
}
local_cnt = pim_msdp_pkt_sa_fill_hdr(
pim, local_cnt, pim->msdp.originator_id);
pim, local_cnt, rp);
}
}

Expand Down

0 comments on commit 95e31a6

Please sign in to comment.