Skip to main content

4.2. Data Packet Forwarding Rules

This section describes how a PIM-SM router forwards multicast data packets. The basic principle is that packets are forwarded only when the router has appropriate forwarding state.

Basic Rules for Packet Forwarding

When a multicast data packet arrives at a router interface, the router performs the following checks:

  1. RPF Check (Reverse Path Forwarding Check): Verifies that the packet arrives from the correct interface (i.e., the interface towards the source)
  2. Outgoing Interface List (olist) Check: Determines which interfaces the packet should be forwarded to
  3. TTL Threshold Check: Verifies that the packet's TTL is sufficient

Forwarding State

PIM-SM uses the following forwarding states to determine how to handle packets:

  • (*,G) state: Used for shared tree forwarding
  • (S,G) state: Used for source-specific shortest-path tree forwarding
  • (S,G,rpt) state: Used to exclude specific sources on the shared tree

Forwarding Algorithm

if (DirectlyConnected(S) == TRUE AND iif == RPF_interface(S)) {
olist = olist(*,G) (+) olist(S,G) (-) olist(S,G,rpt)
forward packet on all interfaces in olist
} else if (iif == RPF_interface(S) AND SPTbit(S,G) == TRUE) {
olist = olist(S,G) (-) olist(S,G,rpt)
forward packet on all interfaces in olist
} else if (iif == RPF_interface(RP(G)) AND SPTbit(S,G) == FALSE) {
olist = olist(*,G) (-) olist(S,G,rpt)
forward packet on all interfaces in olist
} else {
drop packet
}

4.2.1. Last-Hop Switchover to the SPT

When a receiver's last-hop router first starts receiving traffic from a specific source, it may be receiving that traffic via the shared tree (RPT). If the traffic rate is sufficiently high, the last-hop router may decide to switch to the source-specific shortest-path tree (SPT).

The switchover decision is based on a configured threshold. Once the decision is made to switch:

  1. The router sends an (S,G) Join towards the source
  2. When data starts arriving via the SPT, the router sends an (S,G,rpt) Prune towards the RP

4.2.2. Setting and Clearing the (S,G) SPTbit

The SPTbit is used to indicate whether the router is forwarding traffic from a specific source via the SPT or via the RPT.

Setting SPTbit: When one of the following conditions is met:

  • A packet matching (S,G) forwarding state is received and the RPF check succeeds
  • An (S,G) Join is sent and traffic is expected to arrive via the SPT

Clearing SPTbit: When (S,G)-specific forwarding is no longer needed, for example:

  • All downstream receivers leave
  • (S,G) state times out
note

For detailed forwarding rules, pseudocode, and edge case handling, please refer to Section 4.2 of RFC 7761 for the complete specification.