diff --git a/apps/reactive-routing/BUCK b/apps/reactive-routing/BUCK
index 6e5a46e..9728498 100644
--- a/apps/reactive-routing/BUCK
+++ b/apps/reactive-routing/BUCK
@@ -1,5 +1,6 @@
 COMPILE_DEPS = [
     '//lib:CORE_DEPS',
+    '//lib:concurrent-trees',
     '//incubator/api:onos-incubator-api',
     '//apps/routing-api:onos-apps-routing-api',
     '//apps/intentsync:onos-apps-intentsync',
diff --git a/apps/routing-api/src/main/java/org/onosproject/routing/IntentRequestListener.java b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/IntentRequestListener.java
similarity index 96%
rename from apps/routing-api/src/main/java/org/onosproject/routing/IntentRequestListener.java
rename to apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/IntentRequestListener.java
index fbb3f5b..b93b3ff 100644
--- a/apps/routing-api/src/main/java/org/onosproject/routing/IntentRequestListener.java
+++ b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/IntentRequestListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-present Open Networking Laboratory
+ * Copyright 2017-present Open Networking Laboratory
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.routing;
+package org.onosproject.reactive.routing;
 
 import org.onlab.packet.IpAddress;
 import org.onlab.packet.IpPrefix;
diff --git a/apps/routing-api/src/main/java/org/onosproject/routing/config/LocalIpPrefixEntry.java b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/LocalIpPrefixEntry.java
similarity index 96%
rename from apps/routing-api/src/main/java/org/onosproject/routing/config/LocalIpPrefixEntry.java
rename to apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/LocalIpPrefixEntry.java
index 5b2b908..49f336e 100644
--- a/apps/routing-api/src/main/java/org/onosproject/routing/config/LocalIpPrefixEntry.java
+++ b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/LocalIpPrefixEntry.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-present Open Networking Laboratory
+ * Copyright 2017-present Open Networking Laboratory
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,15 +13,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.routing.config;
+package org.onosproject.reactive.routing;
 
 import com.google.common.base.MoreObjects;
-
-import java.util.Objects;
-
 import org.onlab.packet.IpAddress;
 import org.onlab.packet.IpPrefix;
 
+import java.util.Objects;
+
 /**
  * Configuration details for an IP prefix entry.
  */
diff --git a/apps/routing-api/src/main/java/org/onosproject/routing/config/ReactiveRoutingConfig.java b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingConfig.java
similarity index 90%
rename from apps/routing-api/src/main/java/org/onosproject/routing/config/ReactiveRoutingConfig.java
rename to apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingConfig.java
index aa0b0c7..fd7e519 100644
--- a/apps/routing-api/src/main/java/org/onosproject/routing/config/ReactiveRoutingConfig.java
+++ b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingConfig.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-present Open Networking Laboratory
+ * Copyright 2017-present Open Networking Laboratory
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,22 +14,20 @@
  * limitations under the License.
  */
 
-package org.onosproject.routing.config;
+package org.onosproject.reactive.routing;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.google.common.collect.Sets;
-
-import java.util.Set;
-
 import org.onlab.packet.IpAddress;
 import org.onlab.packet.IpPrefix;
 import org.onlab.packet.MacAddress;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.net.config.Config;
-import org.onosproject.routing.config.LocalIpPrefixEntry.IpPrefixType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Set;
+
 /**
  * Configuration object for prefix config.
  */
@@ -63,7 +61,7 @@
 
             prefixes.add(new LocalIpPrefixEntry(
                     IpPrefix.valueOf(jsonNode.get(IPPREFIX).asText()),
-                    IpPrefixType.valueOf(jsonNode.get(TYPE).asText()),
+                    LocalIpPrefixEntry.IpPrefixType.valueOf(jsonNode.get(TYPE).asText()),
                     IpAddress.valueOf(jsonNode.get(GATEWAYIP).asText())));
         });
 
