diff --git a/apps/simplefabric/BUCK b/apps/simplefabric/BUCK
new file mode 100644
index 0000000..e181a98
--- /dev/null
+++ b/apps/simplefabric/BUCK
@@ -0,0 +1,13 @@
+BUNDLES = [
+    '//apps/simplefabric/api:onos-apps-simplefabric-api',
+    '//apps/simplefabric/app:onos-apps-simplefabric-app',
+]
+
+onos_app (
+    title = 'SONA SimpleFabric',
+    category = 'Traffic Engineering',
+    url = 'http://onosproject.org',
+    included_bundles = BUNDLES,
+    description = 'SONA Simple Fabric Application',
+    required_apps = [ 'org.onosproject.openflow-base', 'org.onosproject.lldpprovider', 'org.onosproject.hostprovider' ],
+)
\ No newline at end of file
diff --git a/apps/simplefabric/BUILD b/apps/simplefabric/BUILD
index 007b701..3fabae0 100644
--- a/apps/simplefabric/BUILD
+++ b/apps/simplefabric/BUILD
@@ -1,27 +1,17 @@
-COMPILE_DEPS = CORE_DEPS + JACKSON + CLI + REST + [
-    "@concurrent_trees//jar",
-]
-
 BUNDLES = [
-    "//apps/simplefabric:onos-apps-simplefabric",
+    "//apps/simplefabric/api:onos-apps-simplefabric-api",
+    "//apps/simplefabric/app:onos-apps-simplefabric-app",
 ]
 
-osgi_jar_with_tests(
-    karaf_command_packages = ["org.onosproject.simplefabric"],
-    test_deps = TEST_ADAPTERS,
-    web_context = "/onos/v1/simplefabric",
-    deps = COMPILE_DEPS,
-)
-
 onos_app(
     category = "Traffic Engineering",
-    description = "Simple Fabric application",
+    description = "SONA Simple Fabric Application",
     included_bundles = BUNDLES,
     required_apps = [
         "org.onosproject.openflow-base",
         "org.onosproject.lldpprovider",
         "org.onosproject.hostprovider",
     ],
-    title = "SimpleFabric",
+    title = "SONA SimpleFabric",
     url = "http://onosproject.org",
 )
diff --git a/apps/simplefabric/api/BUCK b/apps/simplefabric/api/BUCK
new file mode 100644
index 0000000..520bddf
--- /dev/null
+++ b/apps/simplefabric/api/BUCK
@@ -0,0 +1,16 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//lib:org.apache.karaf.shell.console',
+    '//cli:onos-cli',
+]
+
+TEST_DEPS = [
+    '//lib:TEST_ADAPTERS',
+    '//core/api:onos-api-tests',
+    '//core/common:onos-core-common-tests',
+]
+
+osgi_jar_with_tests (
+    deps = COMPILE_DEPS,
+    test_deps = TEST_DEPS,
+)
diff --git a/apps/simplefabric/api/BUILD b/apps/simplefabric/api/BUILD
new file mode 100644
index 0000000..b22d9f6
--- /dev/null
+++ b/apps/simplefabric/api/BUILD
@@ -0,0 +1,11 @@
+COMPILE_DEPS = CORE_DEPS + CLI
+
+TEST_DEPS = TEST_ADAPTERS + [
+    "//core/api:onos-api-tests",
+    "//core/common:onos-core-common-tests",
+]
+
+osgi_jar_with_tests(
+    test_deps = TEST_DEPS,
+    deps = COMPILE_DEPS,
+)
diff --git a/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/Constants.java b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/Constants.java
new file mode 100644
index 0000000..703e01b
--- /dev/null
+++ b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/Constants.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.simplefabric.api;
+
+/**
+ * Provides constants used in simple fabric services.
+ */
+public final class Constants {
+
+    private Constants() {
+    }
+
+    // App symbols
+    public static final String APP_ID = "org.onosproject.simplefabric";
+    public static final String FORWARDING_APP_ID = "org.onosproject.simplefabric.forwarding";
+    public static final String ROUTING_APP_ID = "org.onosproject.simplefabric.routing";
+
+    // Priority for l2NetworkRouting: L2NETWORK_UNICAST or L2NETWORK_BROADCAST
+    public static final int PRI_L2NETWORK_UNICAST = 601;
+    public static final int PRI_L2NETWORK_BROADCAST = 600;
+
+    // Reactive Routing within Local Subnets
+    // ASSUME: local subnets NEVER overlaps each other
+    public static final int PRI_REACTIVE_LOCAL_FORWARD = 501;
+    public static final int PRI_REACTIVE_LOCAL_INTERCEPT = 500;
+    // Reactive Routing for Border Routes with local subnet
+    // Priority: REACTIVE_BROUTE_BASE + routeIpPrefix * REACTIVE_BROUTE_STEP
+    //           + REACTIVE_BROUTE_FORWARD or REACTIVE_BROUTE_INTERCEPT
+    public static final int PRI_REACTIVE_BORDER_BASE = 100;
+    public static final int PRI_REACTIVE_BORDER_STEP = 2;
+    public static final int PRI_REACTIVE_BORDER_FORWARD = 1;
+    public static final int PRI_REACTIVE_BORDER_INTERCEPT = 0;
+
+    // Simple fabric event related timers
+    public static final long IDLE_INTERVAL_MSEC = 5000;
+
+    // Feature control parameters
+    public static final boolean ALLOW_IPV6 = false;
+    public static final boolean ALLOW_ETH_ADDRESS_SELECTOR = true;
+    public static final boolean REACTIVE_SINGLE_TO_SINGLE = false;
+    public static final boolean REACTIVE_ALLOW_LINK_CP = false;  // MUST BE false (yjlee, 2017-10-18)
+    public static final boolean REACTIVE_HASHED_PATH_SELECTION = false;
+    public static final boolean REACTIVE_MATCH_IP_PROTO = false;
+}
diff --git a/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/FabricNetwork.java b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/FabricNetwork.java
new file mode 100644
index 0000000..bae189d
--- /dev/null
+++ b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/FabricNetwork.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.simplefabric.api;
+
+import org.onlab.packet.VlanId;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.EncapsulationType;
+import org.onosproject.net.Host;
+import org.onosproject.net.HostId;
+import org.onosproject.net.intf.Interface;
+
+import java.util.Set;
+
+/**
+ * Interface of fabric network.
+ */
+public interface FabricNetwork {
+
+    /**
+     * Gets DefaultFabricNetwork name.
+     *
+     * @return the name of DefaultFabricNetwork
+     */
+    String name();
+
+    /**
+     * Gets DefaultFabricNetwork interfaceNames.
+     *
+     * @return the interfaceNames of DefaultFabricNetwork
+     */
+    Set<String> interfaceNames();
+
+    /**
+     * Gets DefaultFabricNetwork encapsulation type.
+     *
+     * @return the encapsulation type of DefaultFabricNetwork
+     */
+    EncapsulationType encapsulation();
+
+    /**
+     * Gets DefaultFabricNetwork forward flag.
+     *
+     * @return the forward flag of DefaultFabricNetwork
+     */
+    boolean isForward();
+
+    /**
+     * Gets DefaultFabricNetwork broadcast flag.
+     *
+     * @return the broadcast flag of DefaultFabricNetwork
+     */
+    boolean isBroadcast();
+
+    /**
+     * Gets DefaultFabricNetwork interfaces.
+     *
+     * @return the interfaces of DefaultFabricNetwork
+     */
+    Set<Interface> interfaces();
+
+    /**
+     * Gets DefaultFabricNetwork hosts.
+     *
+     * @return the hosts of DefaultFabricNetwork
+     */
+    Set<HostId> hostIds();
+
+    /**
+     * Gets DefaultFabricNetwork isDirty flag.
+     *
+     * @return the isDirty flag of DefaultFabricNetwork
+     */
+    boolean isDirty();
+
+    /**
+     * Checks if the interface is of DefaultFabricNetwork.
+     *
+     * @param iface the interface to be checked
+     * @return true if DefaultFabricNetwork contains the interface
+     */
+    boolean contains(Interface iface);
+
+    /**
+     * Checks if the ConnectPoint and Vlan is of DefaultFabricNetwork.
+     *
+     * @param port the ConnectPoint to be checked
+     * @param vlanId the VlanId of the ConnectPoint to be checked
+     * @return true if DefaultFabricNetwork contains the interface of the ConnnectPoint and VlanId
+     */
+    boolean contains(ConnectPoint port, VlanId vlanId);
+
+    /**
+     * Checks if the DeviceId is of DefaultFabricNetwork.
+     *
+     * @param deviceId the DeviceId to be checked
+     * @return true if DefaultFabricNetwork contains any interface of the DeviceId
+     */
+    boolean contains(DeviceId deviceId);
+
+    /**
+     * Adds interface to DefaultFabricNetwork.
+     *
+     * @param iface the Interface to be added
+     */
+    void addInterface(Interface iface);
+
+    /**
+     * Adds host to DefaultFabricNetwork.
+     *
+     * @param host the Host to be added
+     */
+    void addHost(Host host);
+
+    /**
+     * Sets DefaultFabricNetwork isDirty flag.
+     *
+     * @param newDirty the isDirty flag to be set
+     */
+    void setDirty(boolean newDirty);
+
+    /**
+     * Builder of FabricNetwork.
+     */
+    interface Builder {
+
+        /**
+         * Returns FabricNetwork builder with supplied network name.
+         *
+         * @param name network name
+         * @return FabricNetwork instance builder
+         */
+        Builder name(String name);
+
+        /**
+         * Returns FabricNetwork builder with supplied interface names.
+         *
+         * @param interfaceNames interface names
+         * @return FabricNetwork instance builder
+         */
+        Builder interfaceNames(Set<String> interfaceNames);
+
+        /**
+         * Returns FabricNetwork builder with supplied encapsulation type.
+         *
+         * @param encapsulation encapsulation type
+         * @return FabricNetwork instance builder
+         */
+        Builder encapsulation(EncapsulationType encapsulation);
+
+        /**
+         * Returns FabricNetwork builder with supplied forward flag.
+         *
+         * @param forward forward flag
+         * @return FabricNetwork instance builder
+         */
+        Builder forward(boolean forward);
+
+        /**
+         * Returns FabricNetwork builder with supplied broadcast flag.
+         *
+         * @param broadcast broadcast flag
+         * @return FabricNetwork instance builder
+         */
+        Builder broadcast(boolean broadcast);
+
+        /**
+         * Builds an immutable FabricNetwork instance.
+         *
+         * @return FabricNetwork instance
+         */
+        FabricNetwork build();
+    }
+}
diff --git a/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/FabricRoute.java b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/FabricRoute.java
new file mode 100644
index 0000000..f12260a
--- /dev/null
+++ b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/FabricRoute.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.simplefabric.api;
+
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.IpPrefix;
+import org.onosproject.cluster.NodeId;
+
+/**
+ * Interface of fabric route.
+ */
+public interface FabricRoute {
+
+    /**
+     * Source of the route.
+     */
+    enum Source {
+        /**
+         * Route came from the iBGP route source.
+         */
+        BGP,
+
+        /**
+         * Route came from the FPM route source.
+         */
+        FPM,
+
+        /**
+         * Route can from the static route source.
+         */
+        STATIC,
+
+        /**
+         * Route source was not defined.
+         */
+        UNDEFINED
+    }
+
+    /**
+     * Returns the route source.
+     *
+     * @return route source
+     */
+    Source source();
+
+    /**
+     * Returns the IP prefix of the route.
+     *
+     * @return IP prefix
+     */
+    IpPrefix prefix();
+
+    /**
+     * Returns the next hop IP address.
+     *
+     * @return next hop
+     */
+    IpAddress nextHop();
+
+    /**
+     * Returns the ONOS node the route was sourced from.
+     *
+     * @return ONOS node ID
+     */
+    NodeId sourceNode();
+
+    /**
+     * Builder of FabricRoute.
+     */
+    interface Builder {
+
+        /**
+         * Returns FabricRoute builder with supplied source.
+         *
+         * @param source source of route
+         * @return FabricRoute instance builder
+         */
+        Builder source(Source source);
+
+        /**
+         * Returns FabricRoute builder with supplied IP prefix.
+         *
+         * @param prefix IP prefix
+         * @return FabricRoute instance builder
+         */
+        Builder prefix(IpPrefix prefix);
+
+        /**
+         * Returns Fabric builder with supplied next hop.
+         *
+         * @param nextHop next hop
+         * @return FabricRoute instance builder
+         */
+        Builder nextHop(IpAddress nextHop);
+
+        /**
+         * Returns Fabric builder with supplied source node identifier.
+         *
+         * @param sourceNode source node identifier
+         * @return FabricRoute instance builder
+         */
+        Builder sourceNode(NodeId sourceNode);
+
+        /**
+         * Builds an immutable FabricRoute instance.
+         *
+         * @return FabricRoute instance
+         */
+        FabricRoute build();
+    }
+}
diff --git a/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/FabricSubnet.java b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/FabricSubnet.java
new file mode 100644
index 0000000..ca56946
--- /dev/null
+++ b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/FabricSubnet.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.simplefabric.api;
+
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.IpPrefix;
+import org.onlab.packet.MacAddress;
+import org.onosproject.net.EncapsulationType;
+
+/**
+ * Interface of FabricSubnet.
+ */
+public interface FabricSubnet {
+
+    /**
+     * Gets the IP subnet of the IP subnet entry.
+     *
+     * @return the IP subnet
+     */
+    IpPrefix prefix();
+
+    /**
+     * Gets the virtual gateway IP address of the IP subnet entry.
+     *
+     * @return the virtual gateway IP address
+     */
+    IpAddress gatewayIp();
+
+    /**
+     * Gets the virtual gateway Mac address of the IP subnet entry.
+     *
+     * @return the virtuai gateway Mac address
+     */
+    MacAddress gatewayMac();
+
+    /**
+     * Gets the encapsulation type of IP subnet entry.
+     *
+     * @return the encapsulation type
+     */
+    EncapsulationType encapsulation();
+
+    /**
+     * Gets the network name.
+     *
+     * @return the network name
+     */
+    String networkName();
+
+    /**
+     * Tests whether the IP version of this entry is IPv4.
+     *
+     * @return true if the IP version of this entry is IPv4, otherwise false.
+     */
+    boolean isIp4();
+
+    /**
+     * Tests whether the IP version of this entry is IPv6.
+     *
+     * @return true if the IP version of this entry is IPv6, otherwise false.
+     */
+    boolean isIp6();
+
+    /**
+     * Builder of Ip Subnet.
+     */
+    interface Builder {
+
+        /**
+         * Returns FabricSubnet builder with supplied IpPrefix.
+         *
+         * @param ipPrefix IP prefix
+         * @return FabricSubnet instance builder
+         */
+        Builder prefix(IpPrefix ipPrefix);
+
+        /**
+         * Returns FabricSubnet builder with supplied gatewayIp.
+         *
+         * @param gatewayIp gateway IP
+         * @return FabricSubnet instance builder
+         */
+        Builder gatewayIp(IpAddress gatewayIp);
+
+        /**
+         * Returns FabricSubnet builder with supplied gatewayMac.
+         *
+         * @param gatewayMac gateway MAC
+         * @return FabricSubnet instance builder
+         */
+        Builder gatewayMac(MacAddress gatewayMac);
+
+        /**
+         * Returns FabricSubnet builder with supplied encapsulation type.
+         *
+         * @param encapsulation encapsulation type
+         * @return FabricSubnet instance builder
+         */
+        Builder encapsulation(EncapsulationType encapsulation);
+
+        /**
+         * Returns FabricSubnet builder with supplied network name.
+         *
+         * @param networkName network name
+         * @return FabricSubnet instance builder
+         */
+        Builder networkName(String networkName);
+
+        /**
+         * Builds an immutable FabricSubnet instance.
+         *
+         * @return FabricSubnet instance
+         */
+        FabricSubnet build();
+    }
+}
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricEvent.java b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/SimpleFabricEvent.java
similarity index 95%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricEvent.java
rename to apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/SimpleFabricEvent.java
index cac1276..aac465b 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricEvent.java
+++ b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/SimpleFabricEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * 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.simplefabric;
+package org.onosproject.simplefabric.api;
 
 import org.onosproject.event.AbstractEvent;
 
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/SimpleFabricListener.java
similarity index 88%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
rename to apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/SimpleFabricListener.java
index 726d578..25bf529 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
+++ b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/SimpleFabricListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.simplefabric;
+package org.onosproject.simplefabric.api;
 
 import org.onosproject.event.EventListener;
 
diff --git a/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/SimpleFabricService.java b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/SimpleFabricService.java
new file mode 100644
index 0000000..33b9c5e
--- /dev/null
+++ b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/SimpleFabricService.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.simplefabric.api;
+
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.event.ListenerService;
+import org.onosproject.net.intf.Interface;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.Host;
+
+import java.io.OutputStream;
+import java.util.Set;
+import java.util.Collection;
+
+/**
+ * Provides information about the routing configuration.
+ */
+public interface SimpleFabricService
+        extends ListenerService<SimpleFabricEvent, SimpleFabricListener> {
+
+    /**
+     * Gets appId.
+     *
+     * @return appId of simple fabric app
+     */
+    ApplicationId appId();
+
+    /**
+     * Gets all the fabric networks.
+     *
+     * @return all the fabric networks
+     */
+    Collection<FabricNetwork> fabricNetworks();
+
+    /**
+     * Retrieves the entire set of fabricSubnets configuration.
+     *
+     * @return all the fabricSubnets
+     */
+    Set<FabricSubnet> defaultFabricSubnets();
+
+    /**
+     * Retrieves the entire set of static routes to outer networks.
+     *
+     * @return the set of static routes to outer networks.
+     */
+    Set<FabricRoute> fabricRoutes();
+
+    /**
+     * Evaluates whether a MAC is of virtual gateway MAC addresses.
+     *
+     * @param mac the MAC address to evaluate
+     * @return true if the mac is of any virtual gateway MAC address of fabricSubnets
+     */
+    boolean isVirtualGatewayMac(MacAddress mac);
+
+    /**
+     * Evaluates whether an interface belongs to fabric network or not.
+     *
+     * @param intf the interface to evaluate
+     * @return true if the interface belongs to fabric network, otherwise false
+     */
+    boolean isFabricNetworkInterface(Interface intf);
+
+    /**
+     * Finds virtual gateway MAC address for local subnet virtual gateway IP.
+     *
+     * @param ip the IP to check for virtual gateway IP
+     * @return MAC address of virtual gateway
+     */
+    MacAddress vMacForIp(IpAddress ip);
+
+    /**
+     * Finds the L2 fabric network with given port and vlanId.
+     *
+     * @param port the port to be matched
+     * @param vlanId the vlanId to be matched
+     * @return the L2 Network for specific port and vlanId or null
+     */
+    FabricNetwork fabricNetwork(ConnectPoint port, VlanId vlanId);
+
+    /**
+     * Finds the fabric network by its name.
+     *
+     * @param name the name to be matched
+     * @return the fabric network
+     */
+    FabricNetwork fabricNetwork(String name);
+
+    /**
+     * Finds the FabricSubnet which contains the given IP address.
+     *
+     * @param ipAddress the IP address to be matched
+     * @return the FabricSubnet
+     */
+    FabricSubnet fabricSubnet(IpAddress ipAddress);
+
+    /**
+     * Finds the FabricRoute which contains the given IP address.
+     *
+     * @param ipAddress the IP address to be matched
+     * @return the FabricRoute
+     */
+    FabricRoute fabricRoute(IpAddress ipAddress);
+
+    /**
+     * Finds the network interface which associated with the host.
+     *
+     * @param host the host
+     * @return the interface associated with the host
+     */
+    Interface hostInterface(Host host);
+
+    /**
+     * Sends neighbour query (ARP or NDP) to find host location.
+     *
+     * @param ip the IP address to resolve
+     * @return true if request MAC packets are emitted, false otherwise
+     */
+    boolean requestMac(IpAddress ip);
+
+    /**
+     * Sends dump event to all SimpleFabricListeners to dump info on the subject.
+     *
+     * @param subject the subject to dump
+     * @param out the output stream to dump
+     */
+    void dumpToStream(String subject, OutputStream out);
+
+    /**
+     * Triggers to send refresh notification to all sub modules.
+     */
+    void triggerRefresh();
+
+    /**
+     * Triggers to send flush notification to all sub modules.
+     */
+    void triggerFlush();
+}
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/package-info.java
similarity index 67%
copy from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
copy to apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/package-info.java
index 726d578..a11519f 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
+++ b/apps/simplefabric/api/src/main/java/org/onosproject/simplefabric/api/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,13 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.simplefabric;
-
-import org.onosproject.event.EventListener;
 
 /**
- * Entity capable of receiving alarm related events.
+ * Simple fabric API package.
  */
