@Test public void testNoFalsePositives() { StateExpr state1 = new OriginateVrf("node1", "vrf1"); StateExpr state2 = new OriginateVrf("node2", "vrf2"); Map<IngressLocation, BDD> actual = new BDDLoopDetectionAnalysis( PKT, Stream.of( new Edge(state1, state2, constraint(DST.toBDD(DST_PREFIX_1))), new Edge(state2, state1, constraint(DST.toBDD(DST_PREFIX_2)))), ImmutableSet.of(state1, state2)) .detectLoops(); Map<IngressLocation, BDD> expected = ImmutableMap.of(vrf("node1", "vrf1"), ZERO, vrf("node2", "vrf2"), ZERO); assertEquals(expected, actual); }
public Map<IngressLocation, BDD> detectLoops() { Span span = GlobalTracer.get().buildSpan("BDDLoopDetectionAnalysis.detectLoops").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; int numRounds = 256 * 6; Map<StateExpr, BDD> reachableInNRounds = reachableInNRounds(numRounds); Map<StateExpr, BDD> loopBDDs = reachableInNRounds.entrySet().stream() .filter(entry -> confirmLoop(entry.getKey(), entry.getValue())) .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); backwardFixpoint(_forwardEdgeTable, loopBDDs); return getIngressLocationBdds( loopBDDs, _ingressLocationStates, _bddPacket.getFactory().zero()); } finally { span.finish(); } }
BDDLoopDetectionAnalysis { public Map<IngressLocation, BDD> detectLoops() { Span span = GlobalTracer.get().buildSpan("BDDLoopDetectionAnalysis.detectLoops").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; int numRounds = 256 * 6; Map<StateExpr, BDD> reachableInNRounds = reachableInNRounds(numRounds); Map<StateExpr, BDD> loopBDDs = reachableInNRounds.entrySet().stream() .filter(entry -> confirmLoop(entry.getKey(), entry.getValue())) .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); backwardFixpoint(_forwardEdgeTable, loopBDDs); return getIngressLocationBdds( loopBDDs, _ingressLocationStates, _bddPacket.getFactory().zero()); } finally { span.finish(); } } }
BDDLoopDetectionAnalysis { public Map<IngressLocation, BDD> detectLoops() { Span span = GlobalTracer.get().buildSpan("BDDLoopDetectionAnalysis.detectLoops").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; int numRounds = 256 * 6; Map<StateExpr, BDD> reachableInNRounds = reachableInNRounds(numRounds); Map<StateExpr, BDD> loopBDDs = reachableInNRounds.entrySet().stream() .filter(entry -> confirmLoop(entry.getKey(), entry.getValue())) .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); backwardFixpoint(_forwardEdgeTable, loopBDDs); return getIngressLocationBdds( loopBDDs, _ingressLocationStates, _bddPacket.getFactory().zero()); } finally { span.finish(); } } private  BDDLoopDetectionAnalysis(
      BDDPacket bddPacket,
      Table<StateExpr, StateExpr, Transition> forwardEdgeTable,
      Set<StateExpr> ingressLocationStates);  BDDLoopDetectionAnalysis(
      BDDPacket bddPacket, Stream<Edge> edges, Set<StateExpr> ingressLocationStates); }
BDDLoopDetectionAnalysis { public Map<IngressLocation, BDD> detectLoops() { Span span = GlobalTracer.get().buildSpan("BDDLoopDetectionAnalysis.detectLoops").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; int numRounds = 256 * 6; Map<StateExpr, BDD> reachableInNRounds = reachableInNRounds(numRounds); Map<StateExpr, BDD> loopBDDs = reachableInNRounds.entrySet().stream() .filter(entry -> confirmLoop(entry.getKey(), entry.getValue())) .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); backwardFixpoint(_forwardEdgeTable, loopBDDs); return getIngressLocationBdds( loopBDDs, _ingressLocationStates, _bddPacket.getFactory().zero()); } finally { span.finish(); } } private  BDDLoopDetectionAnalysis(
      BDDPacket bddPacket,
      Table<StateExpr, StateExpr, Transition> forwardEdgeTable,
      Set<StateExpr> ingressLocationStates);  BDDLoopDetectionAnalysis(
      BDDPacket bddPacket, Stream<Edge> edges, Set<StateExpr> ingressLocationStates); Map<IngressLocation, BDD> detectLoops(); }
BDDLoopDetectionAnalysis { public Map<IngressLocation, BDD> detectLoops() { Span span = GlobalTracer.get().buildSpan("BDDLoopDetectionAnalysis.detectLoops").start(); try (Scope scope = GlobalTracer.get().scopeManager().activate(span)) { assert scope != null; int numRounds = 256 * 6; Map<StateExpr, BDD> reachableInNRounds = reachableInNRounds(numRounds); Map<StateExpr, BDD> loopBDDs = reachableInNRounds.entrySet().stream() .filter(entry -> confirmLoop(entry.getKey(), entry.getValue())) .collect(Collectors.toMap(Entry::getKey, Entry::getValue)); backwardFixpoint(_forwardEdgeTable, loopBDDs); return getIngressLocationBdds( loopBDDs, _ingressLocationStates, _bddPacket.getFactory().zero()); } finally { span.finish(); } } private  BDDLoopDetectionAnalysis(
      BDDPacket bddPacket,
      Table<StateExpr, StateExpr, Transition> forwardEdgeTable,
      Set<StateExpr> ingressLocationStates);  BDDLoopDetectionAnalysis(
      BDDPacket bddPacket, Stream<Edge> edges, Set<StateExpr> ingressLocationStates); Map<IngressLocation, BDD> detectLoops();  }