Make vRouter components into separate apps.

This allows us to leverage the ONOS app subsystem for selecting which
components to load.

CORD-710

Change-Id: Ibd7c4c1afd2caa137b44c085e7b6b5b4a1082521
diff --git a/apps/bgprouter/BUCK b/apps/bgprouter/BUCK
index 0e1870f..211ae7a 100644
--- a/apps/bgprouter/BUCK
+++ b/apps/bgprouter/BUCK
@@ -6,7 +6,7 @@
 
 BUNDLES = [
     '//apps/routing-api:onos-apps-routing-api',
-    '//apps/routing:onos-apps-routing',
+    '//apps/routing/common:onos-apps-routing-common',
     '//apps/bgprouter:onos-apps-bgprouter',
 ]
 
@@ -20,4 +20,5 @@
     url = 'http://onosproject.org',
     description = 'BGP router application.',
     included_bundles = BUNDLES,
+    required_apps = [ 'org.onosproject.fibinstaller' ],
 )
diff --git a/apps/bgprouter/app.xml b/apps/bgprouter/app.xml
index 91e010a..fafba35 100644
--- a/apps/bgprouter/app.xml
+++ b/apps/bgprouter/app.xml
@@ -17,7 +17,7 @@
 <app name="org.onosproject.bgprouter" origin="ON.Lab" version="${project.version}"
      category="Traffic Steering" url="http://onosproject.org" title="BGP Router App"
      featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
-     features="${project.artifactId}">
+     features="${project.artifactId}" apps="fibinstaller">
     <description>${project.description}</description>
     <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
     <artifact>mvn:${project.groupId}/onos-app-routing-api/${project.version}</artifact>
diff --git a/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java b/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java
index e6941c3..ce43a6a 100644
--- a/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java
+++ b/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java
@@ -94,9 +94,7 @@
     private static List<String> components = new ArrayList<>();
     static {
         components.add("org.onosproject.routing.bgp.BgpSessionManager");
-        components.add("org.onosproject.routing.impl.Router");
         components.add("org.onosproject.routing.impl.BgpSpeakerNeighbourHandler");
-        components.add("org.onosproject.routing.impl.SingleSwitchFibInstaller");
     }
 
     @Activate