-public interface SimpleFabricListener extends EventListener<SimpleFabricEvent> {
-}
-
+package org.onosproject.simplefabric.api;
\ No newline at end of file
diff --git a/apps/simplefabric/app/BUCK b/apps/simplefabric/app/BUCK
new file mode 100644
index 0000000..6aefd2c
--- /dev/null
+++ b/apps/simplefabric/app/BUCK
@@ -0,0 +1,24 @@
+COMPILE_DEPS = [
+    '//lib:CORE_DEPS',
+    '//lib:JACKSON',
+    '//lib:concurrent-trees',
+    '//lib:javax.ws.rs-api',
+    '//lib:org.apache.karaf.shell.console',
+    '//cli:onos-cli',
+    '//utils/rest:onlab-rest',
+    '//apps/simplefabric/api:onos-apps-simplefabric-api',
+]
+
+TEST_DEPS = [
+    '//lib:TEST_ADAPTERS',
+]
+
+osgi_jar_with_tests (
+    api_description = 'REST API for Simple Fabric',
+    api_package = 'org.onosproject.simplefabric.web',
+    api_title = 'Simple Fabric API',
+    api_version = '1.0',
+    deps = COMPILE_DEPS,
+    test_deps = TEST_DEPS,
+    web_context = '/onos/v1/simplefabric',
+)
\ No newline at end of file
diff --git a/apps/simplefabric/app/BUILD b/apps/simplefabric/app/BUILD
new file mode 100644
index 0000000..69d12f7
--- /dev/null
+++ b/apps/simplefabric/app/BUILD
@@ -0,0 +1,21 @@
+COMPILE_DEPS = CORE_DEPS + JACKSON + CLI + REST + [
+    "//apps/simplefabric/api:onos-apps-simplefabric-api",
+    "@concurrent_trees//jar",
+]
+
+TEST_DEPS = TEST_ADAPTERS + TEST_REST + [
+    "//core/api:onos-api-tests",
+    "//core/common:onos-core-common-tests",
+    "//web/api:onos-rest-tests",
+]
+
+osgi_jar_with_tests(
+    api_description = "REST API for Simple Fabric",
+    api_package = "org.onosproject.simplefabric.web",
+    api_title = "Simple Fabric API",
+    api_version = "1.0",
+    karaf_command_packages = ["org.onosproject.simplefabric.cli"],
+    test_deps = TEST_DEPS,
+    web_context = "/onos/v1/simplefabric",
+    deps = COMPILE_DEPS,
+)
diff --git a/apps/simplefabric/app.xml b/apps/simplefabric/app/app.xml
similarity index 100%
rename from apps/simplefabric/app.xml
rename to apps/simplefabric/app/app.xml
diff --git a/apps/simplefabric/features.xml b/apps/simplefabric/app/features.xml
similarity index 100%
rename from apps/simplefabric/features.xml
rename to apps/simplefabric/app/features.xml
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricCommand.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/cli/SimpleFabricCommand.java
similarity index 93%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricCommand.java
rename to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/cli/SimpleFabricCommand.java
index 8d88f08..3271e8d 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricCommand.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/cli/SimpleFabricCommand.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,13 +13,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.simplefabric;
+package org.onosproject.simplefabric.cli;
 
 import org.apache.karaf.shell.api.action.Argument;
 import org.apache.karaf.shell.api.action.Command;
 import org.apache.karaf.shell.api.action.Completion;
 import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.simplefabric.api.SimpleFabricService;
 
 /**
  * CLI to interact with the SIMPLE_FABRIC application.
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricCommandCompleter.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/cli/SimpleFabricCommandCompleter.java
similarity index 93%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricCommandCompleter.java
rename to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/cli/SimpleFabricCommandCompleter.java
index 43d79d8..a643539 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricCommandCompleter.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/cli/SimpleFabricCommandCompleter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.simplefabric;
+package org.onosproject.simplefabric.cli;
 
 import com.google.common.collect.Lists;
 import org.apache.karaf.shell.api.action.lifecycle.Service;
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/cli/package-info.java
similarity index 67%
copy from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
copy to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/cli/package-info.java
index 726d578..1a92219 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/cli/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,13 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.simplefabric;
-
-import org.onosproject.event.EventListener;
 
 /**
- * Entity capable of receiving alarm related events.
+ * Simple fabric CLI package.
  */