@@ -89,7 +87,7 @@
 
             prefixes.add(new LocalIpPrefixEntry(
                     IpPrefix.valueOf(jsonNode.get(IPPREFIX).asText()),
-                    IpPrefixType.valueOf(jsonNode.get(TYPE).asText()),
+                    LocalIpPrefixEntry.IpPrefixType.valueOf(jsonNode.get(TYPE).asText()),
                     IpAddress.valueOf(jsonNode.get(GATEWAYIP).asText())));
         });
 
diff --git a/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingConfiguration.java b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingConfiguration.java
new file mode 100644
index 0000000..4308ddb
--- /dev/null
+++ b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingConfiguration.java
@@ -0,0 +1,251 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.reactive.routing;
+
+import com.google.common.collect.ImmutableSet;
+import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory;
+import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree;
+import com.googlecode.concurrenttrees.radixinverted.InvertedRadixTree;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.Service;
+import org.onlab.packet.Ip4Address;
+import org.onlab.packet.Ip6Address;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.IpPrefix;
+import org.onlab.packet.MacAddress;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.core.CoreService;
+import org.onosproject.incubator.net.intf.InterfaceService;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.config.ConfigFactory;
+import org.onosproject.net.config.NetworkConfigEvent;
+import org.onosproject.net.config.NetworkConfigListener;
+import org.onosproject.net.config.NetworkConfigRegistry;
+import org.onosproject.net.config.NetworkConfigService;
+import org.onosproject.net.config.basics.SubjectFactories;
+import org.onosproject.routing.RoutingService;
+import org.onosproject.routing.config.BgpConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * Reactive routing configuration manager.
+ */
+@Component(immediate = true)
+@Service
+public class ReactiveRoutingConfiguration implements
+        ReactiveRoutingConfigurationService {
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected NetworkConfigRegistry registry;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected NetworkConfigService configService;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected CoreService coreService;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected InterfaceService interfaceService;
+
+    private Set<IpAddress> gatewayIpAddresses = new HashSet<>();
+    private Set<ConnectPoint> bgpPeerConnectPoints = new HashSet<>();
+
+    private InvertedRadixTree<LocalIpPrefixEntry>
+            localPrefixTable4 = new ConcurrentInvertedRadixTree<>(
+                    new DefaultByteArrayNodeFactory());
+    private InvertedRadixTree<LocalIpPrefixEntry>
+            localPrefixTable6 = new ConcurrentInvertedRadixTree<>(
+                    new DefaultByteArrayNodeFactory());
+
+    private MacAddress virtualGatewayMacAddress;
+    private final InternalNetworkConfigListener configListener =
+            new InternalNetworkConfigListener();
+
+    private ConfigFactory<ApplicationId, ReactiveRoutingConfig>
+            reactiveRoutingConfigFactory =
+            new ConfigFactory<ApplicationId, ReactiveRoutingConfig>(
+                    SubjectFactories.APP_SUBJECT_FACTORY,
+                    ReactiveRoutingConfig.class, "reactiveRouting") {
+        @Override
+        public ReactiveRoutingConfig createConfig() {
+            return new ReactiveRoutingConfig();
+        }
+    };
+
+    @Activate
+    public void activate() {
+        configService.addListener(configListener);
+        registry.registerConfigFactory(reactiveRoutingConfigFactory);
+        setUpConfiguration();
+        log.info("Reactive routing configuration service started");
+    }
+
+    @Deactivate
+    public void deactivate() {
+        registry.unregisterConfigFactory(reactiveRoutingConfigFactory);
+        configService.removeListener(configListener);
+        log.info("Reactive routing configuration service stopped");
+    }
+
+    /**
+     * Set up reactive routing information from configuration.
+     */
+    private void setUpConfiguration() {
+        ReactiveRoutingConfig config = configService.getConfig(
+                coreService.registerApplication(ReactiveRoutingConfigurationService
+                        .REACTIVE_ROUTING_APP_ID),
+                ReactiveRoutingConfigurationService.CONFIG_CLASS);
+        if (config == null) {
+            log.warn("No reactive routing config available!");
+            return;
+        }
+        for (LocalIpPrefixEntry entry : config.localIp4PrefixEntries()) {
+            localPrefixTable4.put(createBinaryString(entry.ipPrefix()), entry);
+            gatewayIpAddresses.add(entry.getGatewayIpAddress());
+        }
+        for (LocalIpPrefixEntry entry : config.localIp6PrefixEntries()) {
+            localPrefixTable6.put(createBinaryString(entry.ipPrefix()), entry);
+            gatewayIpAddresses.add(entry.getGatewayIpAddress());
+        }
+
+        virtualGatewayMacAddress = config.virtualGatewayMacAddress();
+
+        // Setup BGP peer connect points
+        ApplicationId routerAppId = coreService.getAppId(RoutingService.ROUTER_APP_ID);
+        if (routerAppId == null) {
+            log.info("Router application ID is null!");
+            return;
+        }
+
+        BgpConfig bgpConfig = configService.getConfig(routerAppId, BgpConfig.class);
+
+        if (bgpConfig == null) {
+            log.info("BGP config is null!");
+            return;
+        } else {
+            bgpPeerConnectPoints =
+                    bgpConfig.bgpSpeakers().stream()
+                    .flatMap(speaker -> speaker.peers().stream())
+                    .map(peer -> interfaceService.getMatchingInterface(peer))
+                    .filter(Objects::nonNull)
+                    .map(intf -> intf.connectPoint())
+                    .collect(Collectors.toSet());
+        }
+    }
+
+    @Override
+    public boolean isIpAddressLocal(IpAddress ipAddress) {
+        if (ipAddress.isIp4()) {
+            return localPrefixTable4.getValuesForKeysPrefixing(
+                    createBinaryString(
+                    IpPrefix.valueOf(ipAddress, Ip4Address.BIT_LENGTH)))
+                    .iterator().hasNext();
+        } else {
+            return localPrefixTable6.getValuesForKeysPrefixing(
+                    createBinaryString(
+                    IpPrefix.valueOf(ipAddress, Ip6Address.BIT_LENGTH)))
+                    .iterator().hasNext();
+        }
+    }
+
+    @Override
+    public boolean isIpPrefixLocal(IpPrefix ipPrefix) {
+        return (localPrefixTable4.getValueForExactKey(
+                createBinaryString(ipPrefix)) != null ||
+                localPrefixTable6.getValueForExactKey(
+                createBinaryString(ipPrefix)) != null);
+    }
+
+    @Override
+    public boolean isVirtualGatewayIpAddress(IpAddress ipAddress) {
+        return gatewayIpAddresses.contains(ipAddress);
+    }
+
+    @Override
+    public MacAddress getVirtualGatewayMacAddress() {
+        return virtualGatewayMacAddress;
+    }
+
+    @Override
+    public Set<ConnectPoint> getBgpPeerConnectPoints() {
+        return ImmutableSet.copyOf(bgpPeerConnectPoints);
+    }
+
+    /**
+     * Creates the binary string representation of an IP prefix.
+     * The prefix can be either IPv4 or IPv6.
+     * The string length is equal to the prefix length + 1.
+     *
+     * For each string, we put a extra "0" in the front. The purpose of
+     * doing this is to store the default route inside InvertedRadixTree.
+     *
+     * @param ipPrefix the IP prefix to use
+     * @return the binary string representation
+     */
+    private static String createBinaryString(IpPrefix ipPrefix) {
+        if (ipPrefix.prefixLength() == 0) {
+            return "0";
+        }
+
+        byte[] octets = ipPrefix.address().toOctets();
+        StringBuilder result = new StringBuilder(ipPrefix.prefixLength());
+        for (int i = 0; i < ipPrefix.prefixLength(); i++) {
+            int byteOffset = i / Byte.SIZE;
+            int bitOffset = i % Byte.SIZE;
+            int mask = 1 << (Byte.SIZE - 1 - bitOffset);
+            byte value = octets[byteOffset];
+            boolean isSet = ((value & mask) != 0);
+            result.append(isSet ? "1" : "0");
+        }
+
+        return "0" + result.toString();
+    }
+
+    private class InternalNetworkConfigListener implements NetworkConfigListener {
+
+        @Override
+        public void event(NetworkConfigEvent event) {
+            switch (event.type()) {
+            case CONFIG_REGISTERED:
+                break;
+            case CONFIG_UNREGISTERED:
+                break;
+            case CONFIG_ADDED:
+            case CONFIG_UPDATED:
+            case CONFIG_REMOVED:
+                if (event.configClass() == ReactiveRoutingConfigurationService.CONFIG_CLASS) {
+                    setUpConfiguration();
+                }
+                break;
+            default:
+                break;
+            }
+        }
+    }
+}
diff --git a/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingConfigurationService.java b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingConfigurationService.java
new file mode 100644
index 0000000..513073f
--- /dev/null
+++ b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingConfigurationService.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.reactive.routing;
+
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.IpPrefix;
+import org.onlab.packet.MacAddress;
+import org.onosproject.net.ConnectPoint;
+
+import java.util.Set;
+
+/**
+ * Provides information about the routing configuration.
+ */
+public interface ReactiveRoutingConfigurationService {
+
+    String REACTIVE_ROUTING_APP_ID = "org.onosproject.reactive.routing";
+
+    Class<ReactiveRoutingConfig> CONFIG_CLASS = ReactiveRoutingConfig.class;
+
+
+    MacAddress getVirtualGatewayMacAddress();
+
+    /**
+     * Evaluates whether an IP address is a virtual gateway IP address.
+     *
+     * @param ipAddress the IP address to evaluate
+     * @return true if the IP address is a virtual gateway address, otherwise false
+     */
+    boolean isVirtualGatewayIpAddress(IpAddress ipAddress);
+
+    /**
+     * Evaluates whether an IP address belongs to local SDN network.
+     *
+     * @param ipAddress the IP address to evaluate
+     * @return true if the IP address belongs to local SDN network, otherwise false
+     */
+    boolean isIpAddressLocal(IpAddress ipAddress);
+
+    /**
+     * Evaluates whether an IP prefix belongs to local SDN network.
+     *
+     * @param ipPrefix the IP prefix to evaluate
+     * @return true if the IP prefix belongs to local SDN network, otherwise false
+     */
+    boolean isIpPrefixLocal(IpPrefix ipPrefix);
+
+    /**
+     * Retrieves the entire set of connect points connected to BGP peers in the
+     * network.
+     *
+     * @return the set of connect points connected to BGP peers
+     */
+    Set<ConnectPoint> getBgpPeerConnectPoints();
+
+
+}
diff --git a/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingFib.java b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingFib.java
index e57d9a5..4998ae6 100644
--- a/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingFib.java
+++ b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/ReactiveRoutingFib.java
@@ -38,7 +38,6 @@
 import org.onosproject.net.intent.Key;
 import org.onosproject.net.intent.MultiPointToSinglePointIntent;
 import org.onosproject.net.intent.constraint.PartialFailureConstraint;
