]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: SwitchToSptDesired addition
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 16 Oct 2015 16:11:51 +0000 (09:11 -0700)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:34 +0000 (20:38 -0400)
Add code to tell us if we want to switch to a SPT for the (S,G)

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com
pimd/pim_upstream.c
pimd/pim_upstream.h

index 6ac968ac115d94a42f7802c4905ea492f51a1e07..15f96c2e4eb8e9e2910a86cbac365c535bd464ca 100644 (file)
@@ -719,10 +719,9 @@ pim_upstream_keep_alive_timer (struct thread *t)
    * But this is the start.
    */
 
-  return 0;
+  return 1;
 }
 
-
 void
 pim_upstream_keep_alive_timer_start (struct pim_upstream *up,
                                     uint32_t time)
@@ -732,3 +731,37 @@ pim_upstream_keep_alive_timer_start (struct pim_upstream *up,
                   pim_upstream_keep_alive_timer,
                   up, time);
 }
+
+/*
+ * 4.2.1 Last-Hop Switchover to the SPT
+ *
+ *  In Sparse-Mode PIM, last-hop routers join the shared tree towards the
+ *  RP.  Once traffic from sources to joined groups arrives at a last-hop
+ *  router, it has the option of switching to receive the traffic on a
+ *  shortest path tree (SPT).
+ *
+ *  The decision for a router to switch to the SPT is controlled as
+ *  follows:
+ *
+ *    void
+ *    CheckSwitchToSpt(S,G) {
+ *      if ( ( pim_include(*,G) (-) pim_exclude(S,G)
+ *             (+) pim_include(S,G) != NULL )
+ *           AND SwitchToSptDesired(S,G) ) {
+ *             # Note: Restarting the KAT will result in the SPT switch
+ *             set KeepaliveTimer(S,G) to Keepalive_Period
+ *      }
+ *    }
+ *
+ *  SwitchToSptDesired(S,G) is a policy function that is implementation
+ *  defined.  An "infinite threshold" policy can be implemented by making
+ *  SwitchToSptDesired(S,G) return false all the time.  A "switch on
+ *  first packet" policy can be implemented by making
+ *  SwitchToSptDesired(S,G) return true once a single packet has been
+ *  received for the source and group.
+ */
+int
+pim_upstream_switch_to_spt_desired (struct in_addr source, struct in_addr group)
+{
+  return 0;
+}
index fd277c1f6e71122c2022860351e103854274c808..c296bc9a25103706011a49be27061efbb30f692d 100644 (file)
@@ -136,4 +136,8 @@ void pim_upstream_update_could_assert(struct pim_upstream *up);
 void pim_upstream_update_my_assert_metric(struct pim_upstream *up);
 
 void pim_upstream_keep_alive_timer_start (struct pim_upstream *up, uint32_t time);
+
+int pim_upstream_switch_to_spt_desired (struct in_addr source, struct in_addr group);
+#define SwitchToSptDesired(S,G) pim_upstream_switch_to_spt_desired ((S), (G))
+
 #endif /* PIM_UPSTREAM_H */