PIM DR and the Assert Message
Last updated
Last updated
There are two PIM mechanisms you should be aware of which are used on broadcast segments, the PIM DR and the Assert message.
The PIM DR (Designated Router) is elected when PIM neighbors become adjacent. The DR is only used in PIM-SM. The DR is the router which sends a PIM Join upstream. If both routers on the shared segment sent a PIM Join upstream, they would receive duplicated traffic.
The PIM Assert message is used primarily in PIM-DM. The PIM Assert is used to determine which router will forward multicast traffic onto the broadcast segment. If both routers forwarded traffic onto the broadcast segment, the hosts would receive duplicated traffic.
We’ll first go over the PIM Assert in detail, and then switch the lab to PIM-SM and go over the role of the DR.
To explore the PIM Assert message, we will use the following topology with PIM-DM:
Here are the startup configs:
PIM-DM is already enabled on all interfaces. Verify that both R2 and R3 have a (*, 239.1.1.1) entry in response to the IGMP Join sent by Host1.
When the source begins sending traffic to the multicast group, R1 will flood it out both Gi2 and Gi3. R2 and R3 have an entry for (*, 239.1.1.1), so they will each send traffic out Gi2.
Host1 will receive duplicated packets. If this continues, every packet that the source sends will be duplicated at Host1.
To prevent this, PIM uses the Assert message. This message is sent when a router receives a multicast packet on an interface which is in the OIL for the associated entry. So when both R2 and R3 receive the packet on Gi2 from each other, they both send an Assert message.
The Assert message contains the local router’s metric to the source. If a router receives an Assert message with a lower metric than its own, it means the other router on the subnet has a lower cost to the source, so the router stops sending traffic onto the LAN. If the metrics tie, the router with the highest IP wins. The router with the lowest IP will stop sending traffic.
Let’s see this in action by sending pings from the Source:
A capture is taken on Gi0/0 of Host1:
Notice that the host receives two copies of the first ping, and responds to both. Next, R3 sends a PIM Assert, shown above. The Assert shows the AD and metric for R3’s route to the source, 10.10.10.10.
R2, before it can send its own Assert, realizes that R3 wins. R3 has a higher IP address on the broadcast segment (10.10.100.3). Instead of sending an Assert, R2 simply sends a Prune, pruning its own Gi2 interface. Subsequent traffic is only forwarded by R3.
R2 now has no interfaces in the OIL for (10.10.10.10, 239.1.1.1), so it sends a Prune upstream to R1. R1 removes Gi2 from the OIL:
The PIM DR (Designated Router) is elected when a neighborship comes up. The router with the highest DR priority value wins. The default priority is 1. If the priorites tie, the highest IP address wins. Similar to OSPF, there is a single DR on every segment. There is no BDR in PIM.
This output from R2 shows that each neighbor has a DR priority of 1, and that R3 is the DR on the LAN segment, because it has a higher IP. R2 has a higher IP than R1, so we can infer that R2 is the DR on the link to R1 since the DR flag is missing. The DR flag indicates that the neighbor is the DR.
The DR status is not advertised in the PIM Hello. Only the priorty value is advertised. Routers silently elect themselves DR based on received Hellos.
The PIM DR function is only useful in PIM-SM. This is because the DR is the router which will send a PIM Join upstream on a broadcast segment when acting as LHR, or send a PIM Register when acting as FHR. This prevents duplicated traffic from being pulled down to both R2 and R3 in our topology. This makes the PIM Assert message unncessary in general for PIM-SM, as the non-DR router will not receive the multicast traffic in the first place. The non-DR router will not be on the shared tree.
Let’s change from PIM-DM to PIM-SM in our lab. We will set R1 as the RP. Have Host1 leave the group.
Run debug ip pim on both R2 and R3 and have Host1 join the group again:
R2 is not the DR, so it will not send a PIM Join upstream. Instead it actually sends a Prune upstream, to Prune itself from (*, 239.1.1.1). R2 sends this Prune because it has state for this entry from the IGMP Join, but no interfaces in the OIL (because it is not the DR).
The RP (R1) only has Gi3 in the OIL:
When we initiate traffic from the Source, we should not see any duplicated pings.
In addition to the PIM Join function, the DR is also the router to send a PIM Register in the case where there are multiple FHRs on the LAN. This prevents the RP from receiving duplicate Register messages.
DR Failover works somewhat crudely. The non-DR will only takeover as DR once its neighborship with the DR times out. The non-DR still has IGMP state for all groups the hosts on the LAN has joined. However, the problem is that in PIM, the neighborship takes 3.5 times the hello (30 seconds) to time out. This is 105 seconds, or 1 min and 45 seconds!
To demonstrate this, start a repeated ping at the source, and then shut down Gi1 and Gi2 on R3 (the DR). Because this connection runs through a switch, R2 has no choice but to rely on the neighborship to time out. It cannot use link failure to detect that R3 is down.
51 pings timed out before R2 finally took over as DR.
The PIM DR and PIM Assert message are used to prevent duplicated traffic on a broadcast segment.
The DR is elected on every interface whether using PIM-DM or PIM-SM, because it is a function of PIM itself. However, it is only applicable to PIM-SM. The DR is the router with the highest priority (default is 1) or the highest IP address. The DR is the router on the segment which will send a PIM Join or PIM Register.
The PIM Assert message is primarily seen in PIM-DM, but in rare cases it could conceivably be seen in PIM-SM. The Assert message is used to prevent duplicated multicast traffic being sent onto a broadcast segment. The Assert is generated in response to a multicast packet being received on an interface in the OIL. The Assert contains the router’s metric to the source. The router with the higher (worse) routing metric, or lower IP address (if metric ties) will prune its interface.