-import org.onosproject.routing.IntentRequestListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/SdnIpReactiveRouting.java b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/SdnIpReactiveRouting.java
index d596342..e2faaff 100644
--- a/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/SdnIpReactiveRouting.java
+++ b/apps/reactive-routing/src/main/java/org/onosproject/reactive/routing/SdnIpReactiveRouting.java
@@ -48,9 +48,7 @@
 import org.onosproject.net.packet.PacketContext;
 import org.onosproject.net.packet.PacketProcessor;
 import org.onosproject.net.packet.PacketService;
-import org.onosproject.routing.IntentRequestListener;
 import org.onosproject.intentsync.IntentSynchronizationService;
-import org.onosproject.routing.config.RoutingConfigurationService;
 import org.slf4j.Logger;
 
 import java.nio.ByteBuffer;
@@ -89,7 +87,7 @@
     protected IntentSynchronizationService intentSynchronizer;
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected RoutingConfigurationService config;
+    protected ReactiveRoutingConfigurationService config;
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
     protected InterfaceService interfaceService;
diff --git a/apps/routing-api/src/main/java/org/onosproject/routing/config/RoutingConfigurationService.java b/apps/routing-api/src/main/java/org/onosproject/routing/config/RoutingConfigurationService.java
index e2ed83f..7c7b0e5 100644
--- a/apps/routing-api/src/main/java/org/onosproject/routing/config/RoutingConfigurationService.java
+++ b/apps/routing-api/src/main/java/org/onosproject/routing/config/RoutingConfigurationService.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-present Open Networking Laboratory
+ * Copyright 2017-present Open Networking Laboratory
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,58 +13,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.config;
 