diff --git a/apps/castor/BUCK b/apps/castor/BUCK
index 890b291..1a3342a 100644
--- a/apps/castor/BUCK
+++ b/apps/castor/BUCK
@@ -13,7 +13,7 @@
 BUNDLES = [
   '//apps/castor:onos-apps-castor',
   '//apps/routing-api:onos-apps-routing-api',
-  '//apps/routing:onos-apps-routing',
+  '//apps/routing/common:onos-apps-routing-common',
 ]
 
 TEST_DEPS = [
diff --git a/apps/routing-api/BUCK b/apps/routing-api/BUCK
index d9db85a..4e4939b 100644
--- a/apps/routing-api/BUCK
+++ b/apps/routing-api/BUCK
@@ -1,5 +1,6 @@
 COMPILE_DEPS = [
     '//lib:CORE_DEPS',
+    '//incubator/api:onos-incubator-api',
 ]
 
 TEST_DEPS = [
diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/AsyncDeviceFetcher.java b/apps/routing-api/src/main/java/org/onosproject/routing/AsyncDeviceFetcher.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/impl/AsyncDeviceFetcher.java
rename to apps/routing-api/src/main/java/org/onosproject/routing/AsyncDeviceFetcher.java
index f48fef0..fd5dfc3 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/impl/AsyncDeviceFetcher.java
+++ b/apps/routing-api/src/main/java/org/onosproject/routing/AsyncDeviceFetcher.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.routing.impl;
+package org.onosproject.routing;
 
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.device.DeviceEvent;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/NextHop.java b/apps/routing-api/src/main/java/org/onosproject/routing/NextHop.java
similarity index 95%
rename from apps/routing/src/main/java/org/onosproject/routing/impl/NextHop.java
rename to apps/routing-api/src/main/java/org/onosproject/routing/NextHop.java
index 71e02d6..b8b800c 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/impl/NextHop.java
+++ b/apps/routing-api/src/main/java/org/onosproject/routing/NextHop.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.
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.routing.impl;
+package org.onosproject.routing;
 
 import java.util.Objects;
 
diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/NextHopGroupKey.java b/apps/routing-api/src/main/java/org/onosproject/routing/NextHopGroupKey.java
similarity index 94%
rename from apps/routing/src/main/java/org/onosproject/routing/impl/NextHopGroupKey.java
rename to apps/routing-api/src/main/java/org/onosproject/routing/NextHopGroupKey.java
index d2a693b..12d993b 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/impl/NextHopGroupKey.java
+++ b/apps/routing-api/src/main/java/org/onosproject/routing/NextHopGroupKey.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.
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.routing.impl;
+package org.onosproject.routing;
 
 import com.google.common.base.MoreObjects;
 import org.onlab.packet.IpAddress;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/RouterInterfaceManager.java b/apps/routing-api/src/main/java/org/onosproject/routing/RouterInterfaceManager.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/impl/RouterInterfaceManager.java
rename to apps/routing-api/src/main/java/org/onosproject/routing/RouterInterfaceManager.java
index 87d3f56..8b1deff 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/impl/RouterInterfaceManager.java
+++ b/apps/routing-api/src/main/java/org/onosproject/routing/RouterInterfaceManager.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.routing.impl;
+package org.onosproject.routing;
 
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Sets;
diff --git a/apps/routing/common/BUCK b/apps/routing/common/BUCK
new file mode 100644
index 0000000..8483685
--- /dev/null
+++ b/apps/routing/common/BUCK
@@ -0,0 +1,20 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//lib:org.apache.karaf.shell.console',
+    '//lib:concurrent-trees',
+    '//cli:onos-cli',
+    '//incubator/api:onos-incubator-api',
+    '//apps/routing-api:onos-apps-routing-api',
+    '//core/common:onos-core-common',
+]
+
+TEST_DEPS = [
+    '//lib:TEST_ADAPTERS',
+    '//incubator/api:onos-incubator-api-tests',
+    '//apps/routing-api:onos-apps-routing-api-tests',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+    test_deps = TEST_DEPS,
+)
diff --git a/apps/routing/common/pom.xml b/apps/routing/common/pom.xml
new file mode 100644
index 0000000..ed2d115
--- /dev/null
+++ b/apps/routing/common/pom.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>onos-app-routing-parent</artifactId>
+        <groupId>org.onosproject</groupId>
+        <version>1.9.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>onos-app-routing</artifactId>
+    <packaging>bundle</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-app-routing-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-app-routing-api</artifactId>
+            <scope>test</scope>
+            <classifier>tests</classifier>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-incubator-api</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+            <classifier>tests</classifier>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-cli</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onlab-misc</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.karaf.shell</groupId>
+            <artifactId>org.apache.karaf.shell.console</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.googlecode.concurrent-trees</groupId>
+            <artifactId>concurrent-trees</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpConstants.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpConstants.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpConstants.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpConstants.java
index 504482f..0344b54 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpConstants.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpConstants.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 /**
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.java
index 4cd2813..d6c9d30 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpFrameDecoder.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.jboss.netty.buffer.ChannelBuffer;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpInfoService.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpInfoService.java
similarity index 95%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpInfoService.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpInfoService.java
index 938aa15..1fa303e 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpInfoService.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpInfoService.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import java.util.Collection;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.java
index acb8a25..050a30f 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpKeepalive.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.jboss.netty.buffer.ChannelBuffer;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpMessage.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpMessage.java
similarity index 97%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpMessage.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpMessage.java
index cb67d8b..cafbeb1 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpMessage.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpMessage.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.jboss.netty.buffer.ChannelBuffer;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpNotification.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpNotification.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpNotification.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpNotification.java
index 8507474..0cf03a5 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpNotification.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpNotification.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.jboss.netty.buffer.ChannelBuffer;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpOpen.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpOpen.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpOpen.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpOpen.java
index 6f496ee..e5d4821 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpOpen.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpOpen.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.jboss.netty.buffer.ChannelBuffer;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java
index adf00904..15ac60c 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import com.google.common.base.MoreObjects;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java
index 36b4b6e..96f3a92 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.onlab.packet.IpPrefix;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSession.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSession.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSession.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSession.java
index f9d2a20..25623ac 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSession.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSession.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.jboss.netty.buffer.ChannelBuffer;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.java
index 0e1bc8a..af3a41f 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionInfo.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.onlab.packet.Ip4Address;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java
index fbecd68..a8cf5d8 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.apache.felix.scr.annotations.Activate;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpUpdate.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpUpdate.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/BgpUpdate.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpUpdate.java
index b30fb8d..afde4d8 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpUpdate.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/BgpUpdate.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.apache.commons.lang3.tuple.Pair;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/RouteEntry.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteEntry.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/RouteEntry.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteEntry.java
index 8053ecd..20d1298 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/RouteEntry.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteEntry.java
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import com.google.common.base.MoreObjects;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java
index 332933d..07cb589 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/RouteUpdate.java
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import com.google.common.base.MoreObjects;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/package-info.java b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/package-info.java
similarity index 92%
rename from apps/routing/src/main/java/org/onosproject/routing/bgp/package-info.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/bgp/package-info.java
index 4da087d..d4b18ae 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/package-info.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/bgp/package-info.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/AddPeerCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/AddPeerCommand.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/cli/AddPeerCommand.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/AddPeerCommand.java
index 5a83f96..8d89c45 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/AddPeerCommand.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/AddPeerCommand.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.java
index 55dc168..49fb4f4 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/AddSpeakerCommand.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.java
index 05f0404..c7d6e1b 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpNeighborsListCommand.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.cli;
 
 import com.fasterxml.jackson.databind.JsonNode;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java
index 0b35241..e140c9b 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.cli;
 
 import com.fasterxml.jackson.databind.JsonNode;
@@ -22,10 +23,10 @@
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.routing.bgp.BgpConstants;
 import org.onosproject.routing.bgp.BgpInfoService;
 import org.onosproject.routing.bgp.BgpRouteEntry;
 import org.onosproject.routing.bgp.BgpSession;
-import org.onosproject.routing.bgp.BgpConstants;
 
 import java.util.ArrayList;
 import java.util.Collection;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.java
similarity index 97%
rename from apps/routing/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.java
index ce5a7af..2e4de6f 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/BgpSpeakersListCommand.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.java
similarity index 97%
rename from apps/routing/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.java
index 06293ef..204dfb7 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/RemovePeerCommand.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.java
index 33120b9..cba02b6 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/RemoveSpeakerCommand.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/package-info.java b/apps/routing/common/src/main/java/org/onosproject/routing/cli/package-info.java
similarity index 92%
rename from apps/routing/src/main/java/org/onosproject/routing/cli/package-info.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/cli/package-info.java
index db33684..fc50db3 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/package-info.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/cli/package-info.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java b/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
index 5fbfe7f..d9b792d 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.config.impl;
 
 import com.google.common.collect.ImmutableSet;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/config/impl/package-info.java b/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/package-info.java
similarity index 92%
rename from apps/routing/src/main/java/org/onosproject/routing/config/impl/package-info.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/config/impl/package-info.java
index d7d363a..b7a9594 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/config/impl/package-info.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/config/impl/package-info.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.java b/apps/routing/common/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.java
index a3e2e00..4ebaac2 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/impl/BgpSpeakerNeighbourHandler.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/DirectHostManager.java b/apps/routing/common/src/main/java/org/onosproject/routing/impl/DirectHostManager.java
similarity index 99%
rename from apps/routing/src/main/java/org/onosproject/routing/impl/DirectHostManager.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/impl/DirectHostManager.java
index a1a7d25..7356d95 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/impl/DirectHostManager.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/impl/DirectHostManager.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/package-info.java b/apps/routing/common/src/main/java/org/onosproject/routing/impl/package-info.java
similarity index 92%
rename from apps/routing/src/main/java/org/onosproject/routing/impl/package-info.java
rename to apps/routing/common/src/main/java/org/onosproject/routing/impl/package-info.java
index c2d1e6b..c1ecfc2 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/impl/package-info.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/impl/package-info.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.
diff --git a/apps/routing/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/apps/routing/common/src/main/resources/OSGI-INF/blueprint/shell-config.xml
similarity index 93%
rename from apps/routing/src/main/resources/OSGI-INF/blueprint/shell-config.xml
rename to apps/routing/common/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index 44c99f1..58e82f6 100644
--- a/apps/routing/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/apps/routing/common/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -37,8 +37,5 @@
     <command>
       <action class="org.onosproject.routing.cli.RemovePeerCommand"/>
     </command>
-    <command>
-      <action class="org.onosproject.routing.fpm.cli.FpmConnectionsList"/>
-    </command>
   </command-bundle>
 </blueprint>
diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/AsPathTest.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/AsPathTest.java
similarity index 97%
rename from apps/routing/src/test/java/org/onosproject/routing/bgp/AsPathTest.java
rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/AsPathTest.java
index a30405a..8c567e0 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/bgp/AsPathTest.java
+++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/AsPathTest.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.hamcrest.Matchers;
@@ -21,7 +22,6 @@
 import java.util.ArrayList;
 
 import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
 import static org.junit.Assert.assertThat;
 
 /**
@@ -212,7 +212,7 @@
         //
         BgpRouteEntry.AsPath asPath2 = new BgpRouteEntry.AsPath(pathSegments);
 
-        assertThat(asPath1, Matchers.is(not(asPath2)));
+        assertThat(asPath1, Matchers.is(Matchers.not(asPath2)));
     }
 
     /**
diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.java
similarity index 98%
rename from apps/routing/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.java
rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.java
index 9482704..5a05792 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.java
+++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpRouteEntryTest.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.easymock.EasyMock;
@@ -25,7 +26,6 @@
 import java.util.ArrayList;
 
 import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
 import static org.junit.Assert.assertThat;
 
 /**
@@ -499,7 +499,7 @@
                               localPref);
         bgpRouteEntry2.setMultiExitDisc(multiExitDisc);
 
-        assertThat(bgpRouteEntry1, Matchers.is(not(bgpRouteEntry2)));
+        assertThat(bgpRouteEntry1, Matchers.is(Matchers.not(bgpRouteEntry2)));
     }
 
     /**
diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
similarity index 99%
rename from apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
index 7769f6f..9f9ad3c 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.java
+++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/BgpSessionManagerTest.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import com.google.common.net.InetAddresses;
diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.java
similarity index 96%
rename from apps/routing/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.java
rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.java
index 6df4f84..8605161 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.java
+++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/PathSegmentTest.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.hamcrest.Matchers;
@@ -21,7 +22,6 @@
 import java.util.ArrayList;
 
 import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
 import static org.junit.Assert.assertThat;
 
 /**
@@ -114,7 +114,7 @@
         BgpRouteEntry.PathSegment pathSegment2 =
             new BgpRouteEntry.PathSegment(pathSegmentType, segmentAsNumbers);
 
-        assertThat(pathSegment1, Matchers.is(not(pathSegment2)));
+        assertThat(pathSegment1, Matchers.is(Matchers.not(pathSegment2)));
     }
 
     /**
diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java
similarity index 99%
rename from apps/routing/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java
rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java
index 95982a8..901d608 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java
+++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/RouteEntryTest.java
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.hamcrest.Matchers;
diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.java
similarity index 99%
rename from apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.java
rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.java
index a4ec1b4..5ce6462 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.java
+++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerChannelHandler.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.jboss.netty.buffer.ChannelBuffer;
diff --git a/apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.java b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.java
similarity index 98%
rename from apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.java
rename to apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.java
index d8fcc52..ef9f1d3 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.java
+++ b/apps/routing/common/src/test/java/org/onosproject/routing/bgp/TestBgpPeerFrameDecoder.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.bgp;
 
 import org.jboss.netty.buffer.ChannelBuffer;
diff --git a/apps/routing/cpr/BUCK b/apps/routing/cpr/BUCK
new file mode 100644
index 0000000..89a499d
--- /dev/null
+++ b/apps/routing/cpr/BUCK
@@ -0,0 +1,30 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//incubator/api:onos-incubator-api',
+    '//apps/routing-api:onos-apps-routing-api',
+]
+
+TEST_DEPS = [
+    '//lib:TEST_ADAPTERS',
+    '//incubator/api:onos-incubator-api-tests',
+    '//apps/routing-api:onos-apps-routing-api-tests',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+    test_deps = TEST_DEPS,
+)
+
+BUNDLES = [
+    '//apps/routing/cpr:onos-apps-routing-cpr',
+    '//apps/routing-api:onos-apps-routing-api',
+]
+
+onos_app (
+    app_name = 'org.onosproject.cpr',
+    title = 'Control plane redirect',
+    category = 'Traffic Steering',
+    url = 'http://onosproject.org',
+    description = 'Redirects routing control traffic to a control plane',
+    included_bundles = BUNDLES,
+)
diff --git a/apps/routing/cpr/pom.xml b/apps/routing/cpr/pom.xml
new file mode 100644
index 0000000..cbc03df
--- /dev/null
+++ b/apps/routing/cpr/pom.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>onos-app-routing-parent</artifactId>
+        <groupId>org.onosproject</groupId>
+        <version>1.9.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>onos-apps-routing-cpr</artifactId>
+    <packaging>bundle</packaging>
+
+
+</project>
diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/ControlPlaneRedirectManager.java b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/ControlPlaneRedirectManager.java
similarity index 97%
rename from apps/routing/src/main/java/org/onosproject/routing/impl/ControlPlaneRedirectManager.java
rename to apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/ControlPlaneRedirectManager.java
index f72963c..e1d2d39 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/impl/ControlPlaneRedirectManager.java
+++ b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/ControlPlaneRedirectManager.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.
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.routing.impl;
+package org.onosproject.routing.cpr;
 
 import com.google.common.collect.ImmutableSortedSet;
 import com.google.common.collect.Lists;
@@ -57,6 +57,8 @@
 import org.onosproject.net.host.HostListener;
 import org.onosproject.net.host.HostService;
 import org.onosproject.net.host.InterfaceIpAddress;
+import org.onosproject.routing.AsyncDeviceFetcher;
+import org.onosproject.routing.RouterInterfaceManager;
 import org.onosproject.routing.RoutingService;
 import org.onosproject.routing.config.RouterConfig;
 import org.slf4j.Logger;
@@ -80,11 +82,13 @@
  * Manages connectivity between peers redirecting control traffic to a routing
  * control plane available on the dataplane.
  */
-@Component(immediate = true, enabled = false)
+@Component(immediate = true)
 public class ControlPlaneRedirectManager {
 
     private final Logger log = getLogger(getClass());
 
+    public static final short ASSIGNED_VLAN = 4094;
+
     private static final int MIN_IP_PRIORITY = 10;
     private static final int IPV4_PRIORITY = 2000;
     private static final int IPV6_PRIORITY = 500;
@@ -140,6 +144,7 @@
 
         processRouterConfig();
 
+
         // FIXME There can be an issue when this component is deactivated before vRouter
         applicationService.registerDeactivateHook(this.appId, () -> {
             if (interfaceManager != null) {
@@ -239,10 +244,10 @@
             int cpNextId, intfNextId;
             if (intf.vlan() == VlanId.NONE) {
                 cpNextId = modifyNextObjective(deviceId, controlPlanePort,
-                               VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN),
+                               VlanId.vlanId(ASSIGNED_VLAN),
                                true, install);
                 intfNextId = modifyNextObjective(deviceId, intf.connectPoint().port(),
-                               VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN),
+                               VlanId.vlanId(ASSIGNED_VLAN),
                                true, install);
             } else {
                 cpNextId = modifyNextObjective(deviceId, controlPlanePort,
@@ -365,7 +370,7 @@
         int cpNextId;
         if (intf.vlan() == VlanId.NONE) {
             cpNextId = modifyNextObjective(deviceId, controlPlanePort,
-                           VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN),
+                           VlanId.vlanId(ASSIGNED_VLAN),
                            true, install);
         } else {
             cpNextId = modifyNextObjective(deviceId, controlPlanePort,
@@ -680,7 +685,7 @@
 
             TrafficSelector.Builder metabuilder = DefaultTrafficSelector.builder();
             VlanId matchVlanId = (vlanId.equals(VlanId.NONE)) ?
-                    VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN) :
+                    VlanId.vlanId(ASSIGNED_VLAN) :
                     vlanId;
             metabuilder.matchVlanId(matchVlanId);
             nextObjBuilder.withMeta(metabuilder.build());
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/cli/package-info.java b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/package-info.java
similarity index 82%
copy from apps/routing/src/main/java/org/onosproject/routing/fpm/cli/package-info.java
copy to apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/package-info.java
index c1729ab..b098961 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/cli/package-info.java
+++ b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/package-info.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.
@@ -15,6 +15,6 @@
  */
 
 /**
- * FPM-related CLI commands.
+ * Control plane redirect.
  */
-package org.onosproject.routing.fpm.cli;
+package org.onosproject.routing.cpr;
diff --git a/apps/routing/src/test/java/org/onosproject/routing/impl/ControlPlaneRedirectManagerTest.java b/apps/routing/cpr/src/test/java/org/onosproject/routing/cpr/ControlPlaneRedirectManagerTest.java
similarity index 96%
rename from apps/routing/src/test/java/org/onosproject/routing/impl/ControlPlaneRedirectManagerTest.java
rename to apps/routing/cpr/src/test/java/org/onosproject/routing/cpr/ControlPlaneRedirectManagerTest.java
index 08864c8..1291f8f 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/impl/ControlPlaneRedirectManagerTest.java
+++ b/apps/routing/cpr/src/test/java/org/onosproject/routing/cpr/ControlPlaneRedirectManagerTest.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.
@@ -13,7 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.routing.impl;
+
+package org.onosproject.routing.cpr;
 
 import com.google.common.collect.Sets;
 import org.easymock.EasyMock;
@@ -79,11 +80,11 @@
 import static org.easymock.EasyMock.verify;
 import static org.onlab.packet.ICMP6.NEIGHBOR_ADVERTISEMENT;
 import static org.onlab.packet.ICMP6.NEIGHBOR_SOLICITATION;
-import static org.onosproject.routing.impl.ControlPlaneRedirectManager.ACL_PRIORITY;
-import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildArpSelector;
-import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildIPDstSelector;
-import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildIPSrcSelector;
-import static org.onosproject.routing.impl.ControlPlaneRedirectManager.buildNdpSelector;
+import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.ACL_PRIORITY;
+import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildArpSelector;
+import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildIPDstSelector;
+import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildIPSrcSelector;
+import static org.onosproject.routing.cpr.ControlPlaneRedirectManager.buildNdpSelector;
 
 /**
  * UnitTests for ControlPlaneRedirectManager.
@@ -272,9 +273,9 @@
             int cpNextId, intfNextId;
 
             cpNextId = modifyNextObjective(deviceId, controlPlanePort,
-                    VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), true, install);
+                    VlanId.vlanId(ControlPlaneRedirectManager.ASSIGNED_VLAN), true, install);
             intfNextId = modifyNextObjective(deviceId, intf.connectPoint().port(),
-                    VlanId.vlanId(SingleSwitchFibInstaller.ASSIGNED_VLAN), true, install);
+                    VlanId.vlanId(ControlPlaneRedirectManager.ASSIGNED_VLAN), true, install);
 
             // IP to router
             TrafficSelector toSelector = buildIPDstSelector(
diff --git a/apps/routing/fibinstaller/BUCK b/apps/routing/fibinstaller/BUCK
new file mode 100644
index 0000000..b77e51b
--- /dev/null
+++ b/apps/routing/fibinstaller/BUCK
@@ -0,0 +1,30 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//incubator/api:onos-incubator-api',
+    '//apps/routing-api:onos-apps-routing-api',
+]
+
+TEST_DEPS = [
+    '//lib:TEST_ADAPTERS',
+    '//incubator/api:onos-incubator-api-tests',
+    '//apps/routing-api:onos-apps-routing-api-tests',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+    test_deps = TEST_DEPS,
+)
+
+BUNDLES = [
+    '//apps/routing/fibinstaller:onos-apps-routing-fibinstaller',
+    '//apps/routing-api:onos-apps-routing-api',
+]
+
+onos_app (
+    app_name = 'org.onosproject.fibinstaller',
+    title = 'FIB installer app',
+    category = 'Traffic Steering',
+    url = 'http://onosproject.org',
+    description = 'Installs routing rules into switches',
+    included_bundles = BUNDLES,
+)
diff --git a/apps/routing/fibinstaller/pom.xml b/apps/routing/fibinstaller/pom.xml
new file mode 100644
index 0000000..5cb98e6
--- /dev/null
+++ b/apps/routing/fibinstaller/pom.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>onos-app-routing-parent</artifactId>
+        <groupId>org.onosproject</groupId>
+        <version>1.9.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>onos-apps-routing-fibinstaller</artifactId>
+    <packaging>bundle</packaging>
+
+
+</project>
diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/SingleSwitchFibInstaller.java b/apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstaller.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/impl/SingleSwitchFibInstaller.java
rename to apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstaller.java
index b55dba6..c6b3af4 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/impl/SingleSwitchFibInstaller.java
+++ b/apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstaller.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.
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.routing.impl;
+package org.onosproject.routing.fibinstaller;
 
 import com.google.common.collect.ConcurrentHashMultiset;
 import com.google.common.collect.Maps;
@@ -67,6 +67,10 @@
 import org.onosproject.net.flowobjective.ForwardingObjective;
 import org.onosproject.net.flowobjective.NextObjective;
 import org.onosproject.net.flowobjective.ObjectiveContext;
+import org.onosproject.routing.AsyncDeviceFetcher;
+import org.onosproject.routing.NextHop;
+import org.onosproject.routing.NextHopGroupKey;
+import org.onosproject.routing.RouterInterfaceManager;
 import org.onosproject.routing.RoutingService;
 import org.onosproject.routing.config.RouterConfig;
 import org.osgi.service.component.ComponentContext;
@@ -80,7 +84,7 @@
 /**
  * Programs routes to a single OpenFlow switch.
  */
-@Component(immediate = true, enabled = false)
+@Component(immediate = true)
 public class SingleSwitchFibInstaller {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java b/apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/package-info.java
similarity index 81%
copy from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java
copy to apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/package-info.java
index 5d18761..669754d 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java
+++ b/apps/routing/fibinstaller/src/main/java/org/onosproject/routing/fibinstaller/package-info.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.
@@ -15,6 +15,6 @@
  */
 
 /**
- * FPM protocol implementation.
+ * Single switch FIB installer.
  */
-package org.onosproject.routing.fpm.protocol;
+package org.onosproject.routing.fibinstaller;
diff --git a/apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java b/apps/routing/fibinstaller/src/test/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstallerTest.java
similarity index 98%
rename from apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java
rename to apps/routing/fibinstaller/src/test/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstallerTest.java
index 1e6efb5..f7736f7 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java
+++ b/apps/routing/fibinstaller/src/test/java/org/onosproject/routing/fibinstaller/SingleSwitchFibInstallerTest.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.
@@ -13,7 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.routing.impl;
+
+package org.onosproject.routing.fibinstaller;
 
 import com.google.common.collect.Sets;
 import org.easymock.EasyMock;
diff --git a/apps/routing/fpm/BUCK b/apps/routing/fpm/BUCK
new file mode 100644
index 0000000..b221d0e
--- /dev/null
+++ b/apps/routing/fpm/BUCK
@@ -0,0 +1,30 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//lib:org.apache.karaf.shell.console',
+    '//cli:onos-cli',
+    '//incubator/api:onos-incubator-api',
+    '//apps/routing-api:onos-apps-routing-api',
+]
+
+TEST_DEPS = [
+    '//lib:TEST_ADAPTERS',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+    test_deps = TEST_DEPS,
+)
+
+BUNDLES = [
+    '//apps/routing/fpm:onos-apps-routing-fpm',
+    '//apps/routing-api:onos-apps-routing-api',
+]
+
+onos_app (
+    app_name = 'org.onosproject.fpm',
+    title = 'FIB Push Manager (FPM) route reciever',
+    category = 'Utility',
+    url = 'http://onosproject.org',
+    description = 'Receives routes from external routing daemon over FPM protocol',
+    included_bundles = BUNDLES,
+)
diff --git a/apps/routing/fpm/pom.xml b/apps/routing/fpm/pom.xml
new file mode 100644
index 0000000..03427d7
--- /dev/null
+++ b/apps/routing/fpm/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>onos-app-routing-parent</artifactId>
+        <groupId>org.onosproject</groupId>
+        <version>1.9.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>onos-apps-fpm</artifactId>
+    <packaging>bundle</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-cli</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.karaf.shell</groupId>
+            <artifactId>org.apache.karaf.shell.console</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.java
similarity index 96%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.java
index 87907cd..479b4da 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmFrameDecoder.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmInfoService.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmInfoService.java
similarity index 93%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/FpmInfoService.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmInfoService.java
index 3f5068b..018b1bb 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmInfoService.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmInfoService.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmListener.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmListener.java
similarity index 96%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/FpmListener.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmListener.java
index c7fffd1..37fe1f7 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmListener.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmListener.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmManager.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmManager.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/FpmManager.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmManager.java
index 9065044..0ca21e6 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmManager.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmManager.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,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.onosproject.routing.fpm;
 
 import com.google.common.collect.ImmutableList;
@@ -67,7 +68,7 @@
  * Forwarding Plane Manager (FPM) route source.
  */
 @Service
-@Component(immediate = true, enabled = false)
+@Component(immediate = true)
 public class FpmManager implements FpmInfoService {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.java
index 35e482b..33f845e 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/FpmSessionHandler.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java
similarity index 91%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java
index 9d180eb..86dd44c 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.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.
@@ -34,7 +34,7 @@
 
     @Override
     protected void execute() {
-        FpmInfoService fpmInfo = get(FpmInfoService.class);
+        FpmInfoService fpmInfo = AbstractShellCommand.get(FpmInfoService.class);
 
         fpmInfo.peers().forEach((socketAddress, timestamp) -> {
             if (socketAddress instanceof InetSocketAddress) {
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/cli/package-info.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/package-info.java
similarity index 92%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/cli/package-info.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/package-info.java
index c1729ab..8c4812d 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/cli/package-info.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/package-info.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/package-info.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/package-info.java
similarity index 92%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/package-info.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/package-info.java
index 851f7f8..1f4f1de 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/package-info.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/package-info.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.java
index ce8cf58..5bba9fb 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/FpmHeader.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.java
index 08e1ee2..79c23ab 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/Netlink.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.java
similarity index 96%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.java
index 9b27c0c..0abb0bd 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/NetlinkMessageType.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.java
index d8b0474..cffb422 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttribute.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.java
similarity index 95%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.java
index e76f64b..f702c40 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDecoder.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java
similarity index 97%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java
index 6913456..d12f14c 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeDst.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.java
similarity index 97%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.java
index a9f6c49..0f5d158 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeGateway.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.java
similarity index 97%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.java
index 36d28a7..28c4b32 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributeOif.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.java
similarity index 97%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.java
index 19d720b..8f324f9 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RouteAttributePriority.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java
similarity index 98%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java
index c3cf65a..f914f0c 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.java
similarity index 97%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.java
index dd682d4..de86394 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/RtProtocol.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.
diff --git a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java
similarity index 92%
rename from apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java
rename to apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java
index 5d18761..fed7b1e 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/fpm/protocol/package-info.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/protocol/package-info.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.
diff --git a/apps/routing/fpm/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/apps/routing/fpm/src/main/resources/OSGI-INF/blueprint/shell-config.xml
new file mode 100644
index 0000000..fe6f8f5
--- /dev/null
+++ b/apps/routing/fpm/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -0,0 +1,23 @@
+<!--
+  ~ 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.
+  -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+  <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
+    <command>
+      <action class="org.onosproject.routing.fpm.cli.FpmConnectionsList"/>
+    </command>
+  </command-bundle>
+</blueprint>
diff --git a/apps/routing/pom.xml b/apps/routing/pom.xml
index 11db777..bfe163d 100644
--- a/apps/routing/pom.xml
+++ b/apps/routing/pom.xml
@@ -24,10 +24,16 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>onos-app-routing</artifactId>
+    <artifactId>onos-app-routing-parent</artifactId>
 
-    <packaging>bundle</packaging>
+    <packaging>pom</packaging>
     <description>Libraries for routing applications</description>
+    <modules>
+        <module>fibinstaller</module>
+        <module>common</module>
+        <module>cpr</module>
+        <module>fpm</module>
+    </modules>
 
     <dependencies>
         <dependency>
@@ -53,46 +59,8 @@
         </dependency>
 
         <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-cli</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <!-- FIXME: not OSGi-ready -->
-        <dependency>
-            <groupId>com.googlecode.concurrent-trees</groupId>
-            <artifactId>concurrent-trees</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onlab-misc</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-annotations</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>io.netty</groupId>
-            <artifactId>netty</artifactId>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
         </dependency>
 
         <dependency>
@@ -101,16 +69,6 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.console</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>org.onosproject</groupId>
             <artifactId>onlab-junit</artifactId>
             <scope>test</scope>
diff --git a/apps/sdnip/BUCK b/apps/sdnip/BUCK
index e91ada3..0067e19 100644
--- a/apps/sdnip/BUCK
+++ b/apps/sdnip/BUCK
@@ -10,7 +10,7 @@
 BUNDLES = [
     '//apps/sdnip:onos-apps-sdnip',
     '//apps/routing-api:onos-apps-routing-api',
-    '//apps/routing:onos-apps-routing',
+    '//apps/routing/common:onos-apps-routing-common',
 ]
 
 TEST_DEPS = [
diff --git a/apps/vrouter/BUCK b/apps/vrouter/BUCK
index e2322e3..267460a 100644
--- a/apps/vrouter/BUCK
+++ b/apps/vrouter/BUCK
@@ -5,7 +5,7 @@
 
 BUNDLES = [
     '//apps/routing-api:onos-apps-routing-api',
-    '//apps/routing:onos-apps-routing',
+    '//apps/routing/common:onos-apps-routing-common',
     '//apps/vrouter:onos-apps-vrouter',
 ]
 
@@ -19,4 +19,5 @@
     url = 'http://onosproject.org',
     included_bundles = BUNDLES,
     description = 'Virtual router (vRouter) application.',
+    required_apps = [ 'org.onosproject.fibinstaller', 'org.onosproject.cpr', 'org.onosproject.fpm' ],
 )
diff --git a/apps/vrouter/src/main/java/org/onosproject/vrouter/Vrouter.java b/apps/vrouter/src/main/java/org/onosproject/vrouter/Vrouter.java
index 331d04a..d694996 100644
--- a/apps/vrouter/src/main/java/org/onosproject/vrouter/Vrouter.java
+++ b/apps/vrouter/src/main/java/org/onosproject/vrouter/Vrouter.java
@@ -19,20 +19,15 @@
 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.Modified;
-import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.onlab.util.Tools;
 import org.onosproject.cfg.ComponentConfigService;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
 import org.onosproject.incubator.component.ComponentService;
-import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Dictionary;
 import java.util.List;
 
 /**
@@ -44,9 +39,6 @@
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     private static final String APP_NAME = "org.onosproject.vrouter";
-    private static final String FPM_MANAGER = "org.onosproject.routing.fpm.FpmManager";
-    private static final String FIB_INSTALLER = "org.onosproject.routing.impl.SingleSwitchFibInstaller";
-    private static final String CP_REDIRECT = "org.onosproject.routing.impl.ControlPlaneRedirectManager";
     private static final String DIRECT_HOST_MGR = "org.onosproject.routing.impl.DirectHostManager";
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
@@ -58,32 +50,19 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
     private ComponentConfigService componentConfigService;
 
-    /**
-     * vRouter will push flows to the switches when receiving routes by enabling
-     * FIB installer.
-     * <p>
-     * It should be turned off when vRouter is deployed in a scenario where
-     * other components that pushes the routes.
-     */
-    @Property(name = "fibInstallerEnabled", boolValue = true,
-            label = "Enable single switch fib installer; default is true")
-    private boolean fibInstallerEnabled = true;
-
     private ApplicationId appId;
 
-    private List<String> baseComponents = Lists.newArrayList(FPM_MANAGER, CP_REDIRECT, DIRECT_HOST_MGR);
+    private List<String> baseComponents = Lists.newArrayList(DIRECT_HOST_MGR);
 
     @Activate
-    protected void activate(ComponentContext context) {
+    protected void activate() {
         appId = coreService.registerApplication(APP_NAME);
-        componentConfigService.registerProperties(getClass());
 
         componentConfigService.preSetProperty(
                 "org.onosproject.incubator.store.routing.impl.RouteStoreImpl",
                 "distributed", "true");
 
         baseComponents.forEach(name -> componentService.activate(appId, name));
-        modified(context);
 
         log.info("Started");
     }
@@ -96,28 +75,4 @@
 
         log.info("Stopped");
     }
-
-    @Modified
-    private void modified(ComponentContext context) {
-        Dictionary<?, ?> properties = context.getProperties();
-        if (properties == null) {
-            return;
-        }
-
-        Boolean newFibInstallerEnabled = Tools.isPropertyEnabled(properties, "fibInstallerEnabled");
-        if (newFibInstallerEnabled == null) {
-            log.info("fibInstallerEnabled is not configured, " +
-                    "using current value of {}", fibInstallerEnabled);
-        } else {
-            fibInstallerEnabled = newFibInstallerEnabled;
-            log.info("Configured. fibInstallerEnabled set to {}, ",
-                    fibInstallerEnabled ? "enabled" : "disabled");
-        }
-
-        if (fibInstallerEnabled) {
-            componentService.activate(appId, FIB_INSTALLER);
-        } else {
-            componentService.deactivate(appId, FIB_INSTALLER);
-        }
-    }
 }
diff --git a/modules.defs b/modules.defs
index 1640494..1f89072 100644
--- a/modules.defs
+++ b/modules.defs
@@ -163,6 +163,9 @@
     '//apps/virtualbng:onos-apps-virtualbng-oar',
     '//apps/vpls:onos-apps-vpls-oar',
     '//apps/vrouter:onos-apps-vrouter-oar',
+    '//apps/routing/fibinstaller:onos-apps-routing-fibinstaller-oar',
+    '//apps/routing/cpr:onos-apps-routing-cpr-oar',
+    '//apps/routing/fpm:onos-apps-routing-fpm-oar',
     '//apps/vtn:onos-apps-vtn-oar',
     '//apps/faultmanagement:onos-apps-faultmanagement-oar',
     '//apps/openstacknode:onos-apps-openstacknode-oar',
@@ -184,7 +187,7 @@
     '//apps/fwd:onos-apps-fwd',
     '//apps/iptopology-api:onos-apps-iptopology-api',
     '//apps/openstacknode:onos-apps-openstacknode',
-    '//apps/routing:onos-apps-routing',
+    '//apps/routing/common:onos-apps-routing-common',
     '//apps/vtn/vtnrsc:onos-apps-vtn-vtnrsc',
     '//apps/vtn/sfcmgr:onos-apps-vtn-sfcmgr',
     '//apps/vtn/vtnmgr:onos-apps-vtn-vtnmgr',