diff --git a/src/main/java/org/opencord/cordvtn/api/core/CordVtnAdminService.java b/src/main/java/org/opencord/cordvtn/api/core/CordVtnAdminService.java
index fbe743b..2411628 100644
--- a/src/main/java/org/opencord/cordvtn/api/core/CordVtnAdminService.java
+++ b/src/main/java/org/opencord/cordvtn/api/core/CordVtnAdminService.java
@@ -34,6 +34,16 @@
         ServiceNetworkService {
 
     /**
+     * Purges internal network states.
+     */
+    void purgeStates();
+
+    /**
+     * Synchronizes internal network states with external services.
+     */
+    void syncStates();
+
+    /**
      * Creates a service port with the given information.
      *
      * @param servicePort the new service port
diff --git a/src/main/java/org/opencord/cordvtn/api/core/CordVtnStore.java b/src/main/java/org/opencord/cordvtn/api/core/CordVtnStore.java
index 200358a..78a60a4 100644
--- a/src/main/java/org/opencord/cordvtn/api/core/CordVtnStore.java
+++ b/src/main/java/org/opencord/cordvtn/api/core/CordVtnStore.java
@@ -34,6 +34,11 @@
 public interface CordVtnStore extends Store<VtnNetworkEvent, CordVtnStoreDelegate> {
 
     /**
+     * Purges vtn store.
+     */
+    void clear();
+
+    /**
      * Creates vtn network.
      *
      * @param vtnNet vtn network
diff --git a/src/main/java/org/opencord/cordvtn/impl/CordVtnManager.java b/src/main/java/org/opencord/cordvtn/impl/CordVtnManager.java
index 43cf3d8..a74635f 100644
--- a/src/main/java/org/opencord/cordvtn/impl/CordVtnManager.java
+++ b/src/main/java/org/opencord/cordvtn/impl/CordVtnManager.java
@@ -22,10 +22,17 @@
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.ReferenceCardinality;
 import org.apache.felix.scr.annotations.Service;
+import org.onosproject.core.ApplicationId;
+import org.onosproject.core.CoreService;
 import org.onosproject.event.ListenerRegistry;
 import org.onosproject.net.Host;
 import org.onosproject.net.HostId;
+import org.onosproject.net.config.NetworkConfigService;
 import org.onosproject.net.host.HostService;
+import org.opencord.cordvtn.api.Constants;
+import org.opencord.cordvtn.api.config.CordVtnConfig;
+import org.opencord.cordvtn.api.config.OpenStackConfig;
+import org.opencord.cordvtn.api.config.XosConfig;
 import org.opencord.cordvtn.api.core.CordVtnAdminService;
 import org.opencord.cordvtn.api.core.CordVtnService;
 import org.opencord.cordvtn.api.core.CordVtnStore;
@@ -42,6 +49,8 @@
 import org.opencord.cordvtn.api.net.VtnNetworkEvent;
 import org.opencord.cordvtn.api.net.VtnNetworkListener;
 import org.opencord.cordvtn.api.net.VtnPort;
+import org.opencord.cordvtn.impl.external.OpenStackNetworking;
+import org.opencord.cordvtn.impl.external.XosServiceNetworking;
 import org.openstack4j.model.network.Network;
 import org.openstack4j.model.network.Port;
 import org.openstack4j.model.network.Subnet;
@@ -96,15 +105,23 @@
     private static final String PROVIDER = "provider ";
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected NetworkConfigService configService;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected CoreService coreService;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
     protected HostService hostService;
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
     protected CordVtnStore store;
 
-    private CordVtnStoreDelegate delegate = new InternalCordVtnStoreDelegate();
+    private final CordVtnStoreDelegate delegate = new InternalCordVtnStoreDelegate();
+    private ApplicationId appId;
 
     @Activate
     protected void activate() {
+        appId = coreService.registerApplication(Constants.CORDVTN_APP_ID);
         store.setDelegate(delegate);
         log.info("Started");
     }
@@ -116,6 +133,17 @@
     }
 
     @Override
+    public void purgeStates() {
+        store.clear();
+    }
+
+    @Override
+    public void syncStates() {
+        syncNetwork();
+        syncServiceNetwork();
+    }
+
+    @Override
     public void createServiceNetwork(ServiceNetwork serviceNet) {
         checkNotNull(serviceNet, ERR_NULL_SERVICE_NET);
         synchronized (this) {
@@ -407,6 +435,44 @@
         return store.subnets();
     }
 
+    private void syncNetwork() {
+        CordVtnConfig config = configService.getConfig(appId, CordVtnConfig.class);
+        if (config == null) {
+            final String error = "Failed to read network configurations";
+            throw new IllegalArgumentException(error);
+        }
+
+        OpenStackConfig osConfig = config.openStackConfig();
+        NetworkService netService = OpenStackNetworking.builder()
+                .endpoint(osConfig.endpoint())
+                .tenant(osConfig.tenant())
+                .user(osConfig.user())
+                .password(osConfig.password())
+                .build();
+
+        netService.networks().forEach(this::createNetwork);
+        netService.subnets().forEach(this::createSubnet);
+        netService.ports().forEach(this::createPort);
+    }
+
+    private void syncServiceNetwork() {
+        CordVtnConfig config = configService.getConfig(appId, CordVtnConfig.class);
+        if (config == null) {
+            final String error = "Failed to read network configurations";
+            throw new IllegalArgumentException(error);
+        }
+
+        XosConfig xosConfig = config.xosConfig();
+        ServiceNetworkService snetService = XosServiceNetworking.builder()
+                .endpoint(xosConfig.endpoint())
+                .user(xosConfig.user())
+                .password(xosConfig.password())
+                .build();
+
+        snetService.serviceNetworks().forEach(this::createServiceNetwork);
+        snetService.servicePorts().forEach(this::createServicePort);
+    }
+
     private Instance getInstance(PortId portId) {
         VtnPort vtnPort = vtnPort(portId);
         if (vtnPort == null) {
diff --git a/src/main/java/org/opencord/cordvtn/impl/DistributedCordVtnStore.java b/src/main/java/org/opencord/cordvtn/impl/DistributedCordVtnStore.java
index 6846b6f..0d69369 100644
--- a/src/main/java/org/opencord/cordvtn/impl/DistributedCordVtnStore.java
+++ b/src/main/java/org/opencord/cordvtn/impl/DistributedCordVtnStore.java
@@ -187,6 +187,17 @@
     }
 
     @Override
+    public void clear() {
+        synchronized (this) {
+            vtnNetworkStore.clear();
+            vtnPortStore.clear();
+            networkStore.clear();
+            portStore.clear();
+            subnetStore.clear();
+        }
+    }
+
+    @Override
     public void createVtnNetwork(VtnNetwork vtnNet) {
         vtnNetworkStore.compute(vtnNet.id(), (id, existing) -> {
             final String error = ERR_SYNC + vtnNet.id().id() + ERR_DUPLICATE;