-import java.util.Set;
-
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
-import org.onlab.packet.MacAddress;
-import org.onosproject.net.ConnectPoint;
-
 /**
- * Provides information about the routing configuration.
+ * Routing configuration service. Going away very soon.
+ *
+ * @deprecated in Junco release
  */
+@Deprecated
 public interface RoutingConfigurationService {
 
-    String REACTIVE_ROUTING_APP_ID = "org.onosproject.reactive.routing";
-
-    Class<ReactiveRoutingConfig> CONFIG_CLASS = ReactiveRoutingConfig.class;
-
-
-    MacAddress getVirtualGatewayMacAddress();
-
     /**
-     * Evaluates whether an IP address is a virtual gateway IP address.
-     *
-     * @param ipAddress the IP address to evaluate
-     * @return true if the IP address is a virtual gateway address, otherwise false
+     * Empty method to pacify checkstyle.
      */
-    boolean isVirtualGatewayIpAddress(IpAddress ipAddress);
-
-    /**
-     * Evaluates whether an IP address belongs to local SDN network.
-     *
-     * @param ipAddress the IP address to evaluate
-     * @return true if the IP address belongs to local SDN network, otherwise false
-     */
-    boolean isIpAddressLocal(IpAddress ipAddress);
-
-    /**
-     * Evaluates whether an IP prefix belongs to local SDN network.
-     *
-     * @param ipPrefix the IP prefix to evaluate
-     * @return true if the IP prefix belongs to local SDN network, otherwise false
-     */
-    boolean isIpPrefixLocal(IpPrefix ipPrefix);
-
-    /**
-     * Retrieves the entire set of connect points connected to BGP peers in the
-     * network.
-     *
-     * @return the set of connect points connected to BGP peers
-     */
-    Set<ConnectPoint> getBgpPeerConnectPoints();
-
-
+    default void nothing() {
+    }
 }