-public interface SimpleFabricListener extends EventListener<SimpleFabricEvent> {
-}
-
+package org.onosproject.simplefabric.cli;
\ No newline at end of file
diff --git a/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/DefaultFabricNetwork.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/DefaultFabricNetwork.java
new file mode 100644
index 0000000..386a345
--- /dev/null
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/DefaultFabricNetwork.java
@@ -0,0 +1,316 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.simplefabric.impl;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+import org.onlab.packet.VlanId;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.EncapsulationType;
+import org.onosproject.net.Host;
+import org.onosproject.net.HostId;
+import org.onosproject.net.intf.Interface;
+import org.onosproject.simplefabric.api.FabricNetwork;
+
+import java.util.Collection;
+import java.util.Objects;
+import java.util.Set;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static org.onosproject.simplefabric.api.Constants.ALLOW_ETH_ADDRESS_SELECTOR;
+
+
+/**
+ * Class stores a DefaultFabricNetwork information.
+ */
+public final class DefaultFabricNetwork implements FabricNetwork {
+
+    private static final String NOT_NULL_MSG = "FabricNetwork % cannot be null";
+
+    private final String name;
+    private final Set<String> interfaceNames;
+    private final EncapsulationType encapsulation;
+    private boolean forward;
+    private boolean broadcast;
+
+    /* status variables */
+    private final Set<Interface> interfaces;
+    private final Set<HostId> hostIds;
+    private boolean dirty;
+
+    /**
+     * Constructs a DefaultFabricNetwork instance.
+     *
+     * @param name              fabric name name
+     * @param interfaceNames    a collection of  interface names
+     * @param encapsulation     encapsulation type
+     * @param forward           flag for forward intents to be installed or not
+     * @param broadcast         flag for broadcast intents to be installed or not
+     */
+    private DefaultFabricNetwork(String name, Collection<String> interfaceNames,
+                                 EncapsulationType encapsulation,
+                                 boolean forward, boolean broadcast) {
+        this.name = name;
+        this.interfaceNames = Sets.newHashSet();
+
+        if (interfaceNames != null) {
+            this.interfaceNames.addAll(interfaceNames);
+        }
+
+        this.encapsulation = encapsulation;
+        this.forward = (ALLOW_ETH_ADDRESS_SELECTOR) && forward;
+        this.broadcast = (ALLOW_ETH_ADDRESS_SELECTOR) && broadcast;
+        this.interfaces = Sets.newHashSet();
+        this.hostIds = Sets.newHashSet();
+        this.dirty = false;
+    }
+
+    /**
+     * Constructs a DefaultFabricNetwork instance.
+     *
+     * @param name              fabric network name
+     * @param encapsulation     encapsulation type
+     */
+    private DefaultFabricNetwork(String name, EncapsulationType encapsulation) {
+        this.name = name;
+        this.interfaceNames = Sets.newHashSet();
+        this.encapsulation = encapsulation;
+        this.forward = ALLOW_ETH_ADDRESS_SELECTOR;
+        this.broadcast = ALLOW_ETH_ADDRESS_SELECTOR;
+        this.interfaces = Sets.newHashSet();
+        this.hostIds = Sets.newHashSet();
+        this.dirty = false;
+    }
+
+    /**
+     * Creates a DefaultFabricNetwork data by given name.
+     * The encapsulation type of the DefaultFabricNetwork will be NONE.
+     *
+     * @param name              fabric network name
+     * @return DefaultFabricNetwork instance
+     */
+    public static FabricNetwork of(String name) {
+        Objects.requireNonNull(name);
+        return new DefaultFabricNetwork(name, EncapsulationType.NONE);
+    }
+
+    /**
+     * Creates a copy of DefaultFabricNetwork instance.
+     *
+     * @param fabricNetwork DefaultFabricNetwork instance
+     * @return the copy of the DefaultFabricNetwork instance
+     */
+    public static FabricNetwork of(FabricNetwork fabricNetwork) {
+        Objects.requireNonNull(fabricNetwork);
+        DefaultFabricNetwork fabricNetworkCopy =
+                new DefaultFabricNetwork(fabricNetwork.name(), fabricNetwork.encapsulation());
+        fabricNetworkCopy.interfaceNames.addAll(fabricNetwork.interfaceNames());
+        fabricNetworkCopy.forward = (ALLOW_ETH_ADDRESS_SELECTOR) && fabricNetwork.isForward();
+        fabricNetworkCopy.broadcast = (ALLOW_ETH_ADDRESS_SELECTOR) && fabricNetwork.isBroadcast();
+        fabricNetworkCopy.interfaces.addAll(fabricNetwork.interfaces());
+        fabricNetworkCopy.hostIds.addAll(fabricNetwork.hostIds());
+        fabricNetworkCopy.setDirty(fabricNetwork.isDirty());
+        return fabricNetworkCopy;
+    }
+
+    // field queries
+
+    @Override
+    public String name() {
+        return name;
+    }
+
+    @Override
+    public Set<String> interfaceNames() {
+        return ImmutableSet.copyOf(interfaceNames);
+    }
+
+    @Override
+    public EncapsulationType encapsulation() {
+        return encapsulation;
+    }
+
+    @Override
+    public boolean isForward() {
+        return forward;
+    }
+
+    @Override
+    public boolean isBroadcast() {
+        return broadcast;
+    }
+
+    @Override
+    public Set<Interface> interfaces() {
+        return ImmutableSet.copyOf(interfaces);
+    }
+
+    @Override
+    public Set<HostId> hostIds() {
+        return ImmutableSet.copyOf(hostIds);
+    }
+
+    @Override
+    public boolean isDirty() {
+        return dirty;
+    }
+
+    @Override
+    public boolean contains(Interface iface) {
+        return interfaces.contains(iface);
+    }
+
+    @Override
+    public boolean contains(ConnectPoint port, VlanId vlanId) {
+        for (Interface iface : interfaces) {
+            if (iface.connectPoint().equals(port) && iface.vlan().equals(vlanId)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean contains(DeviceId deviceId) {
+        for (Interface iface : interfaces) {
+            if (iface.connectPoint().deviceId().equals(deviceId)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public void addInterface(Interface iface) {
+        Objects.requireNonNull(iface);
+        if (interfaces.add(iface)) {
+            setDirty(true);
+        }
+    }
+
+    @Override
+    public void addHost(Host host) {
+        Objects.requireNonNull(host);
+        if (hostIds.add(host.id())) {
+            setDirty(true);
+        }
+    }
+
+    @Override
+    public void setDirty(boolean newDirty) {
+        dirty = newDirty;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+                .add("name", name)
+                .add("interfaceNames", interfaceNames)
+                .add("encapsulation", encapsulation)
+                .add("forward", forward)
+                .add("broadcast", broadcast)
+                .add("interfaces", interfaces)
+                .add("hostIds", hostIds)
+                .add("isDirty", dirty)
+                .toString();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        }
+        if (!(obj instanceof DefaultFabricNetwork)) {
+            return false;
+        }
+        DefaultFabricNetwork other = (DefaultFabricNetwork) obj;
+        return Objects.equals(other.name, this.name)
+                && Objects.equals(other.interfaceNames, this.interfaceNames)
+                && Objects.equals(other.encapsulation, this.encapsulation)
+                && Objects.equals(other.forward, this.forward)
+                && Objects.equals(other.broadcast, this.broadcast)
+                && Objects.equals(other.interfaces, this.interfaces)
+                && Objects.equals(other.hostIds, this.hostIds);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(name, interfaces, encapsulation, forward, broadcast);
+    }
+
+    /**
+     * Returns new builder instance.
+     *
+     * @return fabric network builder
+     */
+    public static DefaultFabricNetworkBuilder builder() {
+        return new DefaultFabricNetworkBuilder();
+    }
+
+    /**
+     * A builder class for fabric network.
+     */
+    public static final class DefaultFabricNetworkBuilder implements Builder {
+        private String name;
+        private Set<String> interfaceNames;
+        private EncapsulationType encapsulation;
+        private boolean forward;
+        private boolean broadcast;
+
+        private DefaultFabricNetworkBuilder() {
+        }
+
+        @Override
+        public Builder name(String name) {
+            this.name = name;
+            return this;
+        }
+
+        @Override
+        public Builder interfaceNames(Set<String> interfaceNames) {
+            this.interfaceNames = interfaceNames;
+            return this;
+        }
+
+        @Override
+        public Builder encapsulation(EncapsulationType encapsulation) {
+            this.encapsulation = encapsulation;
+            return this;
+        }
+
+        @Override
+        public Builder forward(boolean forward) {
+            this.forward = forward;
+            return this;
+        }
+
+        @Override
+        public Builder broadcast(boolean broadcast) {
+            this.broadcast = broadcast;
+            return this;
+        }
+
+        @Override
+        public FabricNetwork build() {
+            checkArgument(name != null, NOT_NULL_MSG, "name");
+            return new DefaultFabricNetwork(name, interfaceNames,
+                    encapsulation, forward, broadcast);
+        }
+    }
+}
\ No newline at end of file
diff --git a/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/DefaultFabricRoute.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/DefaultFabricRoute.java
new file mode 100644
index 0000000..6b9a132
--- /dev/null
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/DefaultFabricRoute.java
@@ -0,0 +1,180 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.simplefabric.impl;
+
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.IpPrefix;
+import org.onosproject.cluster.NodeId;
+import org.onosproject.simplefabric.api.FabricRoute;
+
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Represents a route.
+ */
+public final class DefaultFabricRoute implements FabricRoute {
+
+    private static final String VERSION_MISMATCH =
+            "Prefix and next hop must be in the same address family";
+
+    private static final NodeId UNDEFINED = new NodeId("-");
+
+    private final Source source;
+    private final IpPrefix prefix;
+    private final IpAddress nextHop;
+    private final NodeId sourceNode;
+
+    /**
+     * Creates a route.
+     *
+     * @param source route source
+     * @param prefix IP prefix
+     * @param nextHop next hop IP address
+     */
+    private DefaultFabricRoute(Source source, IpPrefix prefix, IpAddress nextHop) {
+        this(source, prefix, nextHop, UNDEFINED);
+    }
+
+    /**
+     * Creates a route.
+     *
+     * @param source route source
+     * @param prefix IP prefix
+     * @param nextHop next hop IP address
+     * @param sourceNode ONOS node the route was sourced from
+     */
+    private DefaultFabricRoute(Source source, IpPrefix prefix,
+                              IpAddress nextHop, NodeId sourceNode) {
+        this.source = checkNotNull(source);
+        this.prefix = prefix;
+        this.nextHop = nextHop;
+        this.sourceNode = checkNotNull(sourceNode);
+    }
+
+    @Override
+    public Source source() {
+        return source;
+    }
+
+    @Override
+    public IpPrefix prefix() {
+        return prefix;
+    }
+
+    @Override
+    public IpAddress nextHop() {
+        return nextHop;
+    }
+
+    @Override
+    public NodeId sourceNode() {
+        return sourceNode;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(prefix, nextHop);
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        if (this == other) {
+            return true;
+        }
+
+        if (!(other instanceof DefaultFabricRoute)) {
+            return false;
+        }
+
+        DefaultFabricRoute that = (DefaultFabricRoute) other;
+
+        return Objects.equals(this.prefix, that.prefix) &&
+                Objects.equals(this.nextHop, that.nextHop);
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(this)
+                .add("prefix", prefix)
+                .add("nextHop", nextHop)
+                .toString();
+    }
+
+    /**
+     * Returns new builder instance.
+     *
+     * @return fabric route builder
+     */
+    public static DefaultFabricRouteBuilder builder() {
+        return new DefaultFabricRouteBuilder();
+    }
+
+    /**
+     * A builder class for fabric route.
+     */
+    public static final class DefaultFabricRouteBuilder implements Builder {
+        private Source source;
+        private IpPrefix prefix;
+        private IpAddress nextHop;
+        private NodeId sourceNode;
+
+        private DefaultFabricRouteBuilder() {
+        }
+
+        @Override
+        public Builder source(Source source) {
+            this.source = source;
+            return this;
+        }
+
+        @Override
+        public Builder prefix(IpPrefix prefix) {
+            this.prefix = prefix;
+            return this;
+        }
+
+        @Override
+        public Builder nextHop(IpAddress nextHop) {
+            this.nextHop = nextHop;
+            return this;
+        }
+
+        @Override
+        public Builder sourceNode(NodeId sourceNode) {
+            this.sourceNode = sourceNode;
+            return this;
+        }
+
+        @Override
+        public FabricRoute build() {
+
+            checkNotNull(prefix);
+            checkNotNull(nextHop);
+            checkArgument(prefix.version().equals(nextHop.version()), VERSION_MISMATCH);
+
+            if (sourceNode != null) {
+                return new DefaultFabricRoute(source, prefix, nextHop, sourceNode);
+            } else {
+                return new DefaultFabricRoute(source, prefix, nextHop);
+            }
+        }
+    }
+}
diff --git a/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/DefaultFabricSubnet.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/DefaultFabricSubnet.java
new file mode 100644
index 0000000..b7fec47
--- /dev/null
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/DefaultFabricSubnet.java
@@ -0,0 +1,195 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.simplefabric.impl;
+
+import com.google.common.base.MoreObjects;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.IpPrefix;
+import org.onlab.packet.MacAddress;
+import org.onosproject.net.EncapsulationType;
+import org.onosproject.simplefabric.api.FabricSubnet;
+
+import java.util.Objects;
+
+import static com.google.common.base.Preconditions.checkArgument;
+
+/**
+ * Configuration details for an ip subnet entry.
+ */
+public final class DefaultFabricSubnet implements FabricSubnet {
+
+    private static final String NOT_NULL_MSG = "FabricSubnet % cannot be null";
+
+    private final IpPrefix prefix;
+    private final IpAddress gatewayIp;
+    private final MacAddress gatewayMac;
+    private EncapsulationType encapsulation;
+    private final String networkName;
+
+    /**
+     * Creates a new subnet entry.
+     *
+     * @param prefix  an ip subnet
+     * @param gatewayIp IP of the virtual gateway
+     * @param gatewayMac MacAddress of the virtual gateway
+     * @param encapsulation encapsulation type
+     * @param networkName network name
+     */
+    private DefaultFabricSubnet(IpPrefix prefix, IpAddress gatewayIp,
+                                MacAddress gatewayMac, EncapsulationType encapsulation,
+                                String networkName) {
+        this.prefix = prefix;
+        this.gatewayIp = gatewayIp;
+        this.gatewayMac = gatewayMac;
+        this.encapsulation = encapsulation;
+        this.networkName = networkName;
+    }
+
+    @Override
+    public IpPrefix prefix() {
+        return prefix;
+    }
+
+    @Override
+    public IpAddress gatewayIp() {
+        return gatewayIp;
+    }
+
+    @Override
+    public MacAddress gatewayMac() {
+        return gatewayMac;
+    }
+
+    @Override
+    public EncapsulationType encapsulation() {
+        return encapsulation;
+    }
+
+    @Override
+    public String networkName() {
+        return networkName;
+    }
+
+    @Override
+    public boolean isIp4() {
+        return prefix.isIp4();
+    }
+
+    @Override
+    public boolean isIp6() {
+        return prefix.isIp6();
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(prefix, gatewayIp, gatewayMac, encapsulation, networkName);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        }
+        if (!(obj instanceof DefaultFabricSubnet)) {
+            return false;
+        }
+        DefaultFabricSubnet that = (DefaultFabricSubnet) obj;
+        return Objects.equals(this.prefix, that.prefix)
+                && Objects.equals(this.gatewayIp, that.gatewayIp)
+                && Objects.equals(this.gatewayMac, that.gatewayMac)
+                && Objects.equals(this.encapsulation, that.encapsulation)
+                && Objects.equals(this.networkName, that.networkName);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+                .add("prefix", prefix)
+                .add("gatewayIp", gatewayIp)
+                .add("gatewayMac", gatewayMac)
+                .add("encapsulation", encapsulation)
+                .add("networkName", networkName)
+                .toString();
+    }
+
+    /**
+     * Returns new builder instance.
+     *
+     * @return fabric IP subnet builder
+     */
+    public static DefaultSubnetBuilder builder() {
+        return new DefaultSubnetBuilder();
+    }
+
+    /**
+     * A builder class for Ip Subnet.
+     */
+    public static final class DefaultSubnetBuilder implements Builder {
+        private IpPrefix prefix;
+        private IpAddress gatewayIp;
+        private MacAddress gatewayMac;
+        private EncapsulationType encapsulation;
+        private String networkName;
+
+        private DefaultSubnetBuilder() {
+        }
+
+        @Override
+        public Builder prefix(IpPrefix prefix) {
+            this.prefix = prefix;
+            return this;
+        }
+
+        @Override
+        public Builder gatewayIp(IpAddress gatewayIp) {
+            this.gatewayIp = gatewayIp;
+            return this;
+        }
+
+        @Override
+        public Builder gatewayMac(MacAddress gatewayMac) {
+            this.gatewayMac = gatewayMac;
+            return this;
+        }
+
+        @Override
+        public Builder encapsulation(EncapsulationType encapsulation) {
+            this.encapsulation = encapsulation;
+            return this;
+        }
+
+        @Override
+        public Builder networkName(String networkName) {
+            this.networkName = networkName;
+            return this;
+        }
+
+        @Override
+        public FabricSubnet build() {
+            checkArgument(prefix != null, NOT_NULL_MSG, "prefix");
+            checkArgument(gatewayIp != null, NOT_NULL_MSG, "gatewayIp");
+            checkArgument(gatewayMac != null, NOT_NULL_MSG, "gatewayMac");
+            checkArgument(networkName != null, NOT_NULL_MSG, "name");
+
+            if (this.encapsulation == null) {
+                encapsulation = EncapsulationType.NONE;
+            }
+
+            return new DefaultFabricSubnet(prefix, gatewayIp, gatewayMac,
+                    encapsulation, networkName);
+        }
+    }
+}
\ No newline at end of file
diff --git a/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricConfig.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricConfig.java
new file mode 100644
index 0000000..1d4b97c
--- /dev/null
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricConfig.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.simplefabric.impl;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.collect.Sets;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.IpPrefix;
+import org.onlab.packet.MacAddress;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.net.EncapsulationType;
+import org.onosproject.net.config.Config;
+import org.onosproject.simplefabric.api.FabricNetwork;
+import org.onosproject.simplefabric.api.FabricRoute;
+import org.onosproject.simplefabric.api.FabricSubnet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Set;
+
+/**
+ * Configuration object for prefix config.
+ */
+public class SimpleFabricConfig extends Config<ApplicationId> {
+    public static final String KEY = "simpleFabric";
+
+    private static final String FABRIC_NETWORKS = "fabricNetworks";
+    private static final String NAME = "name";
+    private static final String INTERFACES = "interfaces";
+    private static final String ENCAPSULATION = "encapsulation";
+    private static final String IS_FORWARD = "isForward";
+    private static final String IS_BROADCAST = "isBroadcast";
+
+    private static final String FABRIC_SUBNETS = "fabricSubnets";
+    private static final String PREFIX = "prefix";
+    private static final String GATEWAY_IP = "gatewayIp";
+    private static final String GATEWAY_MAC = "gatewayMac";
+    private static final String NETWORK_NAME = "networkName";
+
+    private static final String FABRIC_ROUTES = "fabricRoutes";
+    private static final String NEXT_HOP = "nextHop";
+
+    private static final String NONE_ENCAPSULATION = "NONE";
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    /**
+     * Returns all fabric networks in this configuration.
+     *
+     * @return a set of fabric networks
+     */
+    public Set<FabricNetwork> fabricNetworks() {
+        Set<FabricNetwork> fabricNetworks = Sets.newHashSet();
+        JsonNode fabricNetworkNodes = object.get(FABRIC_NETWORKS);
+        if (fabricNetworkNodes == null) {
+            return fabricNetworks;
+        }
+
+        fabricNetworkNodes.forEach(jsonNode -> {
+            Set<String> ifaces = Sets.newHashSet();
+            JsonNode fabricNetworkIfaces = jsonNode.path(INTERFACES);
+            if (fabricNetworkIfaces == null) {
+                log.warn("Fabric network interfaces cannot find {}; skip: jsonNode={}", INTERFACES, jsonNode);
+            } else if (!fabricNetworkIfaces.toString().isEmpty()) {
+                fabricNetworkIfaces.forEach(ifacesNode -> ifaces.add(ifacesNode.asText()));
+            }
+            String encapsulation = NONE_ENCAPSULATION;   // NONE or VLAN
+            if (jsonNode.hasNonNull(ENCAPSULATION)) {
+                encapsulation = jsonNode.get(ENCAPSULATION).asText();
+            }
+            boolean isForward = true;
+            if (jsonNode.hasNonNull(IS_FORWARD)) {
+                isForward = jsonNode.get(IS_FORWARD).asBoolean();
+            }
+            boolean isBroadcast = true;
+            if (jsonNode.hasNonNull(IS_BROADCAST)) {
+                isBroadcast = jsonNode.get(IS_BROADCAST).asBoolean();
+            }
+            try {
+                fabricNetworks.add(DefaultFabricNetwork.builder()
+                                    .name(jsonNode.get(NAME).asText())
+                                    .interfaceNames(ifaces)
+                                    .encapsulation(EncapsulationType.enumFromString(encapsulation))
+                                    .forward(isForward)
+                                    .broadcast(isBroadcast)
+                                    .build());
+            } catch (Exception e) {
+                log.warn("Fabric network parse failed; skip: jsonNode={}", jsonNode);
+            }
+        });
+        return fabricNetworks;
+    }
+
+    /**
+     * Gets the set of configured local subnets.
+     *
+     * @return a set of subnets
+     */
+    public Set<FabricSubnet> fabricSubnets() {
+        Set<FabricSubnet> subnets = Sets.newHashSet();
+        JsonNode subnetsNode = object.get(FABRIC_SUBNETS);
+        if (subnetsNode == null) {
+            log.warn("FabricSubnets is null!");
+            return subnets;
+        }
+
+        subnetsNode.forEach(jsonNode -> {
+            String encapsulation = NONE_ENCAPSULATION;   // NONE or VLAN
+            if (jsonNode.hasNonNull(ENCAPSULATION)) {
+                encapsulation = jsonNode.get(ENCAPSULATION).asText();
+            }
+            try {
+                subnets.add(DefaultFabricSubnet.builder()
+                            .prefix(IpPrefix.valueOf(jsonNode.get(PREFIX).asText()))
+                            .gatewayIp(IpAddress.valueOf(jsonNode.get(GATEWAY_IP).asText()))
+                            .gatewayMac(MacAddress.valueOf(jsonNode.get(GATEWAY_MAC).asText()))
+                            .encapsulation(EncapsulationType.enumFromString(encapsulation))
+                            .networkName(jsonNode.get(NETWORK_NAME).asText())
+                            .build());
+            } catch (Exception e) {
+                log.warn("Fabric subnet parse failed; skip: jsonNode={}", jsonNode);
+            }
+        });
+
+        return subnets;
+    }
+
+    /**
+     * Returns all routes in this configuration.
+     *
+     * @return a set of routes.
+     */
+    public Set<FabricRoute> fabricRoutes() {
+        Set<FabricRoute> routes = Sets.newHashSet();
+
+        JsonNode routesNode = object.get(FABRIC_ROUTES);
+        if (routesNode == null) {
+            return routes;
+        }
+
+        routesNode.forEach(jsonNode -> {
+            try {
+                routes.add(DefaultFabricRoute.builder()
+                        .source(FabricRoute.Source.STATIC)
+                        .prefix(IpPrefix.valueOf(jsonNode.path(PREFIX).asText()))
+                        .nextHop(IpAddress.valueOf(jsonNode.path(NEXT_HOP).asText()))
+                        .build());
+            } catch (IllegalArgumentException e) {
+                log.warn("Fabric router parse error; skip: jsonNode={}", jsonNode);
+            }
+        });
+
+        return routes;
+    }
+}
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricL2Forward.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricForwarding.java
similarity index 74%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricL2Forward.java
rename to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricForwarding.java
index c8ecdd7..48fdf34 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricL2Forward.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricForwarding.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * 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.simplefabric;
+package org.onosproject.simplefabric.impl;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
@@ -29,7 +29,6 @@
 import org.onlab.packet.VlanId;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
-import org.onosproject.net.intf.Interface;
 import org.onosproject.net.ConnectPoint;
 import org.onosproject.net.EncapsulationType;
 import org.onosproject.net.FilteredConnectPoint;
@@ -46,19 +45,28 @@
 import org.onosproject.net.intent.SinglePointToMultiPointIntent;
 import org.onosproject.net.intent.constraint.EncapsulationConstraint;
 import org.onosproject.net.intent.constraint.PartialFailureConstraint;
+import org.onosproject.net.intf.Interface;
+import org.onosproject.simplefabric.api.FabricNetwork;
+import org.onosproject.simplefabric.api.SimpleFabricEvent;
+import org.onosproject.simplefabric.api.SimpleFabricListener;
+import org.onosproject.simplefabric.api.SimpleFabricService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.PrintStream;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Set;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Objects;
 import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
 import java.util.stream.Collectors;
 
+import static org.onosproject.simplefabric.api.Constants.FORWARDING_APP_ID;
+import static org.onosproject.simplefabric.api.Constants.PRI_L2NETWORK_BROADCAST;
+import static org.onosproject.simplefabric.api.Constants.PRI_L2NETWORK_UNICAST;
+
 
 /**
  * An implementation of L2NetworkOperationService.
@@ -66,13 +74,13 @@
  * application.
  */
 @Component(immediate = true, enabled = false)
-public class SimpleFabricL2Forward {
+public class SimpleFabricForwarding {
 
     public static final String BROADCAST = "BCAST";
     public static final String UNICAST = "UNI";
 
     private final Logger log = LoggerFactory.getLogger(getClass());
-    protected ApplicationId l2ForwardAppId;
+    protected ApplicationId appId;
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected CoreService coreService;
@@ -97,20 +105,20 @@
 
     @Activate
     public void activate() {
-        l2ForwardAppId = coreService.registerApplication(simpleFabric.L2FORWARD_APP_ID);
-        log.info("simple fabric l2 forwaring starting with l2net app id {}", l2ForwardAppId.toString());
+        appId = coreService.registerApplication(FORWARDING_APP_ID);
+        log.info("simple fabric forwarding starting with l2net app id {}", appId.toString());
 
         simpleFabric.addListener(simpleFabricListener);
 
         refresh();
         checkIntentsPurge();
 
-        log.info("simple fabric l2forward started");
+        log.info("simple fabric forwarding started");
     }
 
     @Deactivate
     public void deactivate() {
-        log.info("simple fabric l2forward stopping");
+        log.info("simple fabric forwarding stopping");
 
         simpleFabric.removeListener(simpleFabricListener);
 
@@ -133,26 +141,27 @@
         //bctIntentsMap.clear();
         //uniIntentsMap.clear();
 
-        log.info("simple fabric l2forward stopped");
+        log.info("simple fabric forwarding stopped");
     }
 
     private void refresh() {
-        log.debug("simple fabric l2forward refresh");
+        log.debug("simple fabric forwarding refresh");
 
         Map<Key, SinglePointToMultiPointIntent> newBctIntentsMap = Maps.newConcurrentMap();
         Map<Key, MultiPointToSinglePointIntent> newUniIntentsMap = Maps.newConcurrentMap();
 
-        for (L2Network l2Network : simpleFabric.getL2Networks()) {
-            // scans all l2network regardless of dirty flag
-            // if l2Network.l2Forward == false or number of interfaces() < 2, no Intents generated
-            for (SinglePointToMultiPointIntent intent : buildBrcIntents(l2Network)) {
+        for (FabricNetwork fabricNetwork : simpleFabric.fabricNetworks()) {
+            // scans all l2network regardless of isDirty flag
+            // if fabricNetwork.isForward == false or number of interfaces() < 2, no Intents generated
+            for (SinglePointToMultiPointIntent intent : buildBrcIntents(fabricNetwork)) {
                 newBctIntentsMap.put(intent.key(), intent);
             }
-            for (MultiPointToSinglePointIntent intent : buildUniIntents(l2Network, hostsFromL2Network(l2Network))) {
+            for (MultiPointToSinglePointIntent intent :
+                    buildUniIntents(fabricNetwork, hostsFromL2Network(fabricNetwork))) {
                 newUniIntentsMap.put(intent.key(), intent);
             }
-            if (l2Network.dirty()) {
-                l2Network.setDirty(false);
+            if (fabricNetwork.isDirty()) {
+                fabricNetwork.setDirty(false);
             }
         }
 
@@ -160,7 +169,8 @@
         for (SinglePointToMultiPointIntent intent : bctIntentsMap.values()) {
             SinglePointToMultiPointIntent newIntent = newBctIntentsMap.get(intent.key());
             if (newIntent == null) {
-                log.info("simple fabric l2forward withdraw broadcast intent: {}", intent.key().toString());
+                log.info("simple fabric forwarding withdraw broadcast intent: {}",
+                        intent.key().toString());
                 toBePurgedIntentKeys.add(intent.key());
                 intentService.withdraw(intent);
                 bctUpdated = true;
@@ -174,7 +184,8 @@
                     !oldIntent.selector().equals(intent.selector()) ||
                     !oldIntent.treatment().equals(intent.treatment()) ||
                     !oldIntent.constraints().equals(intent.constraints())) {
-                log.info("simple fabric l2forward submit broadcast intent: {}", intent.key().toString());
+                log.info("simple fabric forwarding submit broadcast intent: {}",
+                        intent.key().toString());
                 toBePurgedIntentKeys.remove(intent.key());
                 intentService.submit(intent);
                 bctUpdated = true;
@@ -185,7 +196,8 @@
         for (MultiPointToSinglePointIntent intent : uniIntentsMap.values()) {
             MultiPointToSinglePointIntent newIntent = newUniIntentsMap.get(intent.key());
             if (newIntent == null) {
-                log.info("simple fabric l2forward withdraw unicast intent: {}", intent.key().toString());
+                log.info("simple fabric forwarding withdraw unicast intent: {}",
+                        intent.key().toString());
                 toBePurgedIntentKeys.add(intent.key());
                 intentService.withdraw(intent);
                 uniUpdated = true;
@@ -199,7 +211,8 @@
                     !oldIntent.selector().equals(intent.selector()) ||
                     !oldIntent.treatment().equals(intent.treatment()) ||
                     !oldIntent.constraints().equals(intent.constraints())) {
-                log.info("simple fabric l2forward submit unicast intent: {}", intent.key().toString());
+                log.info("simple fabric forwarding submit unicast intent: {}",
+                        intent.key().toString());
                 toBePurgedIntentKeys.remove(intent.key());
                 intentService.submit(intent);
                 uniUpdated = true;
@@ -221,13 +234,14 @@
             for (Key key : toBePurgedIntentKeys) {
                 Intent intentToPurge = intentService.getIntent(key);
                 if (intentToPurge == null) {
-                    log.info("simple fabric l2forward purged intent: key={}", key.toString());
+                    log.info("simple fabric forwarding purged intent: key={}", key.toString());
                     purgedKeys.add(key);
                 } else {
                     switch (intentService.getIntentState(key)) {
                     case FAILED:
                     case WITHDRAWN:
-                        log.info("simple fabric l2forward try to purge intent: key={}", key.toString());
+                        log.info("simple fabric forwarding try to purge intent: key={}",
+                                key.toString());
                         intentService.purge(intentToPurge);
                         break;
                     case INSTALL_REQ:
@@ -235,7 +249,7 @@
                     case INSTALLING:
                     case RECOMPILING:
                     case COMPILING:
-                        log.warn("simple fabric l2forward withdraw intent to purge: key={}", key);
+                        log.warn("simple fabric forwarding withdraw intent to purge: key={}", key);
                         intentService.withdraw(intentToPurge);
                         break;
                     case WITHDRAW_REQ:
@@ -254,21 +268,21 @@
 
     // Generates Unicast Intents and broadcast Intents for the L2 Network.
 
-    private Set<Intent> generateL2NetworkIntents(L2Network l2Network) {
+    private Set<Intent> generateL2NetworkIntents(FabricNetwork fabricNetwork) {
         return new ImmutableSet.Builder<Intent>()
-                .addAll(buildBrcIntents(l2Network))
-                .addAll(buildUniIntents(l2Network, hostsFromL2Network(l2Network)))
+                .addAll(buildBrcIntents(fabricNetwork))
+                .addAll(buildUniIntents(fabricNetwork, hostsFromL2Network(fabricNetwork)))
                 .build();
     }
 
     // Build Boadcast Intents for a L2 Network.
-    private Set<SinglePointToMultiPointIntent> buildBrcIntents(L2Network l2Network) {
-        Set<Interface> interfaces = l2Network.interfaces();
-        if (interfaces.size() < 2 || !l2Network.l2Forward() || !l2Network.l2Broadcast()) {
+    private Set<SinglePointToMultiPointIntent> buildBrcIntents(FabricNetwork fabricNetwork) {
+        Set<Interface> interfaces = fabricNetwork.interfaces();
+        if (interfaces.size() < 2 || !fabricNetwork.isForward() || !fabricNetwork.isBroadcast()) {
             return ImmutableSet.of();
         }
         Set<SinglePointToMultiPointIntent> brcIntents = Sets.newHashSet();
-        ResourceGroup resourceGroup = ResourceGroup.of(l2Network.name());
+        ResourceGroup resourceGroup = ResourceGroup.of(fabricNetwork.name());
 
         // Generates broadcast Intents from any network interface to other
         // network interface from the L2 Network.
@@ -279,18 +293,21 @@
                     .filter(iface -> !iface.equals(src))
                     .map(this::buildFilteredConnectedPoint)
                     .collect(Collectors.toSet());
-            Key key = buildKey(l2Network.name(), "BCAST", srcFcp.connectPoint(), MacAddress.BROADCAST);
+            Key key = buildKey(fabricNetwork.name(), "BCAST",
+                    srcFcp.connectPoint(), MacAddress.BROADCAST);
             TrafficSelector selector = DefaultTrafficSelector.builder()
                     .matchEthDst(MacAddress.BROADCAST)
                     .build();
-            SinglePointToMultiPointIntent.Builder intentBuilder = SinglePointToMultiPointIntent.builder()
-                    .appId(l2ForwardAppId)
+            SinglePointToMultiPointIntent.Builder
+                    intentBuilder = SinglePointToMultiPointIntent.builder()
+                    .appId(appId)
                     .key(key)
                     .selector(selector)
                     .filteredIngressPoint(srcFcp)
                     .filteredEgressPoints(dstFcps)
-                    .constraints(buildConstraints(L2NETWORK_CONSTRAINTS, l2Network.encapsulation()))
-                    .priority(SimpleFabricService.PRI_L2NETWORK_BROADCAST)
+                    .constraints(buildConstraints(L2NETWORK_CONSTRAINTS,
+                            fabricNetwork.encapsulation()))
+                    .priority(PRI_L2NETWORK_BROADCAST)
                     .resourceGroup(resourceGroup);
             brcIntents.add(intentBuilder.build());
         });
@@ -298,30 +315,33 @@
     }
 
     // Builds unicast Intents for a L2 Network.
-    private Set<MultiPointToSinglePointIntent> buildUniIntents(L2Network l2Network, Set<Host> hosts) {
-        Set<Interface> interfaces = l2Network.interfaces();
-        if (!l2Network.l2Forward() || interfaces.size() < 2) {
+    private Set<MultiPointToSinglePointIntent> buildUniIntents(FabricNetwork fabricNetwork,
+                                                               Set<Host> hosts) {
+        Set<Interface> interfaces = fabricNetwork.interfaces();
+        if (!fabricNetwork.isForward() || interfaces.size() < 2) {
             return ImmutableSet.of();
         }
         Set<MultiPointToSinglePointIntent> uniIntents = Sets.newHashSet();
-        ResourceGroup resourceGroup = ResourceGroup.of(l2Network.name());
+        ResourceGroup resourceGroup = ResourceGroup.of(fabricNetwork.name());
         hosts.forEach(host -> {
             FilteredConnectPoint hostFcp = buildFilteredConnectedPoint(host);
             Set<FilteredConnectPoint> srcFcps = interfaces.stream()
                     .map(this::buildFilteredConnectedPoint)
                     .filter(fcp -> !fcp.equals(hostFcp))
                     .collect(Collectors.toSet());
-            Key key = buildKey(l2Network.name(), "UNI", hostFcp.connectPoint(), host.mac());
+            Key key = buildKey(fabricNetwork.name(), "UNI", hostFcp.connectPoint(), host.mac());
             TrafficSelector selector = DefaultTrafficSelector.builder()
                     .matchEthDst(host.mac()).build();
-            MultiPointToSinglePointIntent.Builder intentBuilder = MultiPointToSinglePointIntent.builder()
-                    .appId(l2ForwardAppId)
+            MultiPointToSinglePointIntent.Builder
+                    intentBuilder = MultiPointToSinglePointIntent.builder()
+                    .appId(appId)
                     .key(key)
                     .selector(selector)
                     .filteredIngressPoints(srcFcps)
                     .filteredEgressPoint(hostFcp)
-                    .constraints(buildConstraints(L2NETWORK_CONSTRAINTS, l2Network.encapsulation()))
-                    .priority(SimpleFabricService.PRI_L2NETWORK_UNICAST)
+                    .constraints(buildConstraints(L2NETWORK_CONSTRAINTS,
+                            fabricNetwork.encapsulation()))
+                    .priority(PRI_L2NETWORK_UNICAST)
                     .resourceGroup(resourceGroup);
             uniIntents.add(intentBuilder.build());
         });
@@ -331,8 +351,8 @@
 
     // Intent generate utilities
 
-    private Set<Host> hostsFromL2Network(L2Network l2Network) {
-        Set<Interface> interfaces = l2Network.interfaces();
+    private Set<Host> hostsFromL2Network(FabricNetwork fabricNetwork) {
+        Set<Interface> interfaces = fabricNetwork.interfaces();
         return interfaces.stream()
                 .map(this::hostsFromInterface)
                 .flatMap(Collection::stream)
@@ -346,11 +366,14 @@
                 .collect(Collectors.toSet());
     }
 
-    private Key buildKey(String l2NetworkName, String type, ConnectPoint cPoint, MacAddress dstMac) {
-        return Key.of(l2NetworkName + "-" + type + "-" + cPoint.toString() + "-" + dstMac, l2ForwardAppId);
+    private Key buildKey(String l2NetworkName, String type,
+                         ConnectPoint cPoint, MacAddress dstMac) {
+        return Key.of(l2NetworkName + "-" + type + "-" +
+                cPoint.toString() + "-" + dstMac, appId);
     }
 
-    private List<Constraint> buildConstraints(List<Constraint> constraints, EncapsulationType encapsulation) {
+    private List<Constraint> buildConstraints(List<Constraint> constraints,
+                                              EncapsulationType encapsulation) {
         if (!encapsulation.equals(EncapsulationType.NONE)) {
             List<Constraint> newConstraints = new ArrayList<>(constraints);
             constraints.stream()
@@ -385,25 +408,27 @@
     // Dump command handler
     private void dump(String subject, PrintStream out) {
         if ("intents".equals(subject)) {
-            out.println("L2Forward Broadcast Intents:\n");
+            out.println("Forwarding Broadcast Intents:\n");
             for (SinglePointToMultiPointIntent intent: bctIntentsMap.values()) {
                 out.println("    " + intent.key().toString()
                           + ": " + intent.selector().criteria()
                           + ", [" + intent.filteredIngressPoint().connectPoint()
                           + "] -> " + intent.filteredEgressPoints().stream()
-                                      .map(FilteredConnectPoint::connectPoint).collect(Collectors.toSet()));
+                                      .map(FilteredConnectPoint::connectPoint)
+                                        .collect(Collectors.toSet()));
             }
             out.println("");
-            out.println("L2Forward Unicast Intents:\n");
+            out.println("Forwarding Unicast Intents:\n");
             for (MultiPointToSinglePointIntent intent: uniIntentsMap.values()) {
                 out.println("    " + intent.key().toString()
                           + ": " + intent.selector().criteria()
                           + ", [" + intent.filteredIngressPoints().stream()
-                                    .map(FilteredConnectPoint::connectPoint).collect(Collectors.toSet())
+                                    .map(FilteredConnectPoint::connectPoint)
+                                    .collect(Collectors.toSet())
                           + "] -> " + intent.filteredEgressPoint().connectPoint());
             }
             out.println("");
-            out.println("L2Forward Intents to Be Purged:\n");
+            out.println("Forwarding Intents to Be Purged:\n");
             for (Key key: toBePurgedIntentKeys) {
                 out.println("    " + key.toString());
             }
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricManager.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricManager.java
similarity index 72%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricManager.java
rename to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricManager.java
index d42f8e1..7a4e5d8 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricManager.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * 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.simplefabric;
+package org.onosproject.simplefabric.impl;
 
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Maps;
@@ -64,6 +64,12 @@
 import org.osgi.service.component.annotations.Deactivate;
 import org.osgi.service.component.annotations.Reference;
 import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.onosproject.simplefabric.api.FabricNetwork;
+import org.onosproject.simplefabric.api.FabricRoute;
+import org.onosproject.simplefabric.api.FabricSubnet;
+import org.onosproject.simplefabric.api.SimpleFabricEvent;
+import org.onosproject.simplefabric.api.SimpleFabricListener;
+import org.onosproject.simplefabric.api.SimpleFabricService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -75,7 +81,15 @@
 import java.util.Map;
 import java.util.Set;
 
-import static org.onosproject.simplefabric.RouteTools.createBinaryString;
+import static org.onosproject.simplefabric.api.Constants.ALLOW_ETH_ADDRESS_SELECTOR;
+import static org.onosproject.simplefabric.api.Constants.ALLOW_IPV6;
+import static org.onosproject.simplefabric.api.Constants.APP_ID;
+import static org.onosproject.simplefabric.api.Constants.IDLE_INTERVAL_MSEC;
+import static org.onosproject.simplefabric.api.Constants.REACTIVE_ALLOW_LINK_CP;
+import static org.onosproject.simplefabric.api.Constants.REACTIVE_HASHED_PATH_SELECTION;
+import static org.onosproject.simplefabric.api.Constants.REACTIVE_MATCH_IP_PROTO;
+import static org.onosproject.simplefabric.api.Constants.REACTIVE_SINGLE_TO_SINGLE;
+import static org.onosproject.simplefabric.util.RouteTools.createBinaryString;
 
 
 /**
@@ -118,25 +132,25 @@
     // SimpleFabric variables
     private ApplicationId appId = null;
 
-    // l2 broadcast networks
-    private Set<L2Network> l2Networks = new HashSet<>();
-    private Set<Interface> l2NetworkInterfaces = new HashSet<>();
+    // fabric networks
+    private Set<FabricNetwork> fabricNetworks = new HashSet<>();
+    private Set<Interface> networkInterfaces = new HashSet<>();
 
     // Subnet table
-    private Set<IpSubnet> ipSubnets = new HashSet<>();
-    private InvertedRadixTree<IpSubnet> ip4SubnetTable =
+    private Set<FabricSubnet> fabricSubnets = new HashSet<>();
+    private InvertedRadixTree<FabricSubnet> ip4SubnetTable =
                  new ConcurrentInvertedRadixTree<>(new DefaultByteArrayNodeFactory());
-    private InvertedRadixTree<IpSubnet> ip6SubnetTable =
+    private InvertedRadixTree<FabricSubnet> ip6SubnetTable =
                  new ConcurrentInvertedRadixTree<>(new DefaultByteArrayNodeFactory());
 
-    // Border Route table
-    private Set<Route> borderRoutes = new HashSet<>();
-    private InvertedRadixTree<Route> ip4BorderRouteTable =
+    // Fabric Route table
+    private Set<FabricRoute> fabricRoutes = new HashSet<>();
+    private InvertedRadixTree<FabricRoute> ip4BorderRouteTable =
                  new ConcurrentInvertedRadixTree<>(new DefaultByteArrayNodeFactory());
-    private InvertedRadixTree<Route> ip6BorderRouteTable =
+    private InvertedRadixTree<FabricRoute> ip6BorderRouteTable =
                  new ConcurrentInvertedRadixTree<>(new DefaultByteArrayNodeFactory());
 
-    // VirtialGateway
+    // Virtual gateway
     private Map<IpAddress, MacAddress> virtualGatewayIpMacMap = Maps.newConcurrentMap();
 
     // Refresh monitor thread
@@ -149,7 +163,6 @@
     private final InternalNetworkConfigListener configListener = new InternalNetworkConfigListener();
     private final InternalDeviceListener deviceListener = new InternalDeviceListener();
     private final InternalHostListener hostListener = new InternalHostListener();
-    private final InternalInterfaceListener interfaceListener = new InternalInterfaceListener();
 
     private ConfigFactory<ApplicationId, SimpleFabricConfig> simpleFabricConfigFactory =
         new ConfigFactory<ApplicationId, SimpleFabricConfig>(
@@ -178,9 +191,9 @@
         hostService.addListener(hostListener);
 
         componentService.activate(appId, SimpleFabricNeighbour.class.getName());
-        componentService.activate(appId, SimpleFabricReactiveRouting.class.getName());
-        if (SimpleFabricService.ALLOW_ETH_ADDRESS_SELECTOR) {
-            componentService.activate(appId, SimpleFabricL2Forward.class.getName());
+        componentService.activate(appId, SimpleFabricRouting.class.getName());
+        if (ALLOW_ETH_ADDRESS_SELECTOR) {
+            componentService.activate(appId, SimpleFabricForwarding.class.getName());
         }
 
         refreshThread = new InternalRefreshThread();
@@ -194,9 +207,9 @@
         log.info("simple fabric stopping");
 
         componentService.deactivate(appId, SimpleFabricNeighbour.class.getName());
-        componentService.deactivate(appId, SimpleFabricReactiveRouting.class.getName());
-        if (SimpleFabricService.ALLOW_ETH_ADDRESS_SELECTOR) {
-            componentService.deactivate(appId, SimpleFabricL2Forward.class.getName());
+        componentService.deactivate(appId, SimpleFabricRouting.class.getName());
+        if (ALLOW_ETH_ADDRESS_SELECTOR) {
+            componentService.deactivate(appId, SimpleFabricForwarding.class.getName());
         }
 
         deviceService.removeListener(deviceListener);
@@ -211,7 +224,7 @@
     }
 
     // Set up from configuration
-    // returns found dirty and refresh listners are called (true) or not (false)
+    // returns found isDirty and refresh listeners are called (true) or not (false)
     private boolean refresh() {
         log.debug("simple fabric refresh");
         boolean dirty = false;
@@ -223,66 +236,66 @@
             return false;
         }
 
-        // l2Networks
-        Set<L2Network> newL2Networks = new HashSet<>();
-        Set<Interface> newL2NetworkInterfaces = new HashSet<>();
-        for (L2Network newL2NetworkConfig : config.getL2Networks()) {
-            L2Network newL2Network = L2Network.of(newL2NetworkConfig);
+        // fabricNetworks
+        Set<FabricNetwork> newFabricNetworks = new HashSet<>();
+        Set<Interface> newInterfaces = new HashSet<>();
+        for (FabricNetwork newFabricNetworkConfig : config.fabricNetworks()) {
+            FabricNetwork newFabricNetwork = DefaultFabricNetwork.of(newFabricNetworkConfig);
 
             // fill up interfaces and Hosts with active port only
-            for (String ifaceName : newL2NetworkConfig.interfaceNames()) {
+            for (String ifaceName : newFabricNetworkConfig.interfaceNames()) {
                 Interface iface = getInterfaceByName(ifaceName);
                 if (iface != null && deviceService.isAvailable(iface.connectPoint().deviceId())) {
-                     newL2Network.addInterface(iface);
-                     newL2NetworkInterfaces.add(iface);
+                     newFabricNetwork.addInterface(iface);
+                     newInterfaces.add(iface);
                 }
             }
             for (Host host : hostService.getHosts()) {
                 // consider host with ip only
                 if (!host.ipAddresses().isEmpty()) {
                     Interface iface = findAvailableDeviceHostInterface(host);
-                    if (iface != null && newL2Network.contains(iface)) {
-                        newL2Network.addHost(host);
+                    if (iface != null && newFabricNetwork.contains(iface)) {
+                        newFabricNetwork.addHost(host);
                     }
                 }
             }
-            newL2Network.setDirty(true);
+            newFabricNetwork.setDirty(true);
 
-            // update newL2Network's dirty flags if same entry already exists
-            for (L2Network prevL2Network : l2Networks) {
-                if (prevL2Network.equals(newL2Network)) {
-                    newL2Network.setDirty(prevL2Network.dirty());
+            // update newFabricNetwork's isDirty flags if same entry already exists
+            for (FabricNetwork prevFabricNetwork : fabricNetworks) {
+                if (prevFabricNetwork.equals(newFabricNetwork)) {
+                    newFabricNetwork.setDirty(prevFabricNetwork.isDirty());
                     break;
                 }
             }
-            newL2Networks.add(newL2Network);
+            newFabricNetworks.add(newFabricNetwork);
         }
-        if (!l2Networks.equals(newL2Networks)) {
-            l2Networks = newL2Networks;
+        if (!fabricNetworks.equals(newFabricNetworks)) {
+            fabricNetworks = newFabricNetworks;
             dirty = true;
         }
-        if (!l2NetworkInterfaces.equals(newL2NetworkInterfaces)) {
-            l2NetworkInterfaces = newL2NetworkInterfaces;
+        if (!networkInterfaces.equals(newInterfaces)) {
+            networkInterfaces = newInterfaces;
             dirty = true;
         }
 
-        // ipSubnets
-        Set<IpSubnet> newIpSubnets = config.ipSubnets();
-        InvertedRadixTree<IpSubnet> newIp4SubnetTable =
+        // default Fabric Subnets
+        Set<FabricSubnet> newFabricSubnets = config.fabricSubnets();
+        InvertedRadixTree<FabricSubnet> newIp4SubnetTable =
                  new ConcurrentInvertedRadixTree<>(new DefaultByteArrayNodeFactory());
-        InvertedRadixTree<IpSubnet> newIp6SubnetTable =
+        InvertedRadixTree<FabricSubnet> newIp6SubnetTable =
                  new ConcurrentInvertedRadixTree<>(new DefaultByteArrayNodeFactory());
         Map<IpAddress, MacAddress> newVirtualGatewayIpMacMap = Maps.newConcurrentMap();
-        for (IpSubnet subnet : newIpSubnets) {
-            if (subnet.ipPrefix().isIp4()) {
-                newIp4SubnetTable.put(createBinaryString(subnet.ipPrefix()), subnet);
+        for (FabricSubnet subnet : newFabricSubnets) {
+            if (subnet.prefix().isIp4()) {
+                newIp4SubnetTable.put(createBinaryString(subnet.prefix()), subnet);
             } else {
-                newIp6SubnetTable.put(createBinaryString(subnet.ipPrefix()), subnet);
+                newIp6SubnetTable.put(createBinaryString(subnet.prefix()), subnet);
             }
             newVirtualGatewayIpMacMap.put(subnet.gatewayIp(), subnet.gatewayMac());
         }
-        if (!ipSubnets.equals(newIpSubnets)) {
-            ipSubnets = newIpSubnets;
+        if (!fabricSubnets.equals(newFabricSubnets)) {
+            fabricSubnets = newFabricSubnets;
             ip4SubnetTable = newIp4SubnetTable;
             ip6SubnetTable = newIp6SubnetTable;
             dirty = true;
@@ -292,21 +305,21 @@
             dirty = true;
         }
 
-        // borderRoutes config handling
-        Set<Route> newBorderRoutes = config.borderRoutes();
-        if (!borderRoutes.equals(newBorderRoutes)) {
-            InvertedRadixTree<Route> newIp4BorderRouteTable =
+        // fabricRoutes config handling
+        Set<FabricRoute> newFabricRoutes = config.fabricRoutes();
+        if (!fabricRoutes.equals(newFabricRoutes)) {
+            InvertedRadixTree<FabricRoute> newIp4BorderRouteTable =
                     new ConcurrentInvertedRadixTree<>(new DefaultByteArrayNodeFactory());
-            InvertedRadixTree<Route> newIp6BorderRouteTable =
+            InvertedRadixTree<FabricRoute> newIp6BorderRouteTable =
                     new ConcurrentInvertedRadixTree<>(new DefaultByteArrayNodeFactory());
-            for (Route route : newBorderRoutes) {
+            for (FabricRoute route : newFabricRoutes) {
                 if (route.prefix().isIp4()) {
                     newIp4BorderRouteTable.put(createBinaryString(route.prefix()), route);
                 } else {
                     newIp6BorderRouteTable.put(createBinaryString(route.prefix()), route);
                 }
             }
-            borderRoutes = newBorderRoutes;
+            fabricRoutes = newFabricRoutes;
             ip4BorderRouteTable = newIp4BorderRouteTable;
             ip6BorderRouteTable = newIp6BorderRouteTable;
             dirty = true;
@@ -332,7 +345,7 @@
     }
 
     @Override
-    public ApplicationId getAppId() {
+    public ApplicationId appId() {
         if (appId == null) {
             appId = coreService.registerApplication(APP_ID);
         }
@@ -340,57 +353,57 @@
     }
 
     @Override
-    public Collection<L2Network> getL2Networks() {
-        return ImmutableSet.copyOf(l2Networks);
+    public Collection<FabricNetwork> fabricNetworks() {
+        return ImmutableSet.copyOf(fabricNetworks);
     }
 
     @Override
-    public Set<IpSubnet> getIpSubnets() {
-        return ImmutableSet.copyOf(ipSubnets);
+    public Set<FabricSubnet> defaultFabricSubnets() {
+        return ImmutableSet.copyOf(fabricSubnets);
     }
 
     @Override
-    public Set<Route> getBorderRoutes() {
-        return ImmutableSet.copyOf(borderRoutes);
+    public Set<FabricRoute> fabricRoutes() {
+        return ImmutableSet.copyOf(fabricRoutes);
     }
 
     @Override
-    public boolean isVMac(MacAddress mac) {
+    public boolean isVirtualGatewayMac(MacAddress mac) {
         return virtualGatewayIpMacMap.containsValue(mac);
     }
 
     @Override
-    public boolean isL2NetworkInterface(Interface intf) {
-        return l2NetworkInterfaces.contains(intf);
+    public boolean isFabricNetworkInterface(Interface intf) {
+        return networkInterfaces.contains(intf);
     }
 
     @Override
-    public MacAddress findVMacForIp(IpAddress ip) {
+    public MacAddress vMacForIp(IpAddress ip) {
         return virtualGatewayIpMacMap.get(ip);
     }
 
     @Override
-    public L2Network findL2Network(ConnectPoint port, VlanId vlanId) {
-        for (L2Network l2Network : l2Networks) {
-            if (l2Network.contains(port, vlanId)) {
-                return l2Network;
+    public FabricNetwork fabricNetwork(ConnectPoint port, VlanId vlanId) {
+        for (FabricNetwork fabricNetwork : fabricNetworks) {
+            if (fabricNetwork.contains(port, vlanId)) {
+                return fabricNetwork;
             }
         }
         return null;
     }
 
     @Override
-    public L2Network findL2Network(String name) {
-        for (L2Network l2Network : l2Networks) {
-            if (l2Network.name().equals(name)) {
-                return l2Network;
+    public FabricNetwork fabricNetwork(String name) {
+        for (FabricNetwork fabricNetwork : fabricNetworks) {
+            if (fabricNetwork.name().equals(name)) {
+                return fabricNetwork;
             }
         }
         return null;
     }
 
     @Override
-    public IpSubnet findIpSubnet(IpAddress ip) {
+    public FabricSubnet fabricSubnet(IpAddress ip) {
         if (ip.isIp4()) {
             return ip4SubnetTable.getValueForLongestKeyPrefixing(
                      createBinaryString(IpPrefix.valueOf(ip, Ip4Address.BIT_LENGTH)));
@@ -401,8 +414,8 @@
     }
 
     @Override
-    public Route findBorderRoute(IpAddress ip) {
-        // ASSUME: ipAddress is out of ipSubnet
+    public FabricRoute fabricRoute(IpAddress ip) {
+        // ASSUME: ipAddress is out of fabricSubnet
         if (ip.isIp4()) {
             return ip4BorderRouteTable.getValueForLongestKeyPrefixing(
                      createBinaryString(IpPrefix.valueOf(ip, Ip4Address.BIT_LENGTH)));
@@ -414,7 +427,7 @@
 
 
     @Override
-    public Interface findHostInterface(Host host) {
+    public Interface hostInterface(Host host) {
         return interfaceService.getInterfaces().stream()
                 .filter(iface -> iface.connectPoint().equals(host.location()) &&
                                  iface.vlan().equals(host.vlan()))
@@ -433,32 +446,32 @@
 
     @Override
     public boolean requestMac(IpAddress ip) {
-        IpSubnet ipSubnet = findIpSubnet(ip);
-        if (ipSubnet == null) {
-            log.warn("simple fabric request mac failed for unknown IpSubnet: {}", ip);
+        FabricSubnet fabricSubnet = fabricSubnet(ip);
+        if (fabricSubnet == null) {
+            log.warn("simple fabric request mac failed for unknown fabricSubnet: {}", ip);
             return false;
         }
-        L2Network l2Network = findL2Network(ipSubnet.l2NetworkName());
-        if (l2Network == null) {
-            log.warn("simple fabric request mac failed for unknown l2Network name {}: {}",
-                     ipSubnet.l2NetworkName(), ip);
+        FabricNetwork fabricNetwork = fabricNetwork(fabricSubnet.networkName());
+        if (fabricNetwork == null) {
+            log.warn("simple fabric request mac failed for unknown fabricNetwork name {}: {}",
+                     fabricSubnet.networkName(), ip);
             return false;
         }
-        log.debug("simple fabric send request mac L2Network {}: {}", l2Network.name(), ip);
-        for (Interface iface : l2Network.interfaces()) {
+        log.debug("simple fabric send request mac fabricNetwork {}: {}", fabricNetwork.name(), ip);
+        for (Interface iface : fabricNetwork.interfaces()) {
             Ethernet neighbourReq;
             if (ip.isIp4()) {
-                neighbourReq = ARP.buildArpRequest(ipSubnet.gatewayMac().toBytes(),
-                                                   ipSubnet.gatewayIp().toOctets(),
+                neighbourReq = ARP.buildArpRequest(fabricSubnet.gatewayMac().toBytes(),
+                                                   fabricSubnet.gatewayIp().toOctets(),
                                                    ip.toOctets(),
                                                    iface.vlan().toShort());
             } else {
                 byte[] soliciteIp = IPv6.getSolicitNodeAddress(ip.toOctets());
                 neighbourReq = NeighborSolicitation.buildNdpSolicit(
                                                    ip.toOctets(),
-                                                   ipSubnet.gatewayIp().toOctets(),
+                                                   fabricSubnet.gatewayIp().toOctets(),
                                                    soliciteIp,
-                                                   ipSubnet.gatewayMac().toBytes(),
+                                                   fabricSubnet.gatewayMac().toBytes(),
                                                    IPv6.getMCastMacAddress(soliciteIp),
                                                    iface.vlan());
             }
@@ -482,34 +495,28 @@
     protected void dump(String subject, PrintStream out) {
         if ("show".equals(subject)) {
             out.println("Static Configuration Flag:");
-            out.println("    ALLOW_IPV6="
-                        + SimpleFabricService.ALLOW_IPV6);
-            out.println("    ALLOW_ETH_ADDRESS_SELECTOR="
-                        + SimpleFabricService.ALLOW_ETH_ADDRESS_SELECTOR);
-            out.println("    REACTIVE_SINGLE_TO_SINGLE="
-                        + SimpleFabricService.REACTIVE_SINGLE_TO_SINGLE);
-            out.println("    REACTIVE_ALLOW_LINK_CP="
-                        + SimpleFabricService.REACTIVE_ALLOW_LINK_CP);
-            out.println("    REACTIVE_HASHED_PATH_SELECTION="
-                        + SimpleFabricService.REACTIVE_HASHED_PATH_SELECTION);
-            out.println("    REACTIVE_MATCH_IP_PROTO="
-                        + SimpleFabricService.REACTIVE_MATCH_IP_PROTO);
+            out.println("    ALLOW_IPV6=" + ALLOW_IPV6);
+            out.println("    ALLOW_ETH_ADDRESS_SELECTOR=" + ALLOW_ETH_ADDRESS_SELECTOR);
+            out.println("    REACTIVE_SINGLE_TO_SINGLE=" + REACTIVE_SINGLE_TO_SINGLE);
+            out.println("    REACTIVE_ALLOW_LINK_CP=" + REACTIVE_ALLOW_LINK_CP);
+            out.println("    REACTIVE_HASHED_PATH_SELECTION=" + REACTIVE_HASHED_PATH_SELECTION);
+            out.println("    REACTIVE_MATCH_IP_PROTO=" + REACTIVE_MATCH_IP_PROTO);
             out.println("");
             out.println("SimpleFabricAppId:");
-            out.println("    " + getAppId());
+            out.println("    " + appId());
             out.println("");
-            out.println("l2Networks:");
-            for (L2Network l2Network : getL2Networks()) {
-                out.println("    " + l2Network);
+            out.println("fabricNetworks:");
+            for (FabricNetwork fabricNetwork : fabricNetworks()) {
+                out.println("    " + fabricNetwork);
             }
             out.println("");
-            out.println("ipSubnets:");
-            for (IpSubnet ipSubnet : getIpSubnets()) {
-                out.println("    " + ipSubnet);
+            out.println("fabricSubnets:");
+            for (FabricSubnet fabricIpSubnet : defaultFabricSubnets()) {
+                out.println("    " + fabricIpSubnet);
             }
             out.println("");
-            out.println("borderRoutes:");
-            for (Route route : getBorderRoutes()) {
+            out.println("fabricRoutes:");
+            for (FabricRoute route : fabricRoutes()) {
                 out.println("    " + route);
             }
         }
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricNeighbour.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricNeighbour.java
similarity index 88%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricNeighbour.java
rename to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricNeighbour.java
index d506a7e..5d7c8b0 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricNeighbour.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricNeighbour.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.simplefabric;
+package org.onosproject.simplefabric.impl;
 
 import org.osgi.service.component.annotations.Activate;
 import org.osgi.service.component.annotations.Component;
@@ -30,6 +30,10 @@
 import org.onosproject.net.neighbour.NeighbourResolutionService;
 import org.onosproject.net.Host;
 import org.onosproject.net.host.HostService;
+import org.onosproject.simplefabric.api.FabricNetwork;
+import org.onosproject.simplefabric.api.SimpleFabricEvent;
+import org.onosproject.simplefabric.api.SimpleFabricListener;
+import org.onosproject.simplefabric.api.SimpleFabricService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -73,7 +77,7 @@
 
     @Activate
     public void activate() {
-        appId = simpleFabric.getAppId();
+        appId = simpleFabric.appId();
         simpleFabric.addListener(simpleFabricListener);
         refresh();
         log.info("simple fabric neighbour started");
@@ -94,7 +98,7 @@
         Set<Interface> interfaces = interfaceService.getInterfaces();
         // check for new interfaces
         for (Interface intf : interfaces) {
-            if (!monitoredInterfaces.contains(intf) && simpleFabric.isL2NetworkInterface(intf)) {
+            if (!monitoredInterfaces.contains(intf) && simpleFabric.isFabricNetworkInterface(intf)) {
                log.info("simple fabric neighbour register handler: {}", intf);
                neighbourService.registerNeighbourHandler(intf, neighbourHandler, appId);
                monitoredInterfaces.add(intf);
@@ -130,7 +134,7 @@
      * @param context the message context
      */
     protected void handleRequest(NeighbourMessageContext context) {
-        MacAddress mac = simpleFabric.findVMacForIp(context.target());
+        MacAddress mac = simpleFabric.vMacForIp(context.target());
         if (mac != null) {
             log.trace("simple fabric neightbour request on virtualGatewayAddress {}; response to {} {} mac={}",
                       context.target(), context.inPort(), context.vlan(), mac);
@@ -139,8 +143,8 @@
         }
         // else forward to corresponding host
 
-        L2Network l2Network = simpleFabric.findL2Network(context.inPort(), context.vlan());
-        if (l2Network != null) {
+        FabricNetwork fabricNetwork = simpleFabric.fabricNetwork(context.inPort(), context.vlan());
+        if (fabricNetwork != null) {
             int numForwards = 0;
             if (!context.dstMac().isBroadcast() && !context.dstMac().isMulticast()) {
                 for (Host host : hostService.getHostsByMac(context.dstMac())) {
@@ -156,7 +160,7 @@
             // else do broadcast to all host in the same l2 network
             log.trace("simple fabric neightbour request forward broadcast: {} {}",
                      context.inPort(), context.vlan());
-            for (Interface iface : l2Network.interfaces()) {
+            for (Interface iface : fabricNetwork.interfaces()) {
                 if (!context.inPort().equals(iface.connectPoint())) {
                     log.trace("simple fabric forward neighbour request broadcast to {}", iface);
                     context.forward(iface);
@@ -178,10 +182,10 @@
     protected void handleReply(NeighbourMessageContext context,
                                HostService hostService) {
         // Find target L2 Network, then reply to the host
-        L2Network l2Network = simpleFabric.findL2Network(context.inPort(), context.vlan());
-        if (l2Network != null) {
-            // TODO: need to check and update simpleFabric.L2Network
-            MacAddress mac = simpleFabric.findVMacForIp(context.target());
+        FabricNetwork fabricNetwork = simpleFabric.fabricNetwork(context.inPort(), context.vlan());
+        if (fabricNetwork != null) {
+            // TODO: need to check and update simpleFabric.DefaultFabricNetwork
+            MacAddress mac = simpleFabric.vMacForIp(context.target());
             if (mac != null) {
                 log.trace("simple fabric neightbour response message to virtual gateway; drop: {} {} target={}",
                           context.inPort(), context.vlan(), context.target());
@@ -192,14 +196,14 @@
                 log.trace("simple fabric neightbour response message forward: {} {} target={} -> {}",
                           context.inPort(), context.vlan(), context.target(), hosts);
                 hosts.stream()
-                        .map(host -> simpleFabric.findHostInterface(host))
+                        .map(host -> simpleFabric.hostInterface(host))
                         .filter(Objects::nonNull)
                         .forEach(context::forward);
             }
         } else {
             // this might be happened when we remove an interface from L2 Network
             // just ignore this message
-            log.warn("simple fabric neightbour response message drop for unknown l2Network: {} {}",
+            log.warn("simple fabric neightbour response message drop for unknown fabricNetwork: {} {}",
                      context.inPort(), context.vlan());
             context.drop();
         }
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricReactiveRouting.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricRouting.java
similarity index 85%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricReactiveRouting.java
rename to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricRouting.java
index ee37a95..cbca9a5 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricReactiveRouting.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/SimpleFabricRouting.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.simplefabric;
+package org.onosproject.simplefabric.impl;
 
 import com.google.common.collect.ImmutableList;
 import org.osgi.service.component.annotations.Activate;
@@ -27,41 +27,41 @@
 import org.onlab.packet.ICMP6;
 import org.onlab.packet.IPv4;
 import org.onlab.packet.IPv6;
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
 import org.onlab.packet.Ip4Address;
 import org.onlab.packet.Ip4Prefix;
 import org.onlab.packet.Ip6Address;
 import org.onlab.packet.Ip6Prefix;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.IpPrefix;
 import org.onlab.packet.MacAddress;
 import org.onlab.packet.VlanId;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
-import org.onosproject.net.FilteredConnectPoint;
-import org.onosproject.net.intf.InterfaceService;
 import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.EncapsulationType;
 import org.onosproject.net.Device;
 import org.onosproject.net.DeviceId;
+import org.onosproject.net.EncapsulationType;
+import org.onosproject.net.FilteredConnectPoint;
+import org.onosproject.net.Host;
 import org.onosproject.net.device.DeviceService;
 import org.onosproject.net.flow.DefaultFlowRule;
 import org.onosproject.net.flow.DefaultTrafficSelector;
 import org.onosproject.net.flow.DefaultTrafficTreatment;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
 import org.onosproject.net.flow.FlowRule;
 import org.onosproject.net.flow.FlowRuleService;
-import org.onosproject.net.Host;
+import org.onosproject.net.flow.TrafficSelector;
+import org.onosproject.net.flow.TrafficTreatment;
 import org.onosproject.net.host.HostService;
 import org.onosproject.net.intent.Constraint;
-import org.onosproject.net.intent.constraint.EncapsulationConstraint;
-import org.onosproject.net.intent.constraint.PartialFailureConstraint;
-import org.onosproject.net.intent.constraint.HashedPathSelectionConstraint;
 import org.onosproject.net.intent.Intent;
 import org.onosproject.net.intent.IntentService;
 import org.onosproject.net.intent.Key;
 import org.onosproject.net.intent.MultiPointToSinglePointIntent;
+import org.onosproject.net.intent.constraint.EncapsulationConstraint;
+import org.onosproject.net.intent.constraint.HashedPathSelectionConstraint;
+import org.onosproject.net.intent.constraint.PartialFailureConstraint;
 import org.onosproject.net.intf.Interface;
+import org.onosproject.net.intf.InterfaceService;
 import org.onosproject.net.link.LinkService;
 import org.onosproject.net.packet.DefaultOutboundPacket;
 import org.onosproject.net.packet.InboundPacket;
@@ -70,6 +70,12 @@
 import org.onosproject.net.packet.PacketPriority;
 import org.onosproject.net.packet.PacketProcessor;
 import org.onosproject.net.packet.PacketService;
+import org.onosproject.simplefabric.api.FabricNetwork;
+import org.onosproject.simplefabric.api.FabricSubnet;
+import org.onosproject.simplefabric.api.FabricRoute;
+import org.onosproject.simplefabric.api.SimpleFabricEvent;
+import org.onosproject.simplefabric.api.SimpleFabricListener;
+import org.onosproject.simplefabric.api.SimpleFabricService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -82,15 +88,29 @@
 import java.util.List;
 import java.util.Set;
 
+import static org.onosproject.simplefabric.api.Constants.ALLOW_ETH_ADDRESS_SELECTOR;
+import static org.onosproject.simplefabric.api.Constants.ALLOW_IPV6;
+import static org.onosproject.simplefabric.api.Constants.PRI_REACTIVE_BORDER_BASE;
+import static org.onosproject.simplefabric.api.Constants.PRI_REACTIVE_BORDER_FORWARD;
+import static org.onosproject.simplefabric.api.Constants.PRI_REACTIVE_BORDER_INTERCEPT;
+import static org.onosproject.simplefabric.api.Constants.PRI_REACTIVE_BORDER_STEP;
+import static org.onosproject.simplefabric.api.Constants.PRI_REACTIVE_LOCAL_FORWARD;
+import static org.onosproject.simplefabric.api.Constants.PRI_REACTIVE_LOCAL_INTERCEPT;
+import static org.onosproject.simplefabric.api.Constants.REACTIVE_ALLOW_LINK_CP;
+import static org.onosproject.simplefabric.api.Constants.ROUTING_APP_ID;
+import static org.onosproject.simplefabric.api.Constants.REACTIVE_HASHED_PATH_SELECTION;
+import static org.onosproject.simplefabric.api.Constants.REACTIVE_MATCH_IP_PROTO;
+import static org.onosproject.simplefabric.api.Constants.REACTIVE_SINGLE_TO_SINGLE;
+
 
 /**
- * SimpleFabricReactiveRouting handles L3 Reactive Routing.
+ * SimpleFabricRouting handles Routing.
  */
 @Component(immediate = true, enabled = false)
-public class SimpleFabricReactiveRouting {
+public class SimpleFabricRouting {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
-    private ApplicationId reactiveAppId;
+    private ApplicationId appId;
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected CoreService coreService;
@@ -130,36 +150,36 @@
             // NOTE: manage purged intents by key for intentService.getIntent() supports key only
 
     private final InternalSimpleFabricListener simpleFabricListener = new InternalSimpleFabricListener();
-    private ReactiveRoutingProcessor processor = new ReactiveRoutingProcessor();
+    private InternalRoutingProcessor processor = new InternalRoutingProcessor();
 
     @Activate
     public void activate() {
-        reactiveAppId = coreService.registerApplication(simpleFabric.REACTIVE_APP_ID);
-        log.info("simple fabric reactive routing starting with app id {}", reactiveAppId.toString());
+        appId = coreService.registerApplication(ROUTING_APP_ID);
+        log.info("simple fabric routing starting with app id {}", appId.toString());
 
         // NOTE: may not clear at init for MIGHT generate pending_remove garbages
         //       use flush event from simple fabric cli command
 
-        if (simpleFabric.REACTIVE_HASHED_PATH_SELECTION) {
+        if (REACTIVE_HASHED_PATH_SELECTION) {
             reactiveConstraints = ImmutableList.of(new PartialFailureConstraint(),
                                                    new HashedPathSelectionConstraint());
         } else {
             reactiveConstraints = ImmutableList.of(new PartialFailureConstraint());
         }
 
-        processor = new ReactiveRoutingProcessor();
+        processor = new InternalRoutingProcessor();
         packetService.addProcessor(processor, PacketProcessor.director(2));
         simpleFabric.addListener(simpleFabricListener);
 
         registerIntercepts();
         refreshIntercepts();
 
-        log.info("simple fabric reactive routing started");
+        log.info("simple fabric routing started");
     }
 
     @Deactivate
     public void deactivate() {
-        log.info("simple fabric reactive routing stopping");
+        log.info("simple fabric routing stopping");
 
         packetService.removeProcessor(processor);
         simpleFabric.removeListener(simpleFabricListener);
@@ -171,11 +191,11 @@
 
         toBePurgedIntentKeys.clear();
 
-        flowRuleService.removeFlowRulesById(reactiveAppId);
+        flowRuleService.removeFlowRulesById(appId);
 
         processor = null;
 
-        log.info("simple fabric reactive routing stopped");
+        log.info("simple fabric routing stopped");
     }
 
     /**
@@ -186,15 +206,15 @@
 
         packetService.requestPackets(
             DefaultTrafficSelector.builder().matchEthType(Ethernet.TYPE_IPV4).build(),
-            PacketPriority.REACTIVE, reactiveAppId);
+            PacketPriority.REACTIVE, appId);
 
-        if (simpleFabric.ALLOW_IPV6) {
+        if (ALLOW_IPV6) {
             packetService.requestPackets(
                 DefaultTrafficSelector.builder().matchEthType(Ethernet.TYPE_IPV6).build(),
-                PacketPriority.REACTIVE, reactiveAppId);
+                PacketPriority.REACTIVE, appId);
         }
 
-        log.info("simple fabric reactive routing ip packet intercepts started");
+        log.info("simple fabric routing ip packet intercepts started");
     }
 
     /**
@@ -205,35 +225,35 @@
 
         packetService.cancelPackets(
             DefaultTrafficSelector.builder().matchEthType(Ethernet.TYPE_IPV4).build(),
-            PacketPriority.REACTIVE, reactiveAppId);
+            PacketPriority.REACTIVE, appId);
 
-        if (simpleFabric.ALLOW_IPV6) {
+        if (ALLOW_IPV6) {
             packetService.cancelPackets(
                 DefaultTrafficSelector.builder().matchEthType(Ethernet.TYPE_IPV6).build(),
-                PacketPriority.REACTIVE, reactiveAppId);
+                PacketPriority.REACTIVE, appId);
         }
 
-        log.info("simple fabric reactive routing ip packet intercepts stopped");
+        log.info("simple fabric routing ip packet intercepts stopped");
     }
 
     /**
-     * Refresh device flow rules for reative intercepts on local ipSubnets.
+     * Refresh device flow rules for intercepts on local fabricSubnets.
      */
     private void refreshIntercepts() {
         Set<FlowRule> newInterceptFlowRules = new HashSet<>();
         for (Device device : deviceService.getAvailableDevices()) {
-            for (IpSubnet subnet : simpleFabric.getIpSubnets()) {
-                newInterceptFlowRules.add(generateInterceptFlowRule(true, device.id(), subnet.ipPrefix()));
-                // check if this devices has the ipSubnet, then add ip broadcast flue rule
-                L2Network l2Network = simpleFabric.findL2Network(subnet.l2NetworkName());
-                if (l2Network != null && l2Network.contains(device.id())) {
-                    newInterceptFlowRules.add(generateLocalSubnetIpBctFlowRule(device.id(), subnet.ipPrefix(),
-                                                                               l2Network));
+            for (FabricSubnet subnet : simpleFabric.defaultFabricSubnets()) {
+                newInterceptFlowRules.add(generateInterceptFlowRule(true, device.id(), subnet.prefix()));
+                // check if this devices has the fabricSubnet, then add ip broadcast flue rule
+                FabricNetwork fabricNetwork = simpleFabric.fabricNetwork(subnet.networkName());
+                if (fabricNetwork != null && fabricNetwork.contains(device.id())) {
+                    newInterceptFlowRules.add(generateLocalSubnetIpBctFlowRule(device.id(), subnet.prefix(),
+                            fabricNetwork));
                 }
                 // JUST FOR FLOW RULE TEST ONLY
                 //newInterceptFlowRules.add(generateTestFlowRule(device.id(), subnet.ipPrefix()));
             }
-            for (Route route : simpleFabric.getBorderRoutes()) {
+            for (FabricRoute route : simpleFabric.fabricRoutes()) {
                 newInterceptFlowRules.add(generateInterceptFlowRule(false, device.id(), route.prefix()));
             }
         }
@@ -252,7 +272,7 @@
                 .filter(rule -> !interceptFlowRules.contains(rule))
                 .forEach(rule -> {
                     flowRuleService.applyFlowRules(rule);
-                    log.info("simple fabric reactive routing apply intercept flow rule: {}", rule);
+                    log.info("simple fabric routing apply intercept flow rule: {}", rule);
                 });
             interceptFlowRules = newInterceptFlowRules;
         }
@@ -276,13 +296,13 @@
                 .withPriority(reactivePriority(false, isDstLocalSubnet, prefix.prefixLength()))
                 .withSelector(selector.build())
                 .withTreatment(DefaultTrafficTreatment.builder().punt().build())
-                .fromApp(reactiveAppId)
+                .fromApp(appId)
                 .makePermanent()
                 .forTable(0).build();
         return rule;
     }
 
-    private FlowRule generateLocalSubnetIpBctFlowRule(DeviceId deviceId, IpPrefix prefix, L2Network l2Network) {
+    private FlowRule generateLocalSubnetIpBctFlowRule(DeviceId deviceId, IpPrefix prefix, FabricNetwork fabricNetwork) {
         TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
         IpPrefix bctPrefix;
         if (prefix.isIp4()) {
@@ -303,7 +323,7 @@
         }
         TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
         Set<ConnectPoint> newEgressPoints = new HashSet<>();
-        for (Interface iface : l2Network.interfaces()) {
+        for (Interface iface : fabricNetwork.interfaces()) {
             if (iface.connectPoint().deviceId().equals(deviceId)) {
                 treatment.setOutput(iface.connectPoint().port());
             }
@@ -313,7 +333,7 @@
                 .withPriority(reactivePriority(true, true, bctPrefix.prefixLength()))
                 .withSelector(selector.build())
                 .withTreatment(treatment.build())
-                .fromApp(reactiveAppId)
+                .fromApp(appId)
                 .makePermanent()
                 .forTable(0).build();
         return rule;
@@ -324,7 +344,7 @@
      */
     private void refreshRouteIntents() {
         for (Intent entry : intentService.getIntents()) {
-            if (!reactiveAppId.equals(entry.appId())) {
+            if (!appId.equals(entry.appId())) {
                 continue;
             }
 
@@ -362,8 +382,8 @@
                 toBePurgedIntentKeys.add(intent.key());
                 continue;
             }
-            if (!(simpleFabric.findL2Network(intent.egressPoint(), VlanId.NONE) != null ||
-                  (simpleFabric.REACTIVE_ALLOW_LINK_CP &&
+            if (!(simpleFabric.fabricNetwork(intent.egressPoint(), VlanId.NONE) != null ||
+                  (REACTIVE_ALLOW_LINK_CP &&
                    !linkService.getEgressLinks(intent.egressPoint()).isEmpty()))) {
                 log.info("refresh route intents; remove intent for egress point not available: key={}", intent.key());
                 intentService.withdraw(intentService.getIntent(intent.key()));
@@ -372,7 +392,7 @@
             }
 
             // MAY NEED TO CHECK: intent.egressPoint and intent.treatment's dstMac is valid against hosts
-            if (simpleFabric.REACTIVE_SINGLE_TO_SINGLE && !simpleFabric.REACTIVE_ALLOW_LINK_CP) {
+            if (REACTIVE_SINGLE_TO_SINGLE && !REACTIVE_ALLOW_LINK_CP) {
                 // single path intent only; no need to check ingress points
                 continue;
             }
@@ -381,8 +401,8 @@
             boolean ingressPointChanged = false;
             for (FilteredConnectPoint cp : intent.filteredIngressPoints()) {
                 if (deviceService.isAvailable(cp.connectPoint().deviceId()) &&
-                    (simpleFabric.findL2Network(cp.connectPoint(), VlanId.NONE) != null ||
-                     (simpleFabric.REACTIVE_ALLOW_LINK_CP &&
+                    (simpleFabric.fabricNetwork(cp.connectPoint(), VlanId.NONE) != null ||
+                     (REACTIVE_ALLOW_LINK_CP &&
                       !linkService.getIngressLinks(cp.connectPoint()).isEmpty()))) {
                     newIngressPoints.add(cp);
                 } else {
@@ -402,7 +422,7 @@
             if (ingressPointChanged) {
                 MultiPointToSinglePointIntent updatedIntent =
                     MultiPointToSinglePointIntent.builder()
-                        .appId(reactiveAppId)
+                        .appId(appId)
                         .key(intent.key())
                         .selector(intent.selector())
                         .treatment(intent.treatment())
@@ -466,7 +486,7 @@
         // NOTE: cli calls are handling within the cli called node only; so should not user inents.isLocal()
         Set<Intent> myIntents = new HashSet<>();
         for (Intent intent : intentService.getIntents()) {
-            if (reactiveAppId.equals(intent.appId())) {
+            if (appId.equals(intent.appId())) {
                 myIntents.add(intent);
             }
         }
@@ -503,9 +523,9 @@
     }
 
     /**
-     * Reactive Packet Handling.
+     * Internal Packet Handling.
      */
-    private class ReactiveRoutingProcessor implements PacketProcessor {
+    private class InternalRoutingProcessor implements PacketProcessor {
         @Override
         public void process(PacketContext context) {
             InboundPacket pkt = context.inPacket();
@@ -552,8 +572,8 @@
     private boolean checkVirtualGatewayIpPacket(InboundPacket pkt, IpAddress srcIp, IpAddress dstIp) {
         Ethernet ethPkt = pkt.parsed();  // assume valid
 
-        MacAddress mac = simpleFabric.findVMacForIp(dstIp);
-        if (mac == null || !simpleFabric.isVMac(ethPkt.getDestinationMAC())) {
+        MacAddress mac = simpleFabric.vMacForIp(dstIp);
+        if (mac == null || !simpleFabric.isVirtualGatewayMac(ethPkt.getDestinationMAC())) {
             /* Destination MAC should be any of virtual gateway macs */
             return false;
         } else if (dstIp.isIp4()) {
@@ -621,12 +641,12 @@
         IpAddress dstNextHop = dstIp;
         MacAddress treatmentSrcMac = ethPkt.getDestinationMAC();
         int borderRoutePrefixLength = 0;
-        boolean updateMac = simpleFabric.isVMac(ethPkt.getDestinationMAC());
+        boolean updateMac = simpleFabric.isVirtualGatewayMac(ethPkt.getDestinationMAC());
 
         // check subnet local or route
-        IpSubnet srcSubnet = simpleFabric.findIpSubnet(srcIp);
+        FabricSubnet srcSubnet = simpleFabric.fabricSubnet(srcIp);
         if (srcSubnet == null) {
-            Route route = simpleFabric.findBorderRoute(srcIp);
+            FabricRoute route = simpleFabric.fabricRoute(srcIp);
             if (route == null) {
                 log.warn("unknown srcIp; drop: srcCp={} srcIp={} dstIp={} ipProto={}",
                          srcCp, srcIp, dstIp, ipProto);
@@ -636,9 +656,9 @@
             srcNextHop = route.nextHop();
             borderRoutePrefixLength = route.prefix().prefixLength();
         }
-        IpSubnet dstSubnet = simpleFabric.findIpSubnet(dstIp);
+        FabricSubnet dstSubnet = simpleFabric.fabricSubnet(dstIp);
         if (dstSubnet == null) {
-            Route route = simpleFabric.findBorderRoute(dstIp);
+            FabricRoute route = simpleFabric.fabricRoute(dstIp);
             if (route == null) {
                 log.warn("unknown dstIp; drop: srcCp={} srcIp={} dstIp={} ipProto={}",
                          srcCp, srcIp, dstIp, ipProto);
@@ -651,11 +671,11 @@
 
         if (dstSubnet != null) {
             // destination is local subnet ip
-            if (SimpleFabricService.ALLOW_ETH_ADDRESS_SELECTOR && dstSubnet.equals(srcSubnet)) {
-                // NOTE: if ALLOW_ETH_ADDRESS_SELECTOR=false; l2Forward is always false
-                L2Network l2Network = simpleFabric.findL2Network(dstSubnet.l2NetworkName());
+            if (ALLOW_ETH_ADDRESS_SELECTOR && dstSubnet.equals(srcSubnet)) {
+                // NOTE: if ALLOW_ETH_ADDRESS_SELECTOR=false; isForward is always false
+                FabricNetwork fabricNetwork = simpleFabric.fabricNetwork(dstSubnet.networkName());
                 treatmentSrcMac = ethPkt.getSourceMAC();
-                if (l2Network != null && l2Network.l2Forward()) {
+                if (fabricNetwork != null && fabricNetwork.isForward()) {
                     // NOTE: no reactive route action but do forward packet for L2Forward do not handle packet
                     // update mac only if dstMac is virtualGatewayMac, else assume valid mac already for the l2 network
                     log.info("LOCAL FORWARD ONLY: "
@@ -709,7 +729,7 @@
             log.warn("forward packet nextHopIp host_mac unknown: nextHopIp={}", nextHopIp);
             hostService.startMonitoringIp(nextHopIp);
             simpleFabric.requestMac(nextHopIp);
-            // CONSIDER: make flood on all port of the dstHost's L2Network
+            // CONSIDER: make flood on all port of the dstHost's DefaultFabricNetwork
             return;
         }
         TrafficTreatment treatment = DefaultTrafficTreatment.builder()
@@ -736,15 +756,15 @@
      *
      * ToHost: dstPrefix = dstHostIp.toIpPrefix(), nextHopIp = destHostIp
      * ToInternet: dstPrefix = route.prefix(), nextHopIp = route.nextHopIp
-     * returns intent submited or not
+     * returns intent submitted or not
      */
     private boolean setUpConnectivity(ConnectPoint srcCp, byte ipProto, IpPrefix srcPrefix, IpPrefix dstPrefix,
                                       IpAddress nextHopIp, MacAddress treatmentSrcMac,
                                       EncapsulationType encap, boolean updateMac,
                                       boolean isDstLocalSubnet, int borderRoutePrefixLength) {
-        if (!(simpleFabric.findL2Network(srcCp, VlanId.NONE) != null ||
-             (simpleFabric.REACTIVE_ALLOW_LINK_CP && !linkService.getIngressLinks(srcCp).isEmpty()))) {
-            log.warn("NO REGI for srcCp not in L2Network; srcCp={} srcPrefix={} dstPrefix={} nextHopIp={}",
+        if (!(simpleFabric.fabricNetwork(srcCp, VlanId.NONE) != null ||
+             (REACTIVE_ALLOW_LINK_CP && !linkService.getIngressLinks(srcCp).isEmpty()))) {
+            log.warn("NO REGI for srcCp not in DefaultFabricNetwork; srcCp={} srcPrefix={} dstPrefix={} nextHopIp={}",
                       srcCp, srcPrefix, dstPrefix, nextHopIp);
             return false;
         }
@@ -766,7 +786,7 @@
             return false;
         }
         TrafficTreatment treatment;
-        if (updateMac && simpleFabric.ALLOW_ETH_ADDRESS_SELECTOR) {
+        if (updateMac && ALLOW_ETH_ADDRESS_SELECTOR) {
             treatment = generateSetMacTreatment(nextHopMac, treatmentSrcMac);
         } else {
             treatment = DefaultTrafficTreatment.builder().build();
@@ -775,39 +795,39 @@
         TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
         if (dstPrefix.isIp4()) {
             selector.matchEthType(Ethernet.TYPE_IPV4);
-            if (simpleFabric.REACTIVE_SINGLE_TO_SINGLE && srcPrefix.prefixLength() > 0) {
+            if (REACTIVE_SINGLE_TO_SINGLE && srcPrefix.prefixLength() > 0) {
                 selector.matchIPSrc(srcPrefix);
             }
             if (dstPrefix.prefixLength() > 0) {
                 selector.matchIPDst(dstPrefix);
             }
-            if (ipProto != 0 && simpleFabric.REACTIVE_MATCH_IP_PROTO) {
+            if (ipProto != 0 && REACTIVE_MATCH_IP_PROTO) {
                 selector.matchIPProtocol(ipProto);
             }
         } else {
             selector.matchEthType(Ethernet.TYPE_IPV6);
-            if (simpleFabric.REACTIVE_SINGLE_TO_SINGLE && srcPrefix.prefixLength() > 0) {
+            if (REACTIVE_SINGLE_TO_SINGLE && srcPrefix.prefixLength() > 0) {
                 selector.matchIPv6Src(srcPrefix);
             }
             if (dstPrefix.prefixLength() > 0) {
                 selector.matchIPv6Dst(dstPrefix);
             }
-            if (ipProto != 0 && simpleFabric.REACTIVE_MATCH_IP_PROTO) {
+            if (ipProto != 0 && REACTIVE_MATCH_IP_PROTO) {
                 selector.matchIPProtocol(ipProto);
             }
         }
 
         Key key;
         String keyProtoTag = "";
-        if (simpleFabric.REACTIVE_MATCH_IP_PROTO) {
+        if (REACTIVE_MATCH_IP_PROTO) {
             keyProtoTag = "-p" + ipProto;
         }
-        if (simpleFabric.REACTIVE_SINGLE_TO_SINGLE) {
+        if (REACTIVE_SINGLE_TO_SINGLE) {
             // allocate intent per (srcPrefix, dstPrefix)
-            key = Key.of(srcPrefix.toString() + "-to-" + dstPrefix.toString() + keyProtoTag, reactiveAppId);
+            key = Key.of(srcPrefix.toString() + "-to-" + dstPrefix.toString() + keyProtoTag, appId);
         } else {
             // allocate intent per (srcDeviceId, dstPrefix)
-            key = Key.of(srcCp.deviceId().toString() + "-to-" +  dstPrefix.toString() + keyProtoTag, reactiveAppId);
+            key = Key.of(srcCp.deviceId().toString() + "-to-" +  dstPrefix.toString() + keyProtoTag, appId);
         }
 
         // check and merge already existing ingress points
@@ -835,7 +855,7 @@
 
         MultiPointToSinglePointIntent newIntent = MultiPointToSinglePointIntent.builder()
             .key(key)
-            .appId(reactiveAppId)
+            .appId(appId)
             .selector(selector.build())
             .treatment(treatment)
             .filteredIngressPoints(ingressPoints)
@@ -843,7 +863,7 @@
             .priority(priority)
             .constraints(buildConstraints(reactiveConstraints, encap))
             .build();
-        log.info("submmit mp2p intent: srcPrefix={} dstPrefix={} srcCp={} "
+        log.info("submit mp2p intent: srcPrefix={} dstPrefix={} srcCp={} "
                  + "newIntent={} nextHopIp={} nextHopMac={} priority={}",
                  srcPrefix, dstPrefix, ingressPoints, newIntent, nextHopIp, nextHopMac, priority);
         toBePurgedIntentKeys.remove(newIntent.key());
@@ -862,7 +882,7 @@
 
     // monitor border peers for routeService lookup to be effective
     private void monitorBorderPeers() {
-        for (Route route : simpleFabric.getBorderRoutes()) {
+        for (FabricRoute route : simpleFabric.fabricRoutes()) {
             hostService.startMonitoringIp(route.nextHop());
             simpleFabric.requestMac(route.nextHop());
         }
@@ -872,19 +892,19 @@
     private int reactivePriority(boolean isForward, boolean isDstLocalSubnet, int borderRoutePrefixLength) {
         if (isDstLocalSubnet) {  // -> dst:localSubnet
             if (isForward) {
-                return simpleFabric.PRI_REACTIVE_LOCAL_FORWARD;
+                return PRI_REACTIVE_LOCAL_FORWARD;
             } else {  // isInterncept
-                return simpleFabric.PRI_REACTIVE_LOCAL_INTERCEPT;
+                return PRI_REACTIVE_LOCAL_INTERCEPT;
             }
         } else {  // -> dst:boarderRouteNextHop
             int offset;
             if (isForward) {
-                offset = simpleFabric.PRI_REACTIVE_BORDER_FORWARD;
+                offset = PRI_REACTIVE_BORDER_FORWARD;
             } else {  // isIntercept
-                offset = simpleFabric.PRI_REACTIVE_BORDER_INTERCEPT;
+                offset = PRI_REACTIVE_BORDER_INTERCEPT;
             }
-           return simpleFabric.PRI_REACTIVE_BORDER_BASE
-                  + borderRoutePrefixLength * simpleFabric.PRI_REACTIVE_BORDER_STEP + offset;
+           return PRI_REACTIVE_BORDER_BASE
+                  + borderRoutePrefixLength * PRI_REACTIVE_BORDER_STEP + offset;
         }
     }
 
@@ -904,9 +924,9 @@
     // Dump Cli Handler
     private void dump(String subject, PrintStream out) {
         if ("intents".equals(subject)) {
-            out.println("Reactive Routing Route Intents:\n");
+            out.println("Routing Route Intents:\n");
             for (Intent entry : intentService.getIntents()) {
-                if (reactiveAppId.equals(entry.appId())) {
+                if (appId.equals(entry.appId())) {
                     MultiPointToSinglePointIntent intent = (MultiPointToSinglePointIntent) entry;
                     out.println("    " + intent.key().toString()
                                 + " to " + intent.egressPoint().toString()
@@ -916,7 +936,7 @@
             }
             out.println("");
 
-            out.println("Reactive Routing Intercept Flow Rules:\n");
+            out.println("Routing Intercept Flow Rules:\n");
             List<FlowRule> rules = new ArrayList(interceptFlowRules);
             Collections.sort(rules, new Comparator<FlowRule>() {
                     @Override
@@ -931,7 +951,7 @@
                           + " selector=" + rule.selector().criteria().toString());
             }
             out.println("");
-            out.println("Reactive Routing Intents to Be Purged:\n");
+            out.println("Routing Intents to Be Purged:\n");
             for (Key key: toBePurgedIntentKeys) {
                 out.println("    " + key.toString());
             }
@@ -939,7 +959,7 @@
 
         } else if ("reactive-intents".equals(subject)) {
             for (Intent entry : intentService.getIntents()) {
-                if (reactiveAppId.equals(entry.appId())) {
+                if (appId.equals(entry.appId())) {
                     MultiPointToSinglePointIntent intent = (MultiPointToSinglePointIntent) entry;
                     out.println(intent.key().toString()
                                 + " to " + intent.egressPoint().toString()
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/package-info.java
similarity index 67%
copy from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
copy to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/package-info.java
index 726d578..d190b08 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/impl/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,13 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.simplefabric;
-
-import org.onosproject.event.EventListener;
 
 /**
- * Entity capable of receiving alarm related events.
+ * Simple fabric implementation package.
  */
-public interface SimpleFabricListener extends EventListener<SimpleFabricEvent> {
-}
-
+package org.onosproject.simplefabric.impl;
\ No newline at end of file
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/package-info.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/package-info.java
similarity index 100%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/package-info.java
rename to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/package-info.java
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/RouteTools.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/util/RouteTools.java
similarity index 94%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/RouteTools.java
rename to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/util/RouteTools.java
index b14438a..d02fed2 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/RouteTools.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/util/RouteTools.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
  * to remove dependency on onos.incubator.routing services, since 2017-08-09.
  */
 
-package org.onosproject.simplefabric;
+package org.onosproject.simplefabric.util;
 
 import org.onlab.packet.IpPrefix;
 
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/util/package-info.java
similarity index 67%
copy from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
copy to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/util/package-info.java
index 726d578..9b3dde3 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/util/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,13 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.simplefabric;
-
-import org.onosproject.event.EventListener;
 
 /**
- * Entity capable of receiving alarm related events.
+ * Simple fabric utility package.
  */
-public interface SimpleFabricListener extends EventListener<SimpleFabricEvent> {
-}
-
+package org.onosproject.simplefabric.util;
\ No newline at end of file
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricWebApplication.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/web/SimpleFabricWebApplication.java
similarity index 89%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricWebApplication.java
rename to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/web/SimpleFabricWebApplication.java
index d82de73..960b4df 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricWebApplication.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/web/SimpleFabricWebApplication.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * 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.simplefabric;
+package org.onosproject.simplefabric.web;
 
 import org.onlab.rest.AbstractWebApplication;
 
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricWebResource.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/web/SimpleFabricWebResource.java
similarity index 94%
rename from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricWebResource.java
rename to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/web/SimpleFabricWebResource.java
index f1e9af7..cc68d6b 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricWebResource.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/web/SimpleFabricWebResource.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,9 +14,10 @@
  * limitations under the License.
  */
 
-package org.onosproject.simplefabric;
+package org.onosproject.simplefabric.web;
 
 import org.onosproject.rest.AbstractWebResource;
+import org.onosproject.simplefabric.api.SimpleFabricService;
 
 import java.io.ByteArrayOutputStream;
 import javax.ws.rs.GET;
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/web/package-info.java
similarity index 67%
copy from apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
copy to apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/web/package-info.java
index 726d578..596ded0 100644
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricListener.java
+++ b/apps/simplefabric/app/src/main/java/org/onosproject/simplefabric/web/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-present Open Networking Foundation
+ * Copyright 2018-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,13 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.simplefabric;
-
-import org.onosproject.event.EventListener;
 
 /**
- * Entity capable of receiving alarm related events.
+ * Simple fabric web package.
  */
-public interface SimpleFabricListener extends EventListener<SimpleFabricEvent> {
-}
-
+package org.onosproject.simplefabric.web;
\ No newline at end of file
diff --git a/apps/simplefabric/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/apps/simplefabric/app/src/main/resources/OSGI-INF/blueprint/shell-config.xml
similarity index 88%
rename from apps/simplefabric/src/main/resources/OSGI-INF/blueprint/shell-config.xml
rename to apps/simplefabric/app/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index 7b6893b..2aad546 100644
--- a/apps/simplefabric/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/apps/simplefabric/app/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -17,12 +17,12 @@
 
     <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
         <command>
-            <action class="org.onosproject.simplefabric.SimpleFabricCommand"/>
+            <action class="org.onosproject.simplefabric.cli.SimpleFabricCommand"/>
             <completers>
                 <ref component-id="SimpleFabricCommandCompleter"/>
             </completers>
         </command>
     </command-bundle>
  
-    <bean id="SimpleFabricCommandCompleter" class="org.onosproject.simplefabric.SimpleFabricCommandCompleter"/>
+    <bean id="SimpleFabricCommandCompleter" class="org.onosproject.simplefabric.cli.SimpleFabricCommandCompleter"/>
 </blueprint>
diff --git a/apps/simplefabric/src/main/webapp/WEB-INF/web.xml b/apps/simplefabric/app/src/main/webapp/WEB-INF/web.xml
similarity index 95%
rename from apps/simplefabric/src/main/webapp/WEB-INF/web.xml
rename to apps/simplefabric/app/src/main/webapp/WEB-INF/web.xml
index e136671..ebcac0e 100644
--- a/apps/simplefabric/src/main/webapp/WEB-INF/web.xml
+++ b/apps/simplefabric/app/src/main/webapp/WEB-INF/web.xml
@@ -46,7 +46,7 @@
         <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
         <init-param>
             <param-name>javax.ws.rs.Application</param-name>
-            <param-value>org.onosproject.simplefabric.SimpleFabricWebApplication</param-value>
+            <param-value>org.onosproject.simplefabric.web.SimpleFabricWebApplication</param-value>
         </init-param>
         <load-on-startup>1</load-on-startup>
     </servlet>
diff --git a/apps/simplefabric/app/src/test/java/org/onosproject/simplefabric/impl/DefaultFabricNetworkTest.java b/apps/simplefabric/app/src/test/java/org/onosproject/simplefabric/impl/DefaultFabricNetworkTest.java
new file mode 100644
index 0000000..57152e7
--- /dev/null
+++ b/apps/simplefabric/app/src/test/java/org/onosproject/simplefabric/impl/DefaultFabricNetworkTest.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.simplefabric.impl;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.testing.EqualsTester;
+import org.junit.Before;
+import org.junit.Test;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.EncapsulationType;
+import org.onosproject.net.host.InterfaceIpAddress;
+import org.onosproject.net.intf.Interface;
+import org.onosproject.simplefabric.api.FabricNetwork;
+
+import java.util.List;
+import java.util.Set;
+
+import static junit.framework.TestCase.assertEquals;
+
+/**
+ * Unit tests for the default fabric network class.
+ */
+public final class DefaultFabricNetworkTest {
+
+    private static final String NAME_1 = "network1";
+    private static final String NAME_2 = "network2";
+
+    private static final String INTF_NAMES_1_1 = "h11";
+    private static final String INTF_NAMES_1_2 = "h12";
+    private static final String INTF_NAMES_2_1 = "h21";
+    private static final String INTF_NAMES_2_2 = "h22";
+
+    private static final Set<String> INTF_NAME_SET_1 =
+                            ImmutableSet.of(INTF_NAMES_1_1, INTF_NAMES_1_2);
+    private static final Set<String> INTF_NAME_SET_2 =
+                            ImmutableSet.of(INTF_NAMES_2_1, INTF_NAMES_2_2);
+
+    private static final EncapsulationType ENCAP_TYPE_1 = EncapsulationType.NONE;
+    private static final EncapsulationType ENCAP_TYPE_2 = EncapsulationType.NONE;
+
+    private static final boolean IS_FORWARD_1 = false;
+    private static final boolean IS_FORWARD_2 = true;
+    private static final boolean IS_BROADCAST_1 = false;
+    private static final boolean IS_BROADCAST_2 = true;
+
+    private FabricNetwork fabricNetwork1;
+    private FabricNetwork sameAsFabricNetwork1;
+    private FabricNetwork fabricNetwork2;
+
+    private static Interface createInterface(int index) {
+
+        String name = "INTF_NAME_" + index;
+        ConnectPoint cp = ConnectPoint.fromString("of:0011223344556677/" + index);
+        InterfaceIpAddress intfIp1 = InterfaceIpAddress.valueOf("10.10.10." + index + "/32");
+        InterfaceIpAddress intfIp2 = InterfaceIpAddress.valueOf("20.20.20." + index + "/32");
+        List<InterfaceIpAddress> intfIps = ImmutableList.of(intfIp1, intfIp2);
+        MacAddress mac = MacAddress.valueOf("00:00:00:00:00:00");
+        VlanId vlanId = VlanId.NONE;
+
+        return new Interface(name, cp, intfIps, mac, vlanId);
+    }
+
+    /**
+     * Initial setup for this unit test.
+     */
+    @Before
+    public void setUp() {
+
+        fabricNetwork1 = DefaultFabricNetwork.builder()
+                                .name(NAME_1)
+                                .interfaceNames(INTF_NAME_SET_1)
+                                .encapsulation(ENCAP_TYPE_1)
+                                .forward(IS_FORWARD_1)
+                                .broadcast(IS_BROADCAST_1)
+                                .build();
+
+        sameAsFabricNetwork1 = DefaultFabricNetwork.builder()
+                                .name(NAME_1)
+                                .interfaceNames(INTF_NAME_SET_1)
+                                .encapsulation(ENCAP_TYPE_1)
+                                .forward(IS_FORWARD_1)
+                                .broadcast(IS_BROADCAST_1)
+                                .build();
+
+        fabricNetwork2 = DefaultFabricNetwork.builder()
+                                .name(NAME_2)
+                                .interfaceNames(INTF_NAME_SET_2)
+                                .encapsulation(ENCAP_TYPE_2)
+                                .forward(IS_FORWARD_2)
+                                .broadcast(IS_BROADCAST_2)
+                                .build();
+    }
+
+    /**
+     * Tests object equality.
+     */
+    @Test
+    public void testEquality() {
+        new EqualsTester().addEqualityGroup(fabricNetwork1, sameAsFabricNetwork1)
+                .addEqualityGroup(fabricNetwork2)
+                .testEquals();
+    }
+
+    /**
+     * Test object construction.
+     */
+    @Test
+    public void testConstruction() {
+        FabricNetwork network = fabricNetwork1;
+
+        assertEquals(network.name(), NAME_1);
+        assertEquals(network.interfaceNames(), INTF_NAME_SET_1);
+        assertEquals(network.encapsulation(), ENCAP_TYPE_1);
+        assertEquals(network.isForward(), IS_FORWARD_1);
+        assertEquals(network.isBroadcast(), IS_BROADCAST_1);
+    }
+}
diff --git a/apps/simplefabric/app/src/test/java/org/onosproject/simplefabric/impl/DefaultFabricRouteTest.java b/apps/simplefabric/app/src/test/java/org/onosproject/simplefabric/impl/DefaultFabricRouteTest.java
new file mode 100644
index 0000000..8a39179
--- /dev/null
+++ b/apps/simplefabric/app/src/test/java/org/onosproject/simplefabric/impl/DefaultFabricRouteTest.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.simplefabric.impl;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Before;
+import org.junit.Test;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.IpPrefix;
+import org.onosproject.cluster.NodeId;
+import org.onosproject.simplefabric.api.FabricRoute;
+import org.onosproject.simplefabric.api.FabricRoute.Source;
+
+import static junit.framework.TestCase.assertEquals;
+import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
+
+/**
+ * Unit tests for the default fabric router.
+ */
+public final class DefaultFabricRouteTest {
+
+    private static final Source SOURCE_1 = Source.STATIC;
+    private static final Source SOURCE_2 = Source.BGP;
+
+    private static final IpPrefix IP_PREFIX_1 = IpPrefix.valueOf("10.10.10.1/32");
+    private static final IpPrefix IP_PREFIX_2 = IpPrefix.valueOf("20.20.20.2/32");
+
+    private static final IpAddress NEXT_HOP_1 = IpAddress.valueOf("10.10.10.1");
+    private static final IpAddress NEXT_HOP_2 = IpAddress.valueOf("20.20.20.2");
+
+    private static final NodeId SOURCE_NODE_1 = NodeId.nodeId("1");
+    private static final NodeId SOURCE_NODE_2 = NodeId.nodeId("2");
+
+    private FabricRoute fabricRoute1;
+    private FabricRoute sameAsFabricRoute1;
+    private FabricRoute fabricRoute2;
+
+    /**
+     * Tests class immutability.
+     */
+    @Test
+    public void testImmutability() {
+        assertThatClassIsImmutable(DefaultFabricRoute.class);
+    }
+
+    /**
+     * Initial setup for this unit test.
+     */
+    @Before
+    public void setUp() {
+        fabricRoute1 = DefaultFabricRoute.builder()
+                                .source(SOURCE_1)
+                                .prefix(IP_PREFIX_1)
+                                .nextHop(NEXT_HOP_1)
+                                .sourceNode(SOURCE_NODE_1)
+                                .build();
+
+        sameAsFabricRoute1 = DefaultFabricRoute.builder()
+                                .source(SOURCE_1)
+                                .prefix(IP_PREFIX_1)
+                                .nextHop(NEXT_HOP_1)
+                                .sourceNode(SOURCE_NODE_1)
+                                .build();
+
+        fabricRoute2 = DefaultFabricRoute.builder()
+                                .source(SOURCE_2)
+                                .prefix(IP_PREFIX_2)
+                                .nextHop(NEXT_HOP_2)
+                                .sourceNode(SOURCE_NODE_2)
+                                .build();
+    }
+
+    /**
+     * Tests object equality.
+     */
+    @Test
+    public void testEquality() {
+        new EqualsTester().addEqualityGroup(fabricRoute1, sameAsFabricRoute1)
+                .addEqualityGroup(fabricRoute2)
+                .testEquals();
+    }
+
+    /**
+     * Test object construction.
+     */
+    @Test
+    public void testConstruction() {
+        FabricRoute route = fabricRoute1;
+
+        assertEquals(route.source(), SOURCE_1);
+        assertEquals(route.prefix(), IP_PREFIX_1);
+        assertEquals(route.nextHop(), NEXT_HOP_1);
+        assertEquals(route.sourceNode(), SOURCE_NODE_1);
+    }
+}
diff --git a/apps/simplefabric/app/src/test/java/org/onosproject/simplefabric/impl/DefaultFabricSubnetTest.java b/apps/simplefabric/app/src/test/java/org/onosproject/simplefabric/impl/DefaultFabricSubnetTest.java
new file mode 100644
index 0000000..82efd14
--- /dev/null
+++ b/apps/simplefabric/app/src/test/java/org/onosproject/simplefabric/impl/DefaultFabricSubnetTest.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.simplefabric.impl;
+
+import com.google.common.testing.EqualsTester;
+import org.junit.Before;
+import org.junit.Test;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.IpPrefix;
+import org.onlab.packet.MacAddress;
+import org.onosproject.net.EncapsulationType;
+import org.onosproject.simplefabric.api.FabricSubnet;
+
+import static junit.framework.TestCase.assertEquals;
+
+/**
+ * Unit tests for the default fabric IP subnet class.
+ */
+public final class DefaultFabricSubnetTest {
+
+    private static final IpPrefix IP_PREFIX_1 = IpPrefix.valueOf("10.10.10.11/32");
+    private static final IpPrefix IP_PREFIX_2 = IpPrefix.valueOf("20.20.20.11/32");
+
+    private static final IpAddress GATEWAY_IP_1 = IpAddress.valueOf("10.10.10.1");
+    private static final IpAddress GATEWAY_IP_2 = IpAddress.valueOf("20.20.20.1");
+
+    private static final MacAddress GATEWAY_MAC_1 = MacAddress.valueOf("00:11:22:33:44:55");
+    private static final MacAddress GATEWAY_MAC_2 = MacAddress.valueOf("11:22:33:44:55:66");
+
+    private static final EncapsulationType ENCAP_TYPE_1 = EncapsulationType.NONE;
+    private static final EncapsulationType ENCAP_TYPE_2 = EncapsulationType.NONE;
+
+    private static final String NETWORK_NAME_1 = "sonaFabric1";
+    private static final String NETWORK_NAME_2 = "sonaFabric2";
+
+    private FabricSubnet subnet1;
+    private FabricSubnet sameAsSubnet1;
+    private FabricSubnet subnet2;
+
+    /**
+     * Initial setup for this unit test.
+     */
+    @Before
+    public void setUp() {
+
+        subnet1 = DefaultFabricSubnet.builder()
+                            .prefix(IP_PREFIX_1)
+                            .gatewayIp(GATEWAY_IP_1)
+                            .gatewayMac(GATEWAY_MAC_1)
+                            .encapsulation(ENCAP_TYPE_1)
+                            .networkName(NETWORK_NAME_1)
+                            .build();
+
+        sameAsSubnet1 = DefaultFabricSubnet.builder()
+                            .prefix(IP_PREFIX_1)
+                            .gatewayIp(GATEWAY_IP_1)
+                            .gatewayMac(GATEWAY_MAC_1)
+                            .encapsulation(ENCAP_TYPE_1)
+                            .networkName(NETWORK_NAME_1)
+                            .build();
+
+        subnet2 = DefaultFabricSubnet.builder()
+                            .prefix(IP_PREFIX_2)
+                            .gatewayIp(GATEWAY_IP_2)
+                            .gatewayMac(GATEWAY_MAC_2)
+                            .encapsulation(ENCAP_TYPE_2)
+                            .networkName(NETWORK_NAME_2)
+                            .build();
+    }
+
+    /**
+     * Tests object equality.
+     */
+    @Test
+    public void testEquality() {
+        new EqualsTester().addEqualityGroup(subnet1, sameAsSubnet1)
+                .addEqualityGroup(subnet2)
+                .testEquals();
+    }
+
+    /**
+     * Test object construction.
+     */
+    @Test
+    public void testConstruction() {
+        FabricSubnet subnet = subnet1;
+
+        assertEquals(subnet.prefix(), IP_PREFIX_1);
+        assertEquals(subnet.gatewayIp(), GATEWAY_IP_1);
+        assertEquals(subnet.gatewayMac(), GATEWAY_MAC_1);
+        assertEquals(subnet.encapsulation(), ENCAP_TYPE_1);
+        assertEquals(subnet.networkName(), NETWORK_NAME_1);
+    }
+}
diff --git a/apps/simplefabric/network-cfg.json b/apps/simplefabric/network-cfg.json
index c8e118b..c7ba9c8 100644
--- a/apps/simplefabric/network-cfg.json
+++ b/apps/simplefabric/network-cfg.json
@@ -1,56 +1,229 @@
 {
-
-  "devices":{
-    "of:0000000000000011":{ "basic":{ "name":"LS1", "latitude":35, "longitude":-100 } },
-    "of:0000000000000012":{ "basic":{ "name":"LS2", "latitude":35, "longitude":-90  } },
-    "of:0000000000000021":{ "basic":{ "name":"SS1", "latitude":40, "longitude":-100 } },
-    "of:0000000000000022":{ "basic":{ "name":"SS2", "latitude":40, "longitude":-90  } }
+  "devices": {
+    "of:0000000000000011": {
+      "basic": {
+        "name": "LS1",
+        "latitude": 35,
+        "longitude": -100
+      }
+    },
+    "of:0000000000000012": {
+      "basic": {
+        "name": "LS2",
+        "latitude": 35,
+        "longitude": -90
+      }
+    },
+    "of:0000000000000021": {
+      "basic": {
+        "name": "SS1",
+        "latitude": 40,
+        "longitude": -100
+      }
+    },
+    "of:0000000000000022": {
+      "basic": {
+        "name": "SS2",
+        "latitude": 40,
+        "longitude": -90
+      }
+    }
   },
-
-  "ports" : {
-    "of:0000000000000011/1" : { "interfaces" : [ { "name" : "h11" } ] },
-    "of:0000000000000011/2" : { "interfaces" : [ { "name" : "h12" } ] },
-    "of:0000000000000011/3" : { "interfaces" : [ { "name" : "h13" } ] },
-    "of:0000000000000011/4" : { "interfaces" : [ { "name" : "h14" } ] },
-    "of:0000000000000011/5" : { "interfaces" : [ { "name" : "d11" } ] },
-    "of:0000000000000011/6" : { "interfaces" : [ { "name" : "d12" } ] },
-    "of:0000000000000011/7" : { "interfaces" : [ { "name" : "LS1_SS1" } ] },
-    "of:0000000000000011/8" : { "interfaces" : [ { "name" : "LS1_SS2" } ] },
-
-    "of:0000000000000012/1" : { "interfaces" : [ { "name" : "h21" } ] } ,
-    "of:0000000000000012/2" : { "interfaces" : [ { "name" : "h22" } ] },
-    "of:0000000000000012/3" : { "interfaces" : [ { "name" : "h23" } ] },
-    "of:0000000000000012/4" : { "interfaces" : [ { "name" : "h24" } ] },
-    "of:0000000000000012/5" : { "interfaces" : [ { "name" : "d21" } ] },
-    "of:0000000000000012/6" : { "interfaces" : [ { "name" : "d22" } ] },
-    "of:0000000000000012/7" : { "interfaces" : [ { "name" : "LS2_SS1" } ] },
-    "of:0000000000000012/8" : { "interfaces" : [ { "name" : "LS2_SS2" } ] },
-
-    "of:0000000000000021/1" : { "interfaces" : [ { "name" : "SS1_LS1" } ] },
-    "of:0000000000000021/2" : { "interfaces" : [ { "name" : "SS1_LS2" } ] },
-
-    "of:0000000000000022/1" : { "interfaces" : [ { "name" : "SS2_LS1" } ] },
-    "of:0000000000000022/2" : { "interfaces" : [ { "name" : "SS2_LS2" } ] }
-
+  "ports": {
+    "of:0000000000000011/1": {
+      "interfaces": [
+        {
+          "name": "h11"
+        }
+      ]
+    },
+    "of:0000000000000011/2": {
+      "interfaces": [
+        {
+          "name": "h12"
+        }
+      ]
+    },
+    "of:0000000000000011/3": {
+      "interfaces": [
+        {
+          "name": "h13"
+        }
+      ]
+    },
+    "of:0000000000000011/4": {
+      "interfaces": [
+        {
+          "name": "h14"
+        }
+      ]
+    },
+    "of:0000000000000011/5": {
+      "interfaces": [
+        {
+          "name": "d11"
+        }
+      ]
+    },
+    "of:0000000000000011/6": {
+      "interfaces": [
+        {
+          "name": "d12"
+        }
+      ]
+    },
+    "of:0000000000000011/7": {
+      "interfaces": [
+        {
+          "name": "LS1_SS1"
+        }
+      ]
+    },
+    "of:0000000000000011/8": {
+      "interfaces": [
+        {
+          "name": "LS1_SS2"
+        }
+      ]
+    },
+    "of:0000000000000012/1": {
+      "interfaces": [
+        {
+          "name": "h21"
+        }
+      ]
+    },
+    "of:0000000000000012/2": {
+      "interfaces": [
+        {
+          "name": "h22"
+        }
+      ]
+    },
+    "of:0000000000000012/3": {
+      "interfaces": [
+        {
+          "name": "h23"
+        }
+      ]
+    },
+    "of:0000000000000012/4": {
+      "interfaces": [
+        {
+          "name": "h24"
+        }
+      ]
+    },
+    "of:0000000000000012/5": {
+      "interfaces": [
+        {
+          "name": "d21"
+        }
+      ]
+    },
+    "of:0000000000000012/6": {
+      "interfaces": [
+        {
+          "name": "d22"
+        }
+      ]
+    },
+    "of:0000000000000012/7": {
+      "interfaces": [
+        {
+          "name": "LS2_SS1"
+        }
+      ]
+    },
+    "of:0000000000000012/8": {
+      "interfaces": [
+        {
+          "name": "LS2_SS2"
+        }
+      ]
+    },
+    "of:0000000000000021/1": {
+      "interfaces": [
+        {
+          "name": "SS1_LS1"
+        }
+      ]
+    },
+    "of:0000000000000021/2": {
+      "interfaces": [
+        {
+          "name": "SS1_LS2"
+        }
+      ]
+    },
+    "of:0000000000000022/1": {
+      "interfaces": [
+        {
+          "name": "SS2_LS1"
+        }
+      ]
+    },
+    "of:0000000000000022/2": {
+      "interfaces": [
+        {
+          "name": "SS2_LS2"
+        }
+      ]
+    }
   },
-
-  "apps" : {
-    "org.onosproject.simplefabric" : {
-      "simpleFabric" : {
-        "l2Networks" : [
-          { "name" : "LEAF1", "interfaces" : ["h11", "h12", "h13", "h14", "d11", "d12" ], "l2Forward" : true, "l2Broadcast" : true },
-          { "name" : "LEAF2", "interfaces" : ["h21", "h22", "h23", "h24", "d21", "d22" ], "l2Forward" : true, "l2Broadcast" : true }
+  "apps": {
+    "org.onosproject.simplefabric": {
+      "simpleFabric": {
+        "fabricNetworks": [
+          {
+            "name": "LEAF1",
+            "interfaces": [
+              "h11",
+              "h12",
+              "h13",
+              "h14",
+              "d11",
+              "d12"
+            ],
+            "isForward": true,
+            "isBroadcast": true
+          },
+          {
+            "name": "LEAF2",
+            "interfaces": [
+              "h21",
+              "h22",
+              "h23",
+              "h24",
+              "d21",
+              "d22"
+            ],
+            "isForward": true,
+            "isBroadcast": true
+          }
         ],
-        "ipSubnets" : [
-           { "ipPrefix" : "10.0.1.0/24", "gatewayIp" : "10.0.1.1", "gatewayMac" : "00:00:10:00:01:01", "l2NetworkName" : "LEAF1" },
-           { "ipPrefix" : "10.0.2.0/24", "gatewayIp" : "10.0.2.1", "gatewayMac" : "00:00:10:00:02:01", "l2NetworkName" : "LEAF2" }
+        "fabricSubnets": [
+          {
+            "prefix": "10.0.1.0/24",
+            "gatewayIp": "10.0.1.1",
+            "gatewayMac": "00:00:10:00:01:01",
+            "networkName": "LEAF1"
+          },
+          {
+            "prefix": "10.0.2.0/24",
+            "gatewayIp": "10.0.2.1",
+            "gatewayMac": "00:00:10:00:02:01",
+            "networkName": "LEAF2"
+          }
         ],
-        "borderRoutes" : [
-           { "ipPrefix" : "0.0.0.0/0", "nextHop" : "10.0.1.2" }
+        "fabricRoutes": [
+          {
+            "prefix": "0.0.0.0/0",
+            "nextHop": "10.0.1.2"
+          }
         ]
       }
     }
   }
-
 }
 
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/IpSubnet.java b/apps/simplefabric/src/main/java/org/onosproject/simplefabric/IpSubnet.java
deleted file mode 100644
index 596c659..0000000
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/IpSubnet.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright 2017-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.simplefabric;
-
-import com.google.common.base.MoreObjects;
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
-import org.onlab.packet.MacAddress;
-import org.onosproject.net.EncapsulationType;
-
-import java.util.Objects;
-
-/**
- * Configuration details for an ip subnet entry.
- */
-public class IpSubnet {
-    private final IpPrefix ipPrefix;
-    private final IpAddress gatewayIp;
-    private final MacAddress gatewayMac;
-    private EncapsulationType encapsulation;
-    private final String l2NetworkName;
-
-    /**
-     * Creates a new ip subnet entry.
-     *
-     * @param ipPrefix  an ip subnet
-     * @param gatewayIp IP of the virtual gateway
-     * @param gatewayMac MacAddress of the virtual gateway
-     * @param encapsulation EnacaptulatioType for routes related to this subnet
-     * @param l2NetworkName Name of L2 Network this subnet is bound
-     */
-    public IpSubnet(IpPrefix ipPrefix, IpAddress gatewayIp, MacAddress gatewayMac,
-                    EncapsulationType encapsulation, String l2NetworkName) {
-        this.ipPrefix = ipPrefix;
-        this.gatewayIp = gatewayIp;
-        this.gatewayMac = gatewayMac;
-        this.encapsulation = EncapsulationType.NONE;
-        this.l2NetworkName = l2NetworkName;
-    }
-
-    /**
-     * Gets the ip subnet of the ip subnet entry.
-     *
-     * @return the ip subnet
-     */
-    public IpPrefix ipPrefix() {
-        return ipPrefix;
-    }
-
-    /**
-     * Gets the virtual gateway IP address of the ip subnet entry.
-     *
-     * @return the virtual gateway IP address
-     */
-    public IpAddress gatewayIp() {
-        return gatewayIp;
-    }
-
-    /**
-     * Gets the virtual gateway Mac address of the ip subnet entry.
-     *
-     * @return the virtuai gateway Mac address
-     */
-    public MacAddress gatewayMac() {
-        return gatewayMac;
-    }
-
-    /**
-     * Gets the encapsulation type of ip subnet entry.
-     *
-     * @return the encapsulation type
-     */
-    public EncapsulationType encapsulation() {
-        return encapsulation;
-    }
-
-    /**
-     * Gets the name of L2 Network this subnet is bound.
-     *
-     * @return the l2Network name this subnet is allocated
-     */
-    public String l2NetworkName() {
-        return l2NetworkName;
-    }
-
-    /**
-     * Tests whether the IP version of this entry is IPv4.
-     *
-     * @return true if the IP version of this entry is IPv4, otherwise false.
-     */
-    public boolean isIp4() {
-        return ipPrefix.isIp4();
-    }
-
-    /**
-     * Tests whether the IP version of this entry is IPv6.
-     *
-     * @return true if the IP version of this entry is IPv6, otherwise false.
-     */
-    public boolean isIp6() {
-        return ipPrefix.isIp6();
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(ipPrefix, gatewayIp, gatewayMac, encapsulation, l2NetworkName);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == this) {
-            return true;
-        }
-        if (!(obj instanceof IpSubnet)) {
-            return false;
-        }
-        IpSubnet that = (IpSubnet) obj;
-        return Objects.equals(this.ipPrefix, that.ipPrefix)
-               && Objects.equals(this.gatewayIp, that.gatewayIp)
-               && Objects.equals(this.gatewayMac, that.gatewayMac)
-               && Objects.equals(this.encapsulation, that.encapsulation)
-               && Objects.equals(this.l2NetworkName, that.l2NetworkName);
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(getClass())
-                .add("ipPrefix", ipPrefix)
-                .add("gatewayIp", gatewayIp)
-                .add("gatewayMac", gatewayMac)
-                .add("encapsulation", encapsulation)
-                .add("l2NetworkName", l2NetworkName)
-                .toString();
-    }
-}
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/L2Network.java b/apps/simplefabric/src/main/java/org/onosproject/simplefabric/L2Network.java
deleted file mode 100644
index 5579159..0000000
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/L2Network.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Copyright 2017-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.simplefabric;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-import org.onlab.packet.VlanId;
-import org.onosproject.net.intf.Interface;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.Host;
-import org.onosproject.net.HostId;
-import org.onosproject.net.EncapsulationType;
-
-import java.util.Collection;
-import java.util.Objects;
-import java.util.Set;
-
-
-/**
- * Class stores a L2Network information.
- */
-public final class L2Network {
-
-    private String name;                  // also for network configuration
-    private Set<String> interfaceNames;   // also for network configuration
-    private EncapsulationType encapsulation;  // also for network configuration
-    private boolean l2Forward;            // do l2Forward (default:true) or not
-    private boolean l2Broadcast;          // do l2Broadcast (default:true) or not
-
-    /* status variables */
-    private Set<Interface> interfaces;    // available interfaces from interfaceNames
-    private Set<HostId> hostIds;          // available hosts from interfaces
-    private boolean dirty;
-
-    /**
-     * Constructs a L2Network data for Config value.
-     *
-     * @param name the given name
-     * @param ifaceNames the interface names
-     * @param encapsulation the encapsulation type
-     * @param l2Forward flag for l2Forward intents to be installed or not
-     * @param l2Broadcast flag for l2Broadcast intents to be installed or not
-     */
-    L2Network(String name, Collection<String> ifaceNames, EncapsulationType encapsulation,
-              boolean l2Forward, boolean l2Broadcast) {
-        this.name = name;
-        this.interfaceNames = Sets.newHashSet();
-        this.interfaceNames.addAll(ifaceNames);
-        this.encapsulation = encapsulation;
-        this.l2Forward = (SimpleFabricService.ALLOW_ETH_ADDRESS_SELECTOR) ? l2Forward : false;
-        this.l2Broadcast = (SimpleFabricService.ALLOW_ETH_ADDRESS_SELECTOR) ? l2Broadcast : false;
-        this.interfaces = Sets.newHashSet();
-        this.hostIds = Sets.newHashSet();
-        this.dirty = false;
-    }
-
-    /**
-     * Constructs a L2Network data by given name and encapsulation type.
-     *
-     * @param name the given name
-     * @param encapsulation the encapsulation type
-     */
-    private L2Network(String name, EncapsulationType encapsulation) {
-        this.name = name;
-        this.interfaceNames = Sets.newHashSet();
-        this.encapsulation = encapsulation;
-        this.l2Forward = (SimpleFabricService.ALLOW_ETH_ADDRESS_SELECTOR) ? true : false;
-        this.l2Broadcast = (SimpleFabricService.ALLOW_ETH_ADDRESS_SELECTOR) ? true : false;
-        this.interfaces = Sets.newHashSet();
-        this.hostIds = Sets.newHashSet();
-        this.dirty = false;
-    }
-
-    /**
-     * Creates a L2Network data by given name.
-     * The encapsulation type of the L2Network will be NONE.
-     *
-     * @param name the given name
-     * @return the L2Network data
-     */
-    public static L2Network of(String name) {
-        Objects.requireNonNull(name);
-        return new L2Network(name, EncapsulationType.NONE);
-    }
-
-    /**
-     * Creates a copy of L2Network data.
-     *
-     * @param l2Network the L2Network data
-     * @return the copy of the L2Network data
-     */
-    public static L2Network of(L2Network l2Network) {
-        Objects.requireNonNull(l2Network);
-        L2Network l2NetworkCopy = new L2Network(l2Network.name(), l2Network.encapsulation());
-        l2NetworkCopy.interfaceNames.addAll(l2Network.interfaceNames());
-        l2NetworkCopy.l2Forward = (SimpleFabricService.ALLOW_ETH_ADDRESS_SELECTOR) ? l2Network.l2Forward() : false;
-        l2NetworkCopy.l2Broadcast = (SimpleFabricService.ALLOW_ETH_ADDRESS_SELECTOR) ? l2Network.l2Broadcast() : false;
-        l2NetworkCopy.interfaces.addAll(l2Network.interfaces());
-        l2NetworkCopy.hostIds.addAll(l2Network.hostIds());
-        l2NetworkCopy.setDirty(l2Network.dirty());
-        return l2NetworkCopy;
-    }
-
-    // field queries
-
-    /**
-     * Gets L2Network name.
-     *
-     * @return the name of L2Network
-     */
-    public String name() {
-        return name;
-    }
-
-    /**
-     * Gets L2Network interfaceNames.
-     *
-     * @return the interfaceNames of L2Network
-     */
-    public Set<String> interfaceNames() {
-        return ImmutableSet.copyOf(interfaceNames);
-    }
-
-    /**
-     * Gets L2Network encapsulation type.
-     *
-     * @return the encapsulation type of L2Network
-     */
-    public EncapsulationType encapsulation() {
-        return encapsulation;
-    }
-
-    /**
-     * Gets L2Network l2Forward flag.
-     *
-     * @return the l2Forward flag of L2Network
-     */
-    public boolean l2Forward() {
-        return l2Forward;
-    }
-
-    /**
-     * Gets L2Network l2Broadcast flag.
-     *
-     * @return the l2Broadcast flag of L2Network
-     */
-    public boolean l2Broadcast() {
-        return l2Broadcast;
-    }
-
-    /**
-     * Gets L2Network interfaces.
-     *
-     * @return the interfaces of L2Network
-     */
-    public Set<Interface> interfaces() {
-        return ImmutableSet.copyOf(interfaces);
-    }
-
-    /**
-     * Gets L2Network hosts.
-     *
-     * @return the hosts of L2Network
-     */
-    public Set<HostId> hostIds() {
-        return ImmutableSet.copyOf(hostIds);
-    }
-
-    /**
-     * Gets L2Network dirty flag.
-     *
-     * @return the dirty flag of L2Network
-     */
-    public boolean dirty() {
-        return dirty;
-    }
-
-    /**
-     * Checks if the interface is of L2Network.
-     *
-     * @param iface the interface to be checked
-     * @return true if L2Network contains the interface
-     */
-    public boolean contains(Interface iface) {
-        return interfaces.contains(iface);
-    }
-
-    /**
-     * Checks if the ConnectPoint and Vlan is of L2Network.
-     *
-     * @param port the ConnectPoint to be checked
-     * @param vlanId the VlanId of the ConnectPoint to be checked
-     * @return true if L2Network contains the interface of the ConnnectPoint and VlanId
-     */
-    public boolean contains(ConnectPoint port, VlanId vlanId) {
-        for (Interface iface : interfaces) {
-            if (iface.connectPoint().equals(port) && iface.vlan().equals(vlanId)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Checks if the DeviceId is of L2Network.
-     *
-     * @param deviceId the DeviceId to be checked
-     * @return true if L2Network contains any interface of the DeviceId
-     */
-    public boolean contains(DeviceId deviceId) {
-        for (Interface iface : interfaces) {
-            if (iface.connectPoint().deviceId().equals(deviceId)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Adds interface to L2Network.
-     *
-     * @param iface the Interface to be added
-     */
-    public void addInterface(Interface iface) {
-        Objects.requireNonNull(iface);
-        if (interfaces.add(iface)) {
-            setDirty(true);
-        }
-    }
-
-    /**
-     * Adds host to L2Network.
-     *
-     * @param host the Host to be added
-     */
-    public void addHost(Host host) {
-        Objects.requireNonNull(host);
-        if (hostIds.add(host.id())) {
-            setDirty(true);
-        }
-    }
-
-    /**
-     * Sets L2Network dirty flag.
-     *
-     * @param newDirty the dirty flag to be set
-     */
-    public void setDirty(boolean newDirty) {
-        dirty = newDirty;
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(getClass())
-                .add("name", name)
-                .add("interfaceNames", interfaceNames)
-                .add("encapsulation", encapsulation)
-                .add("l2Forward", l2Forward)
-                .add("l2Broadcast", l2Broadcast)
-                .add("interfaces", interfaces)
-                .add("hostIds", hostIds)
-                .add("dirty", dirty)
-                .toString();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == this) {
-            return true;
-        }
-        if (!(obj instanceof L2Network)) {
-            return false;
-        }
-        L2Network other = (L2Network) obj;
-        return Objects.equals(other.name, this.name)
-               && Objects.equals(other.interfaceNames, this.interfaceNames)
-               && Objects.equals(other.encapsulation, this.encapsulation)
-               && Objects.equals(other.l2Forward, this.l2Forward)
-               && Objects.equals(other.l2Broadcast, this.l2Broadcast)
-               && Objects.equals(other.interfaces, this.interfaces)
-               && Objects.equals(other.hostIds, this.hostIds);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(name, interfaces, encapsulation, l2Forward, l2Broadcast);
-    }
-}
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/Route.java b/apps/simplefabric/src/main/java/org/onosproject/simplefabric/Route.java
deleted file mode 100644
index 8eabb95..0000000
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/Route.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * 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.
- */
-/*
- * local copy of onos/incubator/api/src/main/java/org/onosproject/incubator/net/routing/Route.java
- * to remove dependency on onos.incubator.routing services, since 2017-08-09.
- */
-
-package org.onosproject.simplefabric;
-
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
-import org.onosproject.cluster.NodeId;
-
-import java.util.Objects;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Represents a route.
- */
-public class Route {
-
-    private static final String VERSION_MISMATCH =
-            "Prefix and next hop must be in the same address family";
-
-    private static final NodeId UNDEFINED = new NodeId("-");
-
-    /**
-     * Source of the route.
-     */
-    public enum Source {
-        /**
-         * Route came from the iBGP route source.
-         */
-        BGP,
-
-        /**
-         * Route came from the FPM route source.
-         */
-        FPM,
-
-        /**
-         * Route can from the static route source.
-         */
-        STATIC,
-
-        /**
-         * Route source was not defined.
-         */
-        UNDEFINED
-    }
-
-    private final Source source;
-    private final IpPrefix prefix;
-    private final IpAddress nextHop;
-    private final NodeId sourceNode;
-
-    /**
-     * Creates a route.
-     *
-     * @param source route source
-     * @param prefix IP prefix
-     * @param nextHop next hop IP address
-     */
-    public Route(Source source, IpPrefix prefix, IpAddress nextHop) {
-        this(source, prefix, nextHop, UNDEFINED);
-    }
-
-    /**
-     * Creates a route.
-     *
-     * @param source route source
-     * @param prefix IP prefix
-     * @param nextHop next hop IP address
-     * @param sourceNode ONOS node the route was sourced from
-     */
-    public Route(Source source, IpPrefix prefix, IpAddress nextHop, NodeId sourceNode) {
-        checkNotNull(prefix);
-        checkNotNull(nextHop);
-        checkArgument(prefix.version().equals(nextHop.version()), VERSION_MISMATCH);
-
-        this.source = checkNotNull(source);
-        this.prefix = prefix;
-        this.nextHop = nextHop;
-        this.sourceNode = checkNotNull(sourceNode);
-    }
-
-    /**
-     * Returns the route source.
-     *
-     * @return route source
-     */
-    public Source source() {
-        return source;
-    }
-
-    /**
-     * Returns the IP prefix of the route.
-     *
-     * @return IP prefix
-     */
-    public IpPrefix prefix() {
-        return prefix;
-    }
-
-    /**
-     * Returns the next hop IP address.
-     *
-     * @return next hop
-     */
-    public IpAddress nextHop() {
-        return nextHop;
-    }
-
-    /**
-     * Returns the ONOS node the route was sourced from.
-     *
-     * @return ONOS node ID
-     */
-    public NodeId sourceNode() {
-        return sourceNode;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(prefix, nextHop);
-    }
-
-    @Override
-    public boolean equals(Object other) {
-        if (this == other) {
-            return true;
-        }
-
-        if (!(other instanceof Route)) {
-            return false;
-        }
-
-        Route that = (Route) other;
-
-        return Objects.equals(this.prefix, that.prefix) &&
-                Objects.equals(this.nextHop, that.nextHop);
-    }
-
-    @Override
-    public String toString() {
-        return toStringHelper(this)
-                .add("prefix", prefix)
-                .add("nextHop", nextHop)
-                .toString();
-    }
-}
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricConfig.java b/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricConfig.java
deleted file mode 100644
index 7bae152..0000000
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricConfig.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright 2017-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.simplefabric;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.google.common.collect.Sets;
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
-import org.onlab.packet.MacAddress;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.net.config.Config;
-import org.onosproject.net.EncapsulationType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Set;
-
-/**
- * Configuration object for prefix config.
- */
-public class SimpleFabricConfig extends Config<ApplicationId> {
-    public static final String KEY = "simpleFabric";
-
-    private static final String L2NETWORKS = "l2Networks";
-    private static final String NAME = "name";
-    private static final String INTERFACES = "interfaces";
-    private static final String ENCAPSULATION = "encapsulation";
-    private static final String L2FORWARD = "l2Forward";
-    private static final String L2BROADCAST = "l2Broadcast";
-    private static final String IPSUBNETS = "ipSubnets";
-    private static final String BORDERROUTES = "borderRoutes";
-    private static final String IPPREFIX = "ipPrefix";
-    private static final String GATEWAYIP = "gatewayIp";
-    private static final String GATEWAYMAC = "gatewayMac";
-    private static final String L2NETWORKNAME = "l2NetworkName";
-    private static final String NEXTHOP = "nextHop";
-
-    private final Logger log = LoggerFactory.getLogger(getClass());
-
-    /**
-     * Returns all l2Networks in this configuration.
-     *
-     * @return A set of L2Network.
-     */
-    public Set<L2Network> getL2Networks() {
-        Set<L2Network> l2Networks = Sets.newHashSet();
-        JsonNode l2NetworkNode = object.get(L2NETWORKS);
-        if (l2NetworkNode == null) {
-            return l2Networks;
-        }
-
-        l2NetworkNode.forEach(jsonNode -> {
-            Set<String> ifaces = Sets.newHashSet();
-            JsonNode l2NetworkIfaces = jsonNode.path(INTERFACES);
-            if (l2NetworkIfaces == null) {
-                log.warn("simple fabric network config cannot find {}; skip: jsonNode={}", INTERFACES, jsonNode);
-            } else if (!l2NetworkIfaces.toString().isEmpty()) {
-                l2NetworkIfaces.forEach(ifacesNode -> ifaces.add(new String(ifacesNode.asText())));
-            }
-            String encapsulation = "NONE";   // NONE or VLAN
-            if (jsonNode.hasNonNull(ENCAPSULATION)) {
-                encapsulation = jsonNode.get(ENCAPSULATION).asText();
-            }
-            boolean l2Forward = true;
-            if (jsonNode.hasNonNull(L2FORWARD)) {
-                l2Forward = jsonNode.get(L2FORWARD).asBoolean();
-            }
-            boolean l2Broadcast = true;
-            if (jsonNode.hasNonNull(L2BROADCAST)) {
-                l2Broadcast = jsonNode.get(L2BROADCAST).asBoolean();
-            }
-            try {
-                l2Networks.add(new L2Network(
-                        jsonNode.get(NAME).asText(), ifaces, EncapsulationType.enumFromString(encapsulation),
-                        l2Forward, l2Broadcast));
-            } catch (Exception e) {
-                log.warn("simple fabric network config l2Network parse failed; skip: error={} jsonNode={}", jsonNode);
-            }
-        });
-        return l2Networks;
-    }
-
-    /**
-     * Gets the set of configured local IP subnets.
-     *
-     * @return IP Subnets
-     */
-    public Set<IpSubnet> ipSubnets() {
-        Set<IpSubnet> subnets = Sets.newHashSet();
-        JsonNode subnetsNode = object.get(IPSUBNETS);
-        if (subnetsNode == null) {
-            log.warn("simple fabric network config ipSubnets is null!");
-            return subnets;
-        }
-
-        subnetsNode.forEach(jsonNode -> {
-            String encapsulation = "NONE";   // NONE or VLAN
-            if (jsonNode.hasNonNull(ENCAPSULATION)) {
-                encapsulation = jsonNode.get(ENCAPSULATION).asText();
-            }
-            try {
-                subnets.add(new IpSubnet(
-                        IpPrefix.valueOf(jsonNode.get(IPPREFIX).asText()),
-                        IpAddress.valueOf(jsonNode.get(GATEWAYIP).asText()),
-                        MacAddress.valueOf(jsonNode.get(GATEWAYMAC).asText()),
-                        EncapsulationType.enumFromString(encapsulation),
-                        jsonNode.get(L2NETWORKNAME).asText()));
-            } catch (Exception e) {
-                log.warn("simple fabric network config ipSubnet parse failed; skip: error={} jsonNode={}", jsonNode);
-            }
-        });
-
-        return subnets;
-    }
-
-    /**
-     * Returns all routes in this configuration.
-     *
-     * @return A set of route.
-     */
-    public Set<Route> borderRoutes() {
-        Set<Route> routes = Sets.newHashSet();
-
-        JsonNode routesNode = object.get(BORDERROUTES);
-        if (routesNode == null) {
-            //log.warn("simple fabric network config borderRoutes is null!");
-            return routes;
-        }
-
-        routesNode.forEach(jsonNode -> {
-            try {
-                routes.add(new Route(
-                      Route.Source.STATIC,
-                      IpPrefix.valueOf(jsonNode.path(IPPREFIX).asText()),
-                      IpAddress.valueOf(jsonNode.path(NEXTHOP).asText())));
-            } catch (IllegalArgumentException e) {
-                log.warn("simple fabric network config parse error; skip: {}", jsonNode);
-            }
-        });
-
-        return routes;
-    }
-
-}
diff --git a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricService.java b/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricService.java
deleted file mode 100644
index be2bed3..0000000
--- a/apps/simplefabric/src/main/java/org/onosproject/simplefabric/SimpleFabricService.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright 2017-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.simplefabric;
-
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.VlanId;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.event.ListenerService;
-import org.onosproject.net.intf.Interface;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.Host;
-
-import java.io.OutputStream;
-import java.util.Set;
-import java.util.Collection;
-
-/**
- * Provides information about the routing configuration.
- */
-public interface SimpleFabricService
-        extends ListenerService<SimpleFabricEvent, SimpleFabricListener> {
-
-    // App symbols
-    static final String APP_ID = "org.onosproject.simplefabric";
-    static final String L2FORWARD_APP_ID = "org.onosproject.simplefabric.l2forward";
-    static final String REACTIVE_APP_ID = "org.onosproject.simplefabric.reactive";
-
-    // Priority for l2NetworkRouting: L2NETWORK_UNICAST or L2NETWORK_BROADCAST
-    static final int PRI_L2NETWORK_UNICAST = 601;
-    static final int PRI_L2NETWORK_BROADCAST = 600;
-
-    // Reactive Routing within Local Subnets
-    // ASSUME: local subnets NEVER overlaps each other
-    static final int PRI_REACTIVE_LOCAL_FORWARD = 501;
-    static final int PRI_REACTIVE_LOCAL_INTERCEPT = 500;
-    // Reactive Routing for Border Routes with local subnet
-    // Priority: REACTIVE_BROUTE_BASE + routeIpPrefix * REACTIVE_BROUTE_STEP
-    //           + REACTIVE_BROUTE_FORWARD or REACTIVE_BROUTE_INTERCEPT
-    static final int PRI_REACTIVE_BORDER_BASE = 100;
-    static final int PRI_REACTIVE_BORDER_STEP = 2;
-    static final int PRI_REACTIVE_BORDER_FORWARD = 1;
-    static final int PRI_REACTIVE_BORDER_INTERCEPT = 0;
-
-    // Simple fabric event related timers
-    static final long IDLE_INTERVAL_MSEC = 5000;
-
-    // Feature control parameters
-    static final boolean ALLOW_IPV6 = false;
-    static final boolean ALLOW_ETH_ADDRESS_SELECTOR = true;
-    static final boolean REACTIVE_SINGLE_TO_SINGLE = false;
-    static final boolean REACTIVE_ALLOW_LINK_CP = false;  // MUST BE false (yjlee, 2017-10-18)
-    static final boolean REACTIVE_HASHED_PATH_SELECTION = false;
-    static final boolean REACTIVE_MATCH_IP_PROTO = false;
-
-    /**
-     * Gets appId.
-     *
-     * @return appId of simple fabric app
-     */
-    ApplicationId getAppId();
-
-    /**
-     * Gets all the l2Networks.
-     *
-     * @return all the l2Networks
-     */
-    Collection<L2Network> getL2Networks();
-
-    /**
-     * Retrieves the entire set of ipSubnets configuration.
-     *
-     * @return all the ipSubnets
-     */
-    Set<IpSubnet> getIpSubnets();
-
-    /**
-     * Retrieves the entire set of static routes to outer networks.
-     *
-     * @return the set of static routes to outer networks.
-     */
-    Set<Route> getBorderRoutes();
-
-    /**
-     * Evaluates whether a mac is of Virtual Gateway Mac Addresses.
-     *
-     * @param mac the MacAddress to evaluate
-     * @return true if the mac is of any Vitrual Gateway Mac Address of ipSubnets
-     */
-    boolean isVMac(MacAddress mac);
-
-    /**
-     * Evaluates whether an Interface belongs to l2Networks.
-     *
-     * @param intf the interface to evaluate
-     * @return true if the inteface belongs to l2Networks configed, otherwise false
-     */
-    boolean isL2NetworkInterface(Interface intf);
-
-    /**
-     * Find Virtual Gateway Mac Address for Local Subnet Virtual Gateway Ip.
-     *
-     * @param ip the ip to check for Virtual Gateway Ip
-     * @return mac address of virtual gateway
-     */
-    MacAddress findVMacForIp(IpAddress ip);
-
-    /**
-     * Finds the L2 Network with given port and vlanId.
-     *
-     * @param port the port to be matched
-     * @param vlanId the vlanId to be matched
-     * @return the L2 Network for specific port and vlanId or null
-     */
-    L2Network findL2Network(ConnectPoint port, VlanId vlanId);
-
-    /**
-     * Finds the L2 Network of the name.
-     *
-     * @param name the name to be matched
-     * @return the L2 Network for specific name
-     */
-    L2Network findL2Network(String name);
-
-    /**
-     * Finds the IpSubnet containing the ipAddress.
-     *
-     * @param ipAddress the ipAddress to be matched
-     * @return the IpSubnet for specific ipAddress
-     */
-    IpSubnet findIpSubnet(IpAddress ipAddress);
-
-    /**
-     * Finds the Border Route containing the ipAddress.
-     * ASSUME: ipAddress is out of ipSubnets
-     *
-     * @param ipAddress the ipAddress to be matched
-     * @return the IpSubnet for specific ipAddress
-     */
-    Route findBorderRoute(IpAddress ipAddress);
-
-    /**
-     * Finds the network interface related to the host.
-     *
-     * @param host the host
-     * @return the interface related to the host
-     */
-    Interface findHostInterface(Host host);
-
-    /**
-     * Sends Neighbour Query (ARP or NDP) to Find Host Location.
-     *
-     * @param ip the ip address to resolve
-     * @return true if request mac packets are emitted. otherwise false
-     */
-    boolean requestMac(IpAddress ip);
-
-    /**
-     * Sends Dump Event to all SimpleFabricListeners to Dump Info on the Subject.
-     *
-     * @param subject the subject to dump
-     * @param out the output stream to dump
-     */
-    void dumpToStream(String subject, OutputStream out);
-
-    /**
-     * Triggers to send Refresh Notification to all sub modules.
-     */
-    void triggerRefresh();
-
-    /**
-     * Triggers to send Flush Notification to all sub modules.
-     */
-    void triggerFlush();
-
-}
