Protocol Independent Multicast (PIM) – Sparse mode (PIM-SM) is a multicast routing protocol. PIM-SM is used when receivers are sparsely populated. PIM-SM uses explicit-join mechanism. PIM-SM can work on point-to-point link and ethernet LANs.
Why PIM Assert mechanism is required:
We will use the network configuration shown in figure-1 and PIM-SM to understand why PIM assert mechanism is required and how it works. Let us assume that host H1 and host H2 join channel (S,G). Let us also assume that router R1 and router R2 uses router R3 and router R4 to reach source ‘S’ respectively. This could be because of routing table mismatch or the two choose different gateways as both has an ECMP route to source ‘S’. Router R1 sends a PIM join to router R3 and router R2 sends a PIM join to router R4. Router R3 and R4 forwards the PIM join towards source ‘S’.
Do you see any issue with this? Yes. You are right. There will be duplicate traffic on the LAN as both router R3 and R4 will forward traffic from ‘S’. This means both hosts H1 and H2 will receive duplicate traffic. Do you think its a good idea to let this happen? Nah! So who helps us? No prizes for guessing. In such situation, PIM Assert mechanism helps in electing a single forwarder.
Is this the only configuration where we hit upon duplicate traffic issue? No. There are other similar cases as well. Let us look at them first.
- If downstream routers are joining (*,G) channel and the two routers choose different upstream routers to reach the selected RP.
- If one downstream router joins (*,G) while another downstream router join (S,G) using two different upstream routers. It could be because RP used for (*,G) is not accessible through the same router as the source of (S,G). In this case, traffic from source ‘S’ will get forwarded on source-specific tree as well as shared tree.
- If there are local hosts and PIM DR joins a (S,G) or (*,G) channel for a local host while a downstream router chooses a different upstream router (other than the PIM DR) for a (S,G) or (*,G) channel.
How PIM Assert mechanism helps:
PIM uses Assert messages to elect the single router that forwards the data traffic to the LAN. When both router R3 and R4 forwards the data traffic for channel (S,G), R3 receives R4’s data traffic and R4 receives R3’s data traffic on their downstream interfaces. This condition triggers the assert on the downstream interfaces. To start with, Router R3 and router R4 will assume that they are assert-winner and send out the PIM assert message.
All the routers on LAN will carry out the election based on the PIM assert messages. PIM assert messages contain group address, source address, RPT bit and route metric for the source (In case of S,G) or RP (In case of *,G). Route metric contains unicast route preference and unicast route metric. The election uses following steps in strict order:
- If a router has (S,G) state and others has (*,G) state, router having (S,G) state wins. RPT bit in the message identifies this.
- Router with lower unicast route preference wins.
- Router with lower unicast route metric wins.
- Router with the highest IP address wins.
The election alogirthm is such that there will always be only one winner. Let us assume that Router R3 is elected as the forwarder. So from now onwards, router R4 will stop forwarding data traffic. Let us look at states each routers maintain:
- State in Assert winner (Router R3): It starts an assert-timer which is a little smaller than what is used by routers that have lost assert. This timer is used to refresh the assert state in all the routers. Its a little smaller because assert-winner does not want assert-loser to restart the assert election.
- State in Assert loser (Router R4): Router R4 stores the assert-winner and its assert-metric for future use. It starts an assert-timer.
- State in downstream router (Router R1 and R2): It stores the assert-winner and its assert-metric. These routers will now onward send their periodic join messages for this channel to the assert-winner. As router R3 is assert-winner, RPF neighbor for router R2 has changed from router R4 to router R3 for channel (S,G). Router R2 sends a prune towards R4 and a join towards R3.
Now that we know what PIM Assert mechanism is, how a single forwarder is selected and what states are maintained by each router, let us look at the subsequent events that are possible.
Assert timer firing in assert-winner (Router R3):
Assert-winner’s assert timer is little smaller than assert-loser so that it can refresh the assert state. When the assert-timer fires in assert-winner, it sends out a assert message. This message trigger the forwarder election again but nothing changes.
Assert timer firing in assert-loser (Router R1, R2 and R4):
When assert-loser’s assert-timer fires, it is assumed that assert-winner is no more the assert-winner. Assert-loser removes the assert state and returns to the normal state. This means that RPF neighbor for channel (S,G) in downstream routers changes to what the unicast routing table suggest and if they still desire to join channel (S,G), they switch to the original PIM neighbor.
Assert-winner (Router R3) sending assert-cancel:
When assert-winner is no longer forwarding data traffic for a channel, it sends out a assert-cancel. Assert-cancel is handled similar to how a ‘assert-timer’ firing is handled in assert-loser.
All vendors support PIM Assert on multi-access LAN interfaces. An administrator cannot disable this feature as the only configuration available is the value for assert-timer.
I hope this clears any doubt you ever had on PIM Assert Mechanism. As there are multiple possibilities, please do let me know if you want to discuss any specific network configuration by leaving a comment below.