diff --git a/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java b/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
index ea22322..c41724f 100644
--- a/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
@@ -16,46 +16,26 @@
 
 package org.onosproject.routing.config.impl;
 
-import com.google.common.collect.ImmutableSet;
-import com.googlecode.concurrenttrees.radix.node.concrete.DefaultByteArrayNodeFactory;
-import com.googlecode.concurrenttrees.radixinverted.ConcurrentInvertedRadixTree;
-import com.googlecode.concurrenttrees.radixinverted.InvertedRadixTree;
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Deactivate;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.ReferenceCardinality;
 import org.apache.felix.scr.annotations.Service;
-import org.onlab.packet.Ip4Address;
-import org.onlab.packet.Ip6Address;
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
-import org.onlab.packet.MacAddress;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
 import org.onosproject.incubator.net.intf.InterfaceService;
-import org.onosproject.net.ConnectPoint;
 import org.onosproject.net.config.ConfigFactory;
-import org.onosproject.net.config.NetworkConfigEvent;
-import org.onosproject.net.config.NetworkConfigListener;
 import org.onosproject.net.config.NetworkConfigRegistry;
 import org.onosproject.net.config.NetworkConfigService;
 import org.onosproject.net.config.basics.SubjectFactories;
-import org.onosproject.routing.RoutingService;
 import org.onosproject.routing.config.BgpConfig;
-import org.onosproject.routing.config.LocalIpPrefixEntry;
-import org.onosproject.routing.config.ReactiveRoutingConfig;
 import org.onosproject.routing.config.RouterConfig;
 import org.onosproject.routing.config.RoutersConfig;
 import org.onosproject.routing.config.RoutingConfigurationService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.HashSet;
-import java.util.Objects;
-import java.util.Set;
-import java.util.stream.Collectors;
-
 /**
  * Implementation of RoutingConfigurationService which reads routing
  * configuration from the network configuration service.
@@ -78,20 +58,6 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
     protected InterfaceService interfaceService;
 
-    private Set<IpAddress> gatewayIpAddresses = new HashSet<>();
-    private Set<ConnectPoint> bgpPeerConnectPoints = new HashSet<>();
-
-    private InvertedRadixTree<LocalIpPrefixEntry>
-            localPrefixTable4 = new ConcurrentInvertedRadixTree<>(
-                    new DefaultByteArrayNodeFactory());
-    private InvertedRadixTree<LocalIpPrefixEntry>
-            localPrefixTable6 = new ConcurrentInvertedRadixTree<>(
-                    new DefaultByteArrayNodeFactory());
-
-    private MacAddress virtualGatewayMacAddress;
-    private final InternalNetworkConfigListener configListener =
-            new InternalNetworkConfigListener();
-
     private ConfigFactory<ApplicationId, BgpConfig> bgpConfigFactory =
             new ConfigFactory<ApplicationId, BgpConfig>(
                     SubjectFactories.APP_SUBJECT_FACTORY, BgpConfig.class, "bgp") {
@@ -119,25 +85,11 @@
                 }
             };
 
-    private ConfigFactory<ApplicationId, ReactiveRoutingConfig>
-            reactiveRoutingConfigFactory =
-            new ConfigFactory<ApplicationId, ReactiveRoutingConfig>(
-                    SubjectFactories.APP_SUBJECT_FACTORY,
-                    ReactiveRoutingConfig.class, "reactiveRouting") {
-        @Override
-        public ReactiveRoutingConfig createConfig() {
-            return new ReactiveRoutingConfig();
-        }
-    };
-
     @Activate
     public void activate() {
-        configService.addListener(configListener);
         registry.registerConfigFactory(bgpConfigFactory);
         registry.registerConfigFactory(routerConfigFactory);
         registry.registerConfigFactory(routersConfigFactory);
-        registry.registerConfigFactory(reactiveRoutingConfigFactory);
-        setUpConfiguration();
         log.info("Routing configuration service started");
     }
 
@@ -146,144 +98,7 @@
         registry.unregisterConfigFactory(bgpConfigFactory);
         registry.unregisterConfigFactory(routerConfigFactory);
         registry.unregisterConfigFactory(routersConfigFactory);
-        registry.unregisterConfigFactory(reactiveRoutingConfigFactory);
-        configService.removeListener(configListener);
         log.info("Routing configuration service stopped");
     }
 
-    /**
-     * Set up reactive routing information from configuration.
-     */
-    private void setUpConfiguration() {
-        ReactiveRoutingConfig config = configService.getConfig(
-                coreService.registerApplication(RoutingConfigurationService
-                        .REACTIVE_ROUTING_APP_ID),
-                RoutingConfigurationService.CONFIG_CLASS);
-        if (config == null) {
-            log.warn("No reactive routing config available!");
-            return;
-        }
-        for (LocalIpPrefixEntry entry : config.localIp4PrefixEntries()) {
-            localPrefixTable4.put(createBinaryString(entry.ipPrefix()), entry);
-            gatewayIpAddresses.add(entry.getGatewayIpAddress());
-        }
-        for (LocalIpPrefixEntry entry : config.localIp6PrefixEntries()) {
-            localPrefixTable6.put(createBinaryString(entry.ipPrefix()), entry);
-            gatewayIpAddresses.add(entry.getGatewayIpAddress());
-        }
-
-        virtualGatewayMacAddress = config.virtualGatewayMacAddress();
-
-        // Setup BGP peer connect points
-        ApplicationId routerAppId = coreService.getAppId(RoutingService.ROUTER_APP_ID);
-        if (routerAppId == null) {
-            log.info("Router application ID is null!");
-            return;
-        }
-
-        BgpConfig bgpConfig = configService.getConfig(routerAppId, BgpConfig.class);
-
-        if (bgpConfig == null) {
-            log.info("BGP config is null!");
-            return;
-        } else {
-            bgpPeerConnectPoints =
-                    bgpConfig.bgpSpeakers().stream()
-                    .flatMap(speaker -> speaker.peers().stream())
-                    .map(peer -> interfaceService.getMatchingInterface(peer))
-                    .filter(Objects::nonNull)
-                    .map(intf -> intf.connectPoint())
-                    .collect(Collectors.toSet());
-        }
-    }
-
-    @Override
-    public boolean isIpAddressLocal(IpAddress ipAddress) {
-        if (ipAddress.isIp4()) {
-            return localPrefixTable4.getValuesForKeysPrefixing(
-                    createBinaryString(
-                    IpPrefix.valueOf(ipAddress, Ip4Address.BIT_LENGTH)))
-                    .iterator().hasNext();
-        } else {
-            return localPrefixTable6.getValuesForKeysPrefixing(
-                    createBinaryString(
-                    IpPrefix.valueOf(ipAddress, Ip6Address.BIT_LENGTH)))
-                    .iterator().hasNext();
-        }
-    }
-
-    @Override
-    public boolean isIpPrefixLocal(IpPrefix ipPrefix) {
-        return (localPrefixTable4.getValueForExactKey(
-                createBinaryString(ipPrefix)) != null ||
-                localPrefixTable6.getValueForExactKey(
-                createBinaryString(ipPrefix)) != null);
-    }
-
-    @Override
-    public boolean isVirtualGatewayIpAddress(IpAddress ipAddress) {
-        return gatewayIpAddresses.contains(ipAddress);
-    }
-
-    @Override
-    public MacAddress getVirtualGatewayMacAddress() {
-        return virtualGatewayMacAddress;
-    }
-
-    @Override
-    public Set<ConnectPoint> getBgpPeerConnectPoints() {
-        return ImmutableSet.copyOf(bgpPeerConnectPoints);
-    }
-
-    /**
-     * Creates the binary string representation of an IP prefix.
-     * The prefix can be either IPv4 or IPv6.
-     * The string length is equal to the prefix length + 1.
-     *
-     * For each string, we put a extra "0" in the front. The purpose of
-     * doing this is to store the default route inside InvertedRadixTree.
-     *
-     * @param ipPrefix the IP prefix to use
-     * @return the binary string representation
-     */
-    private static String createBinaryString(IpPrefix ipPrefix) {
-        if (ipPrefix.prefixLength() == 0) {
-            return "0";
-        }
-
-        byte[] octets = ipPrefix.address().toOctets();
-        StringBuilder result = new StringBuilder(ipPrefix.prefixLength());
-        for (int i = 0; i < ipPrefix.prefixLength(); i++) {
-            int byteOffset = i / Byte.SIZE;
-            int bitOffset = i % Byte.SIZE;
-            int mask = 1 << (Byte.SIZE - 1 - bitOffset);
-            byte value = octets[byteOffset];
-            boolean isSet = ((value & mask) != 0);
-            result.append(isSet ? "1" : "0");
-        }
-
-        return "0" + result.toString();
-    }
-
-    private class InternalNetworkConfigListener implements NetworkConfigListener {
-
-        @Override
-        public void event(NetworkConfigEvent event) {
-            switch (event.type()) {
-            case CONFIG_REGISTERED:
-                break;
-            case CONFIG_UNREGISTERED:
-                break;
-            case CONFIG_ADDED:
-            case CONFIG_UPDATED:
-            case CONFIG_REMOVED:
-                if (event.configClass() == RoutingConfigurationService.CONFIG_CLASS) {
-                    setUpConfiguration();
-                }
-                break;
-            default:
-                break;
-            }
-        }
-    }
 }
