diff --git a/apps/fpcagent/fpcagent.json b/apps/fpcagent/fpcagent.json
index a54290a..6b26cbf 100644
--- a/apps/fpcagent/fpcagent.json
+++ b/apps/fpcagent/fpcagent.json
@@ -2,8 +2,8 @@
   "apps": {
     "org.onosproject.fpcagent": {
       "fpcagent": {
-        "dpn-subscriber-uri": "tcp://*:5560",
-        "dpn-publisher-uri": "tcp://*:5559",
+        "dpn-subscriber-uri": "tcp://*:5566",
+        "dpn-publisher-uri": "tcp://*:5555",
         "dpn-client-threads": 5,
         "node-id": "node0",
         "network-id": "network1",
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/FpcManager.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/FpcManager.java
index fc7e265..7929e59 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/FpcManager.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/FpcManager.java
@@ -48,7 +48,7 @@
 
     /* Services */
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    private TenantService tenantService;
+    private FpcRpcService fpcRpcService;
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
     private ModelConverter modelConverter;
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/TenantManager.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/FpcRpcManager.java
similarity index 82%
rename from apps/fpcagent/src/main/java/org/onosproject/fpcagent/TenantManager.java
rename to apps/fpcagent/src/main/java/org/onosproject/fpcagent/FpcRpcManager.java
index 7300e03..fd10302 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/TenantManager.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/FpcRpcManager.java
@@ -25,11 +25,14 @@
 import org.onlab.packet.Ip4Prefix;
 import org.onosproject.config.DynamicConfigService;
 import org.onosproject.config.DynamicConfigStore;
-import org.onosproject.config.Filter;
+import org.onosproject.fpcagent.protocols.DpnCommunicationService;
+import org.onosproject.fpcagent.protocols.DpnNgicCommunicator;
+import org.onosproject.fpcagent.protocols.DpnP4Communicator;
 import org.onosproject.fpcagent.util.*;
 import org.onosproject.yang.gen.v1.fpc.rev20150105.fpc.DefaultConnectionInfo;
 import org.onosproject.yang.gen.v1.fpc.rev20150105.fpc.P4DpnControlProtocol;
 import org.onosproject.yang.gen.v1.fpc.rev20150105.fpc.ZmqDpnControlProtocol;
+import org.onosproject.yang.gen.v1.fpc.rev20150105.fpc.connectioninfo.ConnectionsKeys;
 import org.onosproject.yang.gen.v1.fpc.rev20150105.fpc.connectioninfo.DefaultConnections;
 import org.onosproject.yang.gen.v1.fpc.rev20150105.fpc.deregisterclient.DefaultDeregisterClientOutput;
 import org.onosproject.yang.gen.v1.fpc.rev20150105.fpc.registerclient.DefaultRegisterClientInput;
@@ -44,6 +47,7 @@
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.configurebundles.configurebundlesoutput.DefaultBundles;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.configuredpn.DefaultConfigureDpnInput;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.configuredpn.DefaultConfigureDpnOutput;
+import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.instructions.Instructions;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.instructions.instructions.instrtype.Instr3GppMob;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.opinput.opbody.CreateOrUpdate;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.opinput.opbody.DeleteOrQuery;
@@ -58,6 +62,7 @@
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.tenants.tenant.DefaultFpcMobility;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.tenants.tenant.DefaultFpcPolicy;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.tenants.tenant.DefaultFpcTopology;
+import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.tenants.tenant.fpcmobility.ContextsKeys;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.tenants.tenant.fpcmobility.DefaultContexts;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.tenants.tenant.fpctopology.DefaultDpns;
 import org.onosproject.yang.gen.v1.ietfdmmfpcbase.rev20160803.ietfdmmfpcbase.FpcContextId;
@@ -75,7 +80,6 @@
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.*;
 
@@ -84,7 +88,7 @@
 
 @Component(immediate = true)
 @Service
-public class TenantManager implements TenantService, IetfDmmFpcagentService, org.onosproject.yang.gen.v1.fpc.rev20150105.FpcService {
+public class FpcRpcManager implements FpcRpcService, IetfDmmFpcagentService, org.onosproject.yang.gen.v1.fpc.rev20150105.FpcService {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -104,8 +108,20 @@
 
     @Activate
     protected void activate() {
-        CacheManager.addManager(this);
+        init();
+        registry.registerRpcService(this);
+        log.info("Tenant Service Started");
+    }
+
+    @Deactivate
+    protected void deactivate() {
+        registry.unregisterRpcService(this);
+        log.info("Tenant Service Stopped");
+    }
+
+    private void init() {
         FpcUtil.modelConverter = modelConverter;
+        FpcUtil.dynamicConfigService = dynamicConfigService;
         getResourceId();
 
         // Create the Default Tenant and added to the Tenants structure.
@@ -128,77 +144,6 @@
         createNode(tenants, root);
         createNode(fpcAgentInfo, root);
         createNode(defaultConnectionInfo, root);
-
-        registry.registerRpcService(this);
-
-        log.info("Tenant Service Started");
-    }
-
-    @Deactivate
-    protected void deactivate() {
-        registry.unregisterRpcService(this);
-
-        log.info("Tenant Service Stopped");
-    }
-
-    @Override
-    public Optional<DefaultTenants> getTenants() {
-        Filter filter = Filter.builder().build();
-        DataNode dataNode = dynamicConfigService.readNode(tenants, filter);
-
-        return getModelObjects(dataNode, null)
-                .stream()
-                .map(modelObject -> (DefaultTenants) modelObject)
-                .findFirst();
-    }
-
-    @Override
-    public Optional<DefaultTenant> getTenant(FpcIdentity tenantId) {
-        Filter filter = Filter.builder().build();
-        DataNode dataNode = dynamicConfigService.readNode(getTenantResourceId(tenantId), filter);
-
-        return getModelObjects(dataNode, tenants)
-                .stream()
-                .map(modelObject -> (DefaultTenant) modelObject)
-                .findFirst();
-    }
-
-    @Override
-    public Optional<DefaultTenant> getTenant(ClientIdentifier clientId) {
-        return Optional.empty();
-    }
-
-    @Override
-    public List<ModelObject> getModelObjects(DataNode dataNode, ResourceId resourceId) {
-        ResourceData data = getResourceData(dataNode, resourceId);
-        ModelObjectData modelData = modelConverter.createModel(data);
-        return modelData.modelObjects();
-    }
-
-    @Override
-    public void createNode(InnerModelObject innerModelObject, ModelObjectId modelObjectId) {
-        ResourceData dataNode = modelConverter.createDataNode(
-                DefaultModelObjectData.builder()
-                        .identifier(modelObjectId)
-                        .addModelObject(innerModelObject)
-                        .build()
-        );
-        dataNode.dataNodes().forEach(
-                node -> dynamicConfigService.createNode(dataNode.resourceId(), node)
-        );
-    }
-
-    @Override
-    public void updateNode(InnerModelObject innerModelObject, ModelObjectId modelObjectId) {
-        ResourceData dataNode = modelConverter.createDataNode(
-                DefaultModelObjectData.builder()
-                        .identifier(modelObjectId)
-                        .addModelObject(innerModelObject)
-                        .build()
-        );
-        dataNode.dataNodes().forEach(
-                node -> dynamicConfigService.updateNode(dataNode.resourceId(), node)
-        );
     }
 
     @Override
@@ -209,16 +154,20 @@
     ) throws Exception {
         DefaultConfigureOutput configureOutput = new DefaultConfigureOutput();
         Collection<Callable<Object>> tasks = new ArrayList<>();
-
+        FpcIdentity tenantId = clientInfo.tenantId();
         DefaultCommonSuccess defaultCommonSuccess = new DefaultCommonSuccess();
-        CacheManager cacheManager = CacheManager.getInstance(clientInfo.tenantId());
+        CacheManager cacheManager = CacheManager.getInstance(tenantId);
 
         for (Contexts context : create.contexts()) {
+            Instructions instructions = context.instructions();
+            if (instructions == null) {
+                throw new RuntimeException("Instructions are empty.");
+            }
             // add context to response.
             defaultCommonSuccess.addToContexts(context);
 
             // check if mobility exists and if the context id exists.
-            if (CacheManager.getInstance(clientInfo.tenantId()).contextsCache.get(context.contextId()).isPresent()) {
+            if (CacheManager.getInstance(tenantId).contextsCache.get(context.contextId()).isPresent()) {
                 // throw exception if trying to create a Context that already exists.
                 throw new RuntimeException("Context tried to create already exists. Please issue update operation..");
             }
@@ -242,7 +191,7 @@
                 }
 
                 // handle only 3GPP instructions.
-                if (!(context.instructions().instrType() instanceof Instr3GppMob)) {
+                if (!(instructions.instrType() instanceof Instr3GppMob)) {
                     throw new RuntimeException("No 3GPP instructions where given.");
                 }
 
@@ -268,7 +217,7 @@
                 }
 
                 // Extract variables
-                Instr3GppMob instr3GppMob = (Instr3GppMob) context.instructions().instrType();
+                Instr3GppMob instr3GppMob = (Instr3GppMob) instructions.instrType();
                 String commands = Bits.toString(instr3GppMob.instr3GppMob().bits());
 
                 Ip4Address s1u_enodeb_ipv4 = Ip4Address.valueOf(context.ul().tunnelLocalAddress().toString()),
@@ -302,13 +251,14 @@
                                 op_id
                         );
 
-                        ModelObjectId modelObjectId = defaultTenantBuilder()
+                        ModelObjectId modelObjectId = tenantBuilder(tenantId)
                                 .addChild(DefaultFpcMobility.class)
                                 .build();
                         createNode(convertContext, modelObjectId);
                         cacheManager.contextsCache.put(convertContext.contextId(), Optional.of(convertContext));
                     }));
 
+                    // FIXME why downlink is in session while uplink is not?
                     if (commands.contains("downlink")) {
                         tasks.add(Executors.callable(() -> {
                             dpnCommunicationService.modify_bearer(
@@ -321,7 +271,7 @@
                                     op_id
                             );
 
-                            ModelObjectId modelObjectId = defaultTenantBuilder()
+                            ModelObjectId modelObjectId = tenantBuilder(tenantId)
                                     .addChild(DefaultFpcMobility.class)
                                     .build();
                             createNode(convertContext, modelObjectId);
@@ -363,32 +313,48 @@
     ) throws Exception {
         DefaultConfigureOutput configureOutput = new DefaultConfigureOutput();
         Collection<Callable<Object>> tasks = new ArrayList<>();
+        FpcIdentity tenantId = clientInfo.tenantId();
         DefaultCommonSuccess defaultCommonSuccess = new DefaultCommonSuccess();
-        CacheManager cacheManager = CacheManager.getInstance(clientInfo.tenantId());
+        CacheManager cacheManager = CacheManager.getInstance(tenantId);
         for (Contexts context : update.contexts()) {
+            Instructions instructions = context.instructions();
+            if (instructions == null) {
+                throw new RuntimeException("Instructions are empty.");
+            }
             // add updated context to response.
             defaultCommonSuccess.addToContexts(context);
 
             // check if contexts are populated and if they include the wanted context to update.
-            if (!CacheManager.getInstance(clientInfo.tenantId()).contextsCache.get(context.contextId()).isPresent()) {
+            if (!CacheManager.getInstance(tenantId).contextsCache.get(context.contextId()).isPresent()) {
                 // throw exception if wanted context does not exist.
                 throw new RuntimeException("Context doesn't exist. Please issue create operation..");
             }
 
             for (Dpns dpn : context.dpns()) {
+                Optional<DefaultDpns> optionalDpn = cacheManager.dpnsCache.get(dpn.dpnId());
                 // check if dpns exists and if there is a DPN registered for the wanted identifier.
-                if (!cacheManager.dpnsCache.get(dpn.dpnId()).isPresent()) {
+                if (!optionalDpn.isPresent()) {
                     // throw exception if DPN ID is not registered.
                     throw new RuntimeException("DPN ID is not registered to the topology.");
                 }
 
+                final DpnCommunicationService dpnCommunicationService;
+                Class<? extends FpcDpnControlProtocol> controlProtocol = optionalDpn.get().controlProtocol();
+                if (controlProtocol.isAssignableFrom(ZmqDpnControlProtocol.class)) {
+                    dpnCommunicationService = new DpnNgicCommunicator();
+                } else if (controlProtocol.isAssignableFrom(P4DpnControlProtocol.class)) {
+                    dpnCommunicationService = new DpnP4Communicator();
+                } else {
+                    throw new RuntimeException("Control Protocol is not supported.");
+                }
+
                 // handle only 3GPP instructions.
-                if (!(context.instructions().instrType() instanceof Instr3GppMob)) {
+                if (!(instructions.instrType() instanceof Instr3GppMob)) {
                     throw new RuntimeException("No 3GPP instructions where given.");
                 }
 
                 // from DPN ID find the Network and Node Identifiers
-                Optional<String> key = cacheManager.dpnsCache.get(dpn.dpnId())
+                Optional<String> key = optionalDpn
                         .map(node -> node.nodeId() + "/" + node.networkId());
                 if (!key.isPresent()) {
                     throw new RuntimeException("DPN does not have node and network ID defined.");
@@ -404,7 +370,7 @@
                     throw new RuntimeException("mobprofileParameters are not instance of ThreegppTunnel");
                 }
 
-                Instr3GppMob instr3GppMob = (Instr3GppMob) context.instructions().instrType();
+                Instr3GppMob instr3GppMob = (Instr3GppMob) instructions.instrType();
                 String commands = Bits.toString(instr3GppMob.instr3GppMob().bits());
 
                 Ip4Address s1u_enodeb_ipv4 = Ip4Address.valueOf(context.ul().tunnelLocalAddress().toString()),
@@ -416,49 +382,51 @@
 
                 BigInteger opId = operationId.uint64();
 
+                // TODO dpn.direction()
+
                 DefaultContexts convertContext = convertContext(context);
                 if (commands.contains("downlink")) {
                     if (context.dl().lifetime() >= 0L) {
-//                        tasks.add(Executors.callable(() -> {
-//                            dpnCommunicationService.modify_bearer(
-//                                    topic_id,
-//                                    s1u_sgw_ipv4,
-//                                    s1u_enb_gtpu_teid,
-//                                    s1u_enodeb_ipv4,
-//                                    contextId,
-//                                    cId,
-//                                    opId
-//                            );
-//
-//                            ModelObjectId modelObjectId = defaultTenantBuilder()
-//                                    .addChild(DefaultFpcMobility.class)
-//                                    .build();
-//                            updateNode(convertContext, modelObjectId);
-//                            cacheManager.contextsCache.put(convertContext.contextId(), Optional.of(convertContext));
-//                        }));
+                        tasks.add(Executors.callable(() -> {
+                            dpnCommunicationService.modify_bearer(
+                                    topic_id,
+                                    s1u_sgw_ipv4,
+                                    s1u_enb_gtpu_teid,
+                                    s1u_enodeb_ipv4,
+                                    contextId,
+                                    cId,
+                                    opId
+                            );
+
+                            ModelObjectId modelObjectId = tenantBuilder(tenantId)
+                                    .addChild(DefaultFpcMobility.class)
+                                    .build();
+                            updateNode(convertContext, modelObjectId);
+                            cacheManager.contextsCache.put(convertContext.contextId(), Optional.of(convertContext));
+                        }));
                     } else {
                         // TODO delete bearer
                     }
                 }
                 if (commands.contains("uplink")) {
                     if (context.ul().lifetime() >= 0L) {
-//                        tasks.add(Executors.callable(() -> {
-//                            dpnCommunicationService.modify_bearer(
-//                                    topic_id,
-//                                    s1u_sgw_ipv4,
-//                                    s1u_enb_gtpu_teid,
-//                                    s1u_enodeb_ipv4,
-//                                    contextId,
-//                                    cId,
-//                                    opId
-//                            );
-//
-//                            ModelObjectId modelObjectId = defaultTenantBuilder()
-//                                    .addChild(DefaultFpcMobility.class)
-//                                    .build();
-//                            updateNode(convertContext, modelObjectId);
-//                            cacheManager.contextsCache.put(convertContext.contextId(), Optional.of(convertContext));
-//                        }));
+                        tasks.add(Executors.callable(() -> {
+                            dpnCommunicationService.modify_bearer(
+                                    topic_id,
+                                    s1u_sgw_ipv4,
+                                    s1u_enb_gtpu_teid,
+                                    s1u_enodeb_ipv4,
+                                    contextId,
+                                    cId,
+                                    opId
+                            );
+
+                            ModelObjectId modelObjectId = tenantBuilder(tenantId)
+                                    .addChild(DefaultFpcMobility.class)
+                                    .build();
+                            updateNode(convertContext, modelObjectId);
+                            cacheManager.contextsCache.put(convertContext.contextId(), Optional.of(convertContext));
+                        }));
                     } else {
                         // TODO delete bearer
                     }
@@ -492,7 +460,8 @@
     ) throws Exception {
         DefaultConfigureOutput configureOutput = new DefaultConfigureOutput();
         Collection<Callable<Object>> tasks = new ArrayList<>();
-        CacheManager cacheManager = CacheManager.getInstance(clientInfo.tenantId());
+        FpcIdentity tenantId = clientInfo.tenantId();
+        CacheManager cacheManager = CacheManager.getInstance(tenantId);
         DefaultDeleteSuccess defaultDeleteSuccess = new DefaultDeleteSuccess();
         for (Targets target : delete.targets()) {
             defaultDeleteSuccess.addToTargets(target);
@@ -503,21 +472,32 @@
 
             // find context that this target is about.
             FpcContextId fpcContextId = FpcContextId.of(FpcIdentity.fromString(trgt));
-            Optional<DefaultContexts> defaultContexts = CacheManager.getInstance(clientInfo.tenantId()).contextsCache.get(fpcContextId);
+            Optional<DefaultContexts> defaultContexts = CacheManager.getInstance(tenantId).contextsCache.get(fpcContextId);
             if (!defaultContexts.isPresent()) {
                 throw new RuntimeException("Context doesn't exist. Please issue create operation..");
             }
 
             DefaultContexts context = defaultContexts.get();
             for (Dpns dpn : context.dpns()) {
+                Optional<DefaultDpns> optionalDpn = cacheManager.dpnsCache.get(dpn.dpnId());
                 // check if dpns exists and if there is a DPN registered for the wanted identifier.
-                if (!cacheManager.dpnsCache.get(dpn.dpnId()).isPresent()) {
+                if (!optionalDpn.isPresent()) {
                     // throw exception if DPN ID is not registered.
                     throw new RuntimeException("DPN ID is not registered to the topology.");
                 }
 
+                final DpnCommunicationService dpnCommunicationService;
+                Class<? extends FpcDpnControlProtocol> controlProtocol = optionalDpn.get().controlProtocol();
+                if (controlProtocol.isAssignableFrom(ZmqDpnControlProtocol.class)) {
+                    dpnCommunicationService = new DpnNgicCommunicator();
+                } else if (controlProtocol.isAssignableFrom(P4DpnControlProtocol.class)) {
+                    dpnCommunicationService = new DpnP4Communicator();
+                } else {
+                    throw new RuntimeException("Control Protocol is not supported.");
+                }
+
                 // from DPN ID find the Network and Node Identifiers
-                Optional<String> key = cacheManager.dpnsCache.get(dpn.dpnId())
+                Optional<String> key = optionalDpn
                         .map(node -> node.nodeId() + "/" + node.networkId());
                 if (!key.isPresent()) {
                     throw new RuntimeException("DPN does not have node and network ID defined.");
@@ -541,25 +521,25 @@
                 if (targetStr.endsWith("ul") || targetStr.endsWith("dl")) {
                     // TODO delete bearer
                 } else {
-//                    tasks.add(Executors.callable(() -> {
-//                        dpnCommunicationService.delete_session(
-//                                topic_id,
-//                                context.contextId().fpcIdentity().union().int64(),
-//                                client_id,
-//                                op_id
-//                        );
-//
-//                        ContextsKeys contextsKeys = new ContextsKeys();
-//                        contextsKeys.contextId(context.contextId());
-//
-//                        ResourceId resourceVal = getResourceVal(defaultTenantBuilder()
-//                                .addChild(DefaultFpcMobility.class)
-//                                .addChild(DefaultContexts.class, contextsKeys)
-//                                .build());
-//
-//                        dynamicConfigService.deleteNode(resourceVal);
-//                        cacheManager.contextsCache.put(context.contextId(), Optional.empty());
-//                    }));
+                    tasks.add(Executors.callable(() -> {
+                        dpnCommunicationService.delete_session(
+                                topic_id,
+                                context.contextId().fpcIdentity().union().int64(),
+                                client_id,
+                                op_id
+                        );
+
+                        ContextsKeys contextsKeys = new ContextsKeys();
+                        contextsKeys.contextId(context.contextId());
+
+                        ResourceId resourceVal = getResourceVal(tenantBuilder(tenantId)
+                                .addChild(DefaultFpcMobility.class)
+                                .addChild(DefaultContexts.class, contextsKeys)
+                                .build());
+
+                        dynamicConfigService.deleteNode(resourceVal);
+                        cacheManager.contextsCache.put(context.contextId(), Optional.empty());
+                    }));
                 }
             }
         }
@@ -722,6 +702,9 @@
         try {
             for (ModelObject modelObject : getModelObjects(rpcInput.data(), configure)) {
                 DefaultConfigureInput input = (DefaultConfigureInput) modelObject;
+                if (!clientInfo.containsKey(input.clientId())) {
+                    throw new RuntimeException("Client Identifier is not registered.");
+                }
                 switch (input.opType()) {
                     case CREATE:
                         configureOutput = configureCreate(
@@ -764,7 +747,7 @@
                         .addModelObject(configureOutput)
                         .build()
         );
-        log.debug("Time Elapsed {} ms", timer.stop().elapsed(TimeUnit.MILLISECONDS));
+        log.info("Time Elapsed {} ms", timer.stop().elapsed(TimeUnit.MILLISECONDS));
         return new RpcOutput(status, dataNode.dataNodes().get(0));
     }
 
@@ -776,6 +759,9 @@
         try {
             for (ModelObject modelObject : getModelObjects(rpcInput.data(), configureBundles)) {
                 DefaultConfigureBundlesInput input = (DefaultConfigureBundlesInput) modelObject;
+                if (!clientInfo.containsKey(input.clientId())) {
+                    throw new RuntimeException("Client Identifier is not registered.");
+                }
                 for (org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.configurebundles.configurebundlesinput.Bundles bundle : input.bundles()) {
                     DefaultConfigureOutput configureOutput = new DefaultConfigureOutput();
                     switch (bundle.opType()) {
@@ -853,7 +839,6 @@
         Stopwatch timer = Stopwatch.createStarted();
         DefaultRegisterClientOutput registerClientOutput = new DefaultRegisterClientOutput();
         RpcOutput.Status status = RpcOutput.Status.RPC_SUCCESS;
-
         try {
             for (ModelObject modelObject : getModelObjects(rpcInput.data(), registerClient)) {
                 DefaultRegisterClientInput input = (DefaultRegisterClientInput) modelObject;
@@ -867,7 +852,13 @@
                 registerClientOutput.supportsAckModel(input.supportsAckModel());
                 registerClientOutput.tenantId(input.tenantId());
 
-                // TODO create node to DCS
+                DefaultConnections defaultConnections = new DefaultConnections();
+                defaultConnections.clientId(input.clientId().toString());
+
+                ModelObjectId modelObjectId = ModelObjectId.builder()
+                        .addChild(DefaultConnectionInfo.class)
+                        .build();
+                createNode(defaultConnections, modelObjectId);
             }
         } catch (Exception e) {
             // if there is an exception respond with an error.
@@ -903,7 +894,15 @@
                 DefaultConnections defaultConnections = new DefaultConnections();
                 defaultConnections.clientId(input.clientId().toString());
 
-                // TODO delete node from DCS
+                ConnectionsKeys connectionsKeys = new ConnectionsKeys();
+                connectionsKeys.clientId(input.clientId().toString());
+
+                ResourceId resourceVal = getResourceVal(ModelObjectId.builder()
+                        .addChild(DefaultConnectionInfo.class)
+                        .addChild(DefaultConnections.class, connectionsKeys)
+                        .build());
+
+                dynamicConfigService.deleteNode(resourceVal);
             }
         } catch (Exception e) {
             // if there is an exception respond with an error.
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/FpcRpcService.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/FpcRpcService.java
new file mode 100644
index 0000000..8d5c150
--- /dev/null
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/FpcRpcService.java
@@ -0,0 +1,60 @@
+package org.onosproject.fpcagent;
+
+import com.google.common.annotations.Beta;
+import org.onosproject.yang.gen.v1.fpc.rev20150105.fpc.registerclient.DefaultRegisterClientInput;
+import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.OpIdentifier;
+import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.configure.DefaultConfigureOutput;
+import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.configuredpn.DefaultConfigureDpnInput;
+import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.configuredpn.DefaultConfigureDpnOutput;
+import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.opinput.opbody.CreateOrUpdate;
+import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.opinput.opbody.DeleteOrQuery;
+
+@Beta
+public interface FpcRpcService {
+
+    /**
+     * Handles create Configure operations that are invoked through RPC.
+     *
+     * @param create      RPC Input converted
+     * @param clientInfo    Client Identifier
+     * @param operationId Operation Identifier
+     * @return Result of the configuration
+     */
+    DefaultConfigureOutput configureCreate(
+            CreateOrUpdate create,
+            DefaultRegisterClientInput clientInfo,
+            OpIdentifier operationId
+    ) throws Exception;
+
+    /**
+     * Handles update Configure operations that are invoked through RPC.
+     *
+     * @param update      RPC Input converted
+     * @param clientInfo    Client Identifier
+     * @param operationId Operation Identifier
+     * @return Result of the configuration
+     */
+    DefaultConfigureOutput configureUpdate(
+            CreateOrUpdate update,
+            DefaultRegisterClientInput clientInfo,
+            OpIdentifier operationId
+    ) throws Exception;
+
+    /**
+     * Handles delete Configure operations that are invoked through RPC.
+     *
+     * @param delete      RPC Input converted
+     * @param clientInfo    Client Identifier
+     * @param operationId Operation Identifier
+     * @return Result of the configuration
+     */
+    DefaultConfigureOutput configureDelete(
+            DeleteOrQuery delete,
+            DefaultRegisterClientInput clientInfo,
+            OpIdentifier operationId
+    ) throws Exception;
+
+    DefaultConfigureDpnOutput configureDpnAdd(DefaultConfigureDpnInput input) throws Exception;
+
+    DefaultConfigureDpnOutput configureDpnRemove(DefaultConfigureDpnInput input) throws Exception;
+}
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/TenantService.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/TenantService.java
deleted file mode 100644
index f412c5f..0000000
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/TenantService.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package org.onosproject.fpcagent;
-
-import com.google.common.annotations.Beta;
-import org.onosproject.yang.gen.v1.fpc.rev20150105.fpc.registerclient.DefaultRegisterClientInput;
-import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.ClientIdentifier;
-import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.DefaultTenants;
-import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.OpIdentifier;
-import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.configure.DefaultConfigureOutput;
-import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.configuredpn.DefaultConfigureDpnInput;
-import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.configuredpn.DefaultConfigureDpnOutput;
-import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.opinput.opbody.CreateOrUpdate;
-import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.opinput.opbody.DeleteOrQuery;
-import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.tenants.DefaultTenant;
-import org.onosproject.yang.gen.v1.ietfdmmfpcbase.rev20160803.ietfdmmfpcbase.FpcIdentity;
-import org.onosproject.yang.model.*;
-
-import java.util.List;
-import java.util.Optional;
-
-@Beta
-public interface TenantService {
-    /**
-     * Returns the root level node for Tenants.
-     * Tenants is an interface that includes a List of Tenant objects.
-     *
-     * @return Optional Tenants
-     */
-    Optional<DefaultTenants> getTenants();
-
-    /**
-     * Creates a Node inside the Dynamic Configuration Store.
-     *
-     * @param innerModelObject inner model object to create
-     * @param modelObjectId    Model Object ID
-     */
-    void createNode(InnerModelObject innerModelObject, ModelObjectId modelObjectId);
-
-    /**
-     * Updates a Node inside the Dynamic Configuration Store.
-     *
-     * @param innerModelObject inner model object to update
-     * @param modelObjectId    Model Object ID
-     */
-    void updateNode(InnerModelObject innerModelObject, ModelObjectId modelObjectId);
-
-    /**
-     * Converts DataNode to a ModelObject.
-     *
-     * @param dataNode DataNode
-     * @param appId    Resource Identifier
-     * @return Model Object
-     */
-    List<ModelObject> getModelObjects(DataNode dataNode, ResourceId appId);
-
-    /**
-     * Get Tenant by its Identifier.
-     *
-     * @param tenantId Tenant Identifier
-     * @return Optional Tenant
-     */
-    Optional<DefaultTenant> getTenant(FpcIdentity tenantId);
-
-    Optional<DefaultTenant> getTenant(ClientIdentifier clientId);
-
-    /**
-     * Handles create Configure operations that are invoked through RPC.
-     *
-     * @param create      RPC Input converted
-     * @param clientInfo    Client Identifier
-     * @param operationId Operation Identifier
-     * @return Result of the configuration
-     */
-    DefaultConfigureOutput configureCreate(
-            CreateOrUpdate create,
-            DefaultRegisterClientInput clientInfo,
-            OpIdentifier operationId
-    ) throws Exception;
-
-    /**
-     * Handles update Configure operations that are invoked through RPC.
-     *
-     * @param update      RPC Input converted
-     * @param clientInfo    Client Identifier
-     * @param operationId Operation Identifier
-     * @return Result of the configuration
-     */
-    DefaultConfigureOutput configureUpdate(
-            CreateOrUpdate update,
-            DefaultRegisterClientInput clientInfo,
-            OpIdentifier operationId
-    ) throws Exception;
-
-    /**
-     * Handles delete Configure operations that are invoked through RPC.
-     *
-     * @param delete      RPC Input converted
-     * @param clientInfo    Client Identifier
-     * @param operationId Operation Identifier
-     * @return Result of the configuration
-     */
-    DefaultConfigureOutput configureDelete(
-            DeleteOrQuery delete,
-            DefaultRegisterClientInput clientInfo,
-            OpIdentifier operationId
-    ) throws Exception;
-
-    DefaultConfigureDpnOutput configureDpnAdd(DefaultConfigureDpnInput input) throws Exception;
-
-    DefaultConfigureDpnOutput configureDpnRemove(DefaultConfigureDpnInput input) throws Exception;
-}
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/DpnCommunicationService.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/protocols/DpnCommunicationService.java
similarity index 98%
rename from apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/DpnCommunicationService.java
rename to apps/fpcagent/src/main/java/org/onosproject/fpcagent/protocols/DpnCommunicationService.java
index e1bcd17..7405169 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/DpnCommunicationService.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/protocols/DpnCommunicationService.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.fpcagent.util;
+package org.onosproject.fpcagent.protocols;
 
 import org.onlab.packet.Ip4Address;
 
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/DpnNgicCommunicator.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/protocols/DpnNgicCommunicator.java
similarity index 99%
rename from apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/DpnNgicCommunicator.java
rename to apps/fpcagent/src/main/java/org/onosproject/fpcagent/protocols/DpnNgicCommunicator.java
index f444e11..7740ec6 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/DpnNgicCommunicator.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/protocols/DpnNgicCommunicator.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.fpcagent.util;
+package org.onosproject.fpcagent.protocols;
 
 import org.onlab.packet.Ip4Address;
 import org.onlab.packet.Ip4Prefix;
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/DpnP4Communicator.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/protocols/DpnP4Communicator.java
similarity index 97%
rename from apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/DpnP4Communicator.java
rename to apps/fpcagent/src/main/java/org/onosproject/fpcagent/protocols/DpnP4Communicator.java
index 6fb7eb9..5b12e05 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/DpnP4Communicator.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/protocols/DpnP4Communicator.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.fpcagent.util;
+package org.onosproject.fpcagent.protocols;
 
 import org.onlab.packet.Ip4Address;
 import org.onosproject.yang.gen.v1.fpc.rev20150105.fpc.P4DpnControlProtocol;
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/CacheManager.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/CacheManager.java
index ebc3644..1b0bae3 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/CacheManager.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/CacheManager.java
@@ -20,7 +20,6 @@
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
 import com.google.common.collect.Maps;
-import org.onosproject.fpcagent.TenantManager;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.tenants.DefaultTenant;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.tenants.tenant.fpcmobility.DefaultContexts;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.tenants.tenant.fpctopology.DefaultDpns;
@@ -33,6 +32,8 @@
 import java.util.Optional;
 import java.util.concurrent.ConcurrentMap;
 
+import static org.onosproject.fpcagent.util.FpcUtil.getTenant;
+
 /**
  * Cache Manager.
  */
@@ -44,8 +45,6 @@
     public LoadingCache<FpcContextId, Optional<DefaultContexts>> contextsCache;
     public LoadingCache<FpcDpnId, Optional<DefaultDpns>> dpnsCache;
 
-    private static TenantManager tenantManager;
-
     private CacheManager(FpcIdentity identity) {
         contextsCache = CacheBuilder.newBuilder()
                 .maximumSize(100)
@@ -54,7 +53,7 @@
                             @Override
                             public Optional<DefaultContexts> load(FpcContextId fpcContextId) throws Exception {
                                 try {
-                                    Optional<DefaultTenant> defaultTenant = tenantManager.getTenant(identity);
+                                    Optional<DefaultTenant> defaultTenant = getTenant(identity);
                                     if (defaultTenant.isPresent()) {
                                         DefaultTenant tenant = defaultTenant.get();
                                         log.debug("tenant {}", defaultTenant);
@@ -82,7 +81,7 @@
                             @Override
                             public Optional<DefaultDpns> load(FpcDpnId fpcDpnId) throws Exception {
                                 try {
-                                    Optional<DefaultTenant> defaultTenant = tenantManager.getTenant(identity);
+                                    Optional<DefaultTenant> defaultTenant = getTenant(identity);
                                     if (defaultTenant.isPresent()) {
                                         DefaultTenant tenant = defaultTenant.get();
                                         log.debug("tenant {}", tenant);
@@ -109,7 +108,4 @@
         return cacheInfo.get(identity);
     }
 
-    public static void addManager(TenantManager manager) {
-        tenantManager = manager;
-    }
 }
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/Converter.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/Converter.java
index 5e61d74..fd4ba4a 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/Converter.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/Converter.java
@@ -1,15 +1,12 @@
 package org.onosproject.fpcagent.util;
 
-import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.ClientIdentifier;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.tenants.tenant.fpcmobility.DefaultContexts;
 import org.onosproject.yang.gen.v1.ietfdmmfpcbase.rev20160803.ietfdmmfpcbase.FpcContextId;
 import org.onosproject.yang.gen.v1.ietfdmmfpcbase.rev20160803.ietfdmmfpcbase.FpcDpnGroupId;
-import org.onosproject.yang.gen.v1.ietfdmmfpcbase.rev20160803.ietfdmmfpcbase.FpcIdentity;
 import org.onosproject.yang.gen.v1.ietfdmmfpcbase.rev20160803.ietfdmmfpcbase.FpcPortId;
 import org.onosproject.yang.gen.v1.ietfdmmfpcbase.rev20160803.ietfdmmfpcbase.fpccontext.Dl;
 import org.onosproject.yang.gen.v1.ietfdmmfpcbase.rev20160803.ietfdmmfpcbase.fpccontext.Dpns;
 import org.onosproject.yang.gen.v1.ietfdmmfpcbase.rev20160803.ietfdmmfpcbase.fpccontext.Ul;
-import org.onosproject.yang.gen.v1.ietfdmmfpcbase.rev20160803.ietfdmmfpcbase.fpcidentity.FpcIdentityUnion;
 import org.onosproject.yang.gen.v1.ietfdmmthreegpp.rev20160803.ietfdmmthreegpp.EbiType;
 import org.onosproject.yang.gen.v1.ietfdmmthreegpp.rev20160803.ietfdmmthreegpp.ImsiType;
 import org.onosproject.yang.gen.v1.ietfinettypes.rev20130715.ietfinettypes.IpPrefix;
@@ -19,12 +16,9 @@
 import java.math.BigInteger;
 import java.util.Arrays;
 import java.util.List;
-import java.util.function.Function;
 
 public class Converter {
     private static final Logger log = LoggerFactory.getLogger(Converter.class);
-    public static Function<String, FpcIdentity> getFpcIdentity = (v) -> new FpcIdentity(new FpcIdentityUnion(v));
-    public static Function<String, ClientIdentifier> getClientIdentity = (v) -> new ClientIdentifier(getFpcIdentity.apply(v));
 
     /**
      * Short to Byte
diff --git a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/FpcUtil.java b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/FpcUtil.java
index f528442..0141b36 100644
--- a/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/FpcUtil.java
+++ b/apps/fpcagent/src/main/java/org/onosproject/fpcagent/util/FpcUtil.java
@@ -17,6 +17,8 @@
 package org.onosproject.fpcagent.util;
 
 import com.google.common.collect.Maps;
+import org.onosproject.config.DynamicConfigService;
+import org.onosproject.config.Filter;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.ClientIdentifier;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.DefaultTenants;
 import org.onosproject.yang.gen.v1.ietfdmmfpcagent.rev20160803.ietfdmmfpcagent.OpIdentifier;
@@ -32,11 +34,10 @@
 import org.slf4j.LoggerFactory;
 
 import java.math.BigInteger;
-import java.util.AbstractMap;
-import java.util.Arrays;
-import java.util.Map;
+import java.util.*;
 
-import static org.onosproject.fpcagent.util.Converter.*;
+import static org.onosproject.fpcagent.util.Converter.fromIntToLong;
+import static org.onosproject.fpcagent.util.Converter.toBigInt;
 
 /**
  * Helper class which stores all the static variables.
@@ -49,26 +50,10 @@
     public static final String UNKNOWN_EVENT = "FPC Agent listener: unknown event: {}";
     public static final String EVENT_NULL = "Event cannot be null";
     public static final String FPC_APP_ID = "org.onosproject.fpcagent";
-
+    public static final FpcIdentity defaultIdentity = FpcIdentity.fromString("default");
     private static final Logger log = LoggerFactory.getLogger(FpcUtil.class);
     private static final Map<String, FpcDpnId> uplinkDpnMap = Maps.newConcurrentMap();
     private static final Map<String, Short> nodeToTopicMap = Maps.newConcurrentMap();
-
-    public static ModelConverter modelConverter = null;
-    // Resource ID for Configure DPN RPC command
-    public static ResourceId configureDpn;
-    // Resource ID for Configure RPC command
-    public static ResourceId configure;
-    // Resource ID for tenants data
-    public static ResourceId tenants;
-    public static ResourceId defaultTenant;
-    public static ResourceId configureBundles;
-    public static ResourceId registerClient;
-    public static ResourceId deregisterClinet;
-    public static ResourceId module;
-
-    public static final FpcIdentity defaultIdentity = getFpcIdentity.apply("default");
-
     private static final byte DPN_HELLO = 0b0000_0001;
     private static final byte DPN_BYE = 0b0000_0010;
     private static final byte DOWNLINK_DATA_NOTIFICATION = 0b0000_0101;
@@ -76,6 +61,18 @@
     private static final byte DPN_OVERLOAD_INDICATION = 0b0000_0101;
     private static final byte DPN_REPLY = 0b0000_0100;
     private static final String DOWNLINK_DATA_NOTIFICATION_STRING = "Downlink-Data-Notification";
+    public static DynamicConfigService dynamicConfigService = null;
+    public static ModelConverter modelConverter = null;
+    // Resource ID for Configure DPN RPC command
+    public static ResourceId configureDpn;
+    // Resource ID for Configure RPC command
+    public static ResourceId configure;
+    // Resource ID for tenants data
+    public static ResourceId tenants;
+    public static ResourceId configureBundles;
+    public static ResourceId registerClient;
+    public static ResourceId deregisterClinet;
+    public static ResourceId module;
 
     /**
      * Returns resource id from model converter.
@@ -104,11 +101,6 @@
 
         tenants = getResourceVal(tenantsId);
 
-        ModelObjectId defaultTenantId = defaultTenantBuilder()
-                .build();
-
-        defaultTenant = getResourceVal(defaultTenantId);
-
         configure = ResourceId.builder()
                 .addBranchPointSchema("/", null)
                 .addBranchPointSchema("configure", "urn:ietf:params:xml:ns:yang:fpcagent")
@@ -170,9 +162,9 @@
         }
     }
 
-    public static ModelObjectId.Builder defaultTenantBuilder() {
+    public static ModelObjectId.Builder tenantBuilder(FpcIdentity fpcIdentity) {
         TenantKeys tenantKeys = new TenantKeys();
-        tenantKeys.tenantId(defaultIdentity);
+        tenantKeys.tenantId(fpcIdentity);
 
         return ModelObjectId.builder()
                 .addChild(DefaultTenants.class)
@@ -272,6 +264,93 @@
     }
 
     /**
+     * Returns the root level node for Tenants.
+     * Tenants is an interface that includes a List of Tenant objects.
+     *
+     * @return Optional Tenants
+     */
+    public static Optional<DefaultTenants> getTenants() {
+        Filter filter = Filter.builder().build();
+        DataNode dataNode = dynamicConfigService.readNode(tenants, filter);
+
+        return getModelObjects(dataNode, null)
+                .stream()
+                .map(modelObject -> (DefaultTenants) modelObject)
+                .findFirst();
+    }
+
+    public static Optional<DefaultTenant> getTenant(FpcIdentity tenantId) {
+        Filter filter = Filter.builder().build();
+        DataNode dataNode = dynamicConfigService.readNode(getTenantResourceId(tenantId), filter);
+
+        return getModelObjects(dataNode, tenants)
+                .stream()
+                .map(modelObject -> (DefaultTenant) modelObject)
+                .findFirst();
+    }
+
+    /**
+     * Get Tenant by its Identifier.
+     *
+     * @param clientId Tenant Identifier
+     * @return Optional Tenant
+     */
+
+    public static Optional<DefaultTenant> getTenant(ClientIdentifier clientId) {
+        return Optional.empty();
+    }
+
+    /**
+     * Converts DataNode to a ModelObject.
+     *
+     * @param dataNode   DataNode
+     * @param resourceId Resource Identifier
+     * @return Model Object
+     */
+
+    public static List<ModelObject> getModelObjects(DataNode dataNode, ResourceId resourceId) {
+        ResourceData data = getResourceData(dataNode, resourceId);
+        ModelObjectData modelData = modelConverter.createModel(data);
+        return modelData.modelObjects();
+    }
+
+    /**
+     * Creates a Node inside the Dynamic Configuration Store.
+     *
+     * @param innerModelObject inner model object to create
+     * @param modelObjectId    Model Object ID
+     */
+    public static void createNode(InnerModelObject innerModelObject, ModelObjectId modelObjectId) {
+        ResourceData dataNode = modelConverter.createDataNode(
+                DefaultModelObjectData.builder()
+                        .identifier(modelObjectId)
+                        .addModelObject(innerModelObject)
+                        .build()
+        );
+        dataNode.dataNodes().forEach(
+                node -> dynamicConfigService.createNode(dataNode.resourceId(), node)
+        );
+    }
+
+    /**
+     * Updates a Node inside the Dynamic Configuration Store.
+     *
+     * @param innerModelObject inner model object to update
+     * @param modelObjectId    Model Object ID
+     */
+    public static void updateNode(InnerModelObject innerModelObject, ModelObjectId modelObjectId) {
+        ResourceData dataNode = modelConverter.createDataNode(
+                DefaultModelObjectData.builder()
+                        .identifier(modelObjectId)
+                        .addModelObject(innerModelObject)
+                        .build()
+        );
+        dataNode.dataNodes().forEach(
+                node -> dynamicConfigService.updateNode(dataNode.resourceId(), node)
+        );
+    }
+
+    /**
      * Provides basic status changes,
      */
     public static class DPNStatusIndication {
diff --git a/scripts/addDPN.sh b/scripts/addDPN.sh
index 18e5e42..8a1d141 100755
--- a/scripts/addDPN.sh
+++ b/scripts/addDPN.sh
@@ -12,7 +12,8 @@
                 ],
                 "node-id": "node'$1'",
                 "network-id": "network'$1'",
-                "control-protocol": "zmq-dpn-control-protocol"
+                "control-protocol": "zmq-dpn-control-protocol",
+                "abstract": false
             }
         ]
     }' 'http://localhost:8181/onos/restconf/data/ietf-dmm-fpcagent:tenants/tenant=default/fpc-topology'
@@ -30,7 +31,8 @@
                 ],
                 "node-id": "node'$1'",
                 "network-id": "network'$1'",
-                "control-protocol": "zmq-dpn-control-protocol"
+                "control-protocol": "zmq-dpn-control-protocol",
+                "abstract": false
             }
         ]
     }' 'http://localhost:8181/onos/restconf/data/ietf-dmm-fpcagent:tenants/tenant='$2'/fpc-topology'
diff --git a/scripts/benchmark.sh b/scripts/benchmark.sh
index 08e90c5..0e2bbc5 100755
--- a/scripts/benchmark.sh
+++ b/scripts/benchmark.sh
@@ -1,10 +1,11 @@
 #!/bin/sh
 
-rm -rf create.log delete.log
-
-./registerClient.sh 1 default &> /dev/null
+echo "Register Client.."
+./registerClient.sh 1 &> /dev/null
+echo "Add DPN.."
 ./addDPN.sh 1 &> /dev/null 
 
+echo "Running 100 configure create.."
 for (( i=1; i<=100; i++)); do
 	./configure.sh create $i 1 &> /dev/null &
 	if ! (($i % 10)); then
@@ -14,6 +15,7 @@
 
 wait
 
+echo "Running 100 configure delete.."
 for (( i=1; i<=100; i++)); do
 	./configure.sh delete $i &> /dev/null &
 	if ! (($i % 10)); then
@@ -21,5 +23,7 @@
 	fi
 done
 
+echo "Delete DPN.."
 ./deleteDPN.sh 1 &> /dev/null
+echo "Deregister Client.."
 ./deregisterClient.sh 1 &> /dev/null
diff --git a/scripts/forwarder_device.py b/scripts/forwarder_controller.py
similarity index 91%
copy from scripts/forwarder_device.py
copy to scripts/forwarder_controller.py
index 04f2a18..e7231ec 100755
--- a/scripts/forwarder_device.py
+++ b/scripts/forwarder_controller.py
@@ -15,13 +15,13 @@
 
         # Socket facing clients
         frontend = context.socket(zmq.SUB)
-        frontend.bind("tcp://*:5559")
+        frontend.bind("tcp://*:5555")
         
         frontend.setsockopt(zmq.SUBSCRIBE, "")
         
          # Socket facing services
         backend = context.socket(zmq.PUB)
-        backend.bind("tcp://*:5560")
+        backend.bind("tcp://*:5556")
 
 
         zmq.device(zmq.FORWARDER, frontend, backend)
diff --git a/scripts/forwarder_device.py b/scripts/forwarder_dp.py
similarity index 91%
rename from scripts/forwarder_device.py
rename to scripts/forwarder_dp.py
index 04f2a18..e8ea572 100755
--- a/scripts/forwarder_device.py
+++ b/scripts/forwarder_dp.py
@@ -15,13 +15,13 @@
 
         # Socket facing clients
         frontend = context.socket(zmq.SUB)
-        frontend.bind("tcp://*:5559")
+        frontend.bind("tcp://*:5565")
         
         frontend.setsockopt(zmq.SUBSCRIBE, "")
         
          # Socket facing services
         backend = context.socket(zmq.PUB)
-        backend.bind("tcp://*:5560")
+        backend.bind("tcp://*:5566")
 
 
         zmq.device(zmq.FORWARDER, frontend, backend)
diff --git a/scripts/forwarder_subscriber_with_ACK.py b/scripts/forwarder_subscriber_with_ACK.py
index fbc5088..9bf086b 100755
--- a/scripts/forwarder_subscriber_with_ACK.py
+++ b/scripts/forwarder_subscriber_with_ACK.py
@@ -62,8 +62,8 @@
 
     print "Ready to receive messages. Press Ctrl+C when ready to exit."
 
-subscriber_uri = "tcp://localhost:5560"
-publisher_uri = "tcp://localhost:5559"
+subscriber_uri = "tcp://localhost:5556"
+publisher_uri = "tcp://localhost:5565"
 # Socket to talk to server
 context = zmq.Context()
 sub_socket = context.socket(zmq.SUB)
diff --git a/scripts/registerClient.sh b/scripts/registerClient.sh
index 36d108a..a7cd5c4 100755
--- a/scripts/registerClient.sh
+++ b/scripts/registerClient.sh
@@ -20,6 +20,26 @@
         }
     }' 'http://localhost:8181/onos/restconf/operations/fpc:register-client'
     echo ""
+elif [ "$#" -eq 1 ]; then
+    echo ""
+    curl -i -s \
+    --header "Content-type: application/json" \
+    --request POST \
+    -u onos:rocks \
+    --data '{
+        "input": {
+            "client-id": "'$1'",
+            "tenant-id": "default",
+            "supported-features": [
+                "urn:ietf:params:xml:ns:yang:fpcagent:fpc-bundles",
+                "urn:ietf:params:xml:ns:yang:fpcagent:operation-ref-scope",
+                "urn:ietf:params:xml:ns:yang:fpcagent:fpc-agent-assignments",
+                "urn:ietf:params:xml:ns:yang:fpcagent:instruction-bitset"
+            ],
+        "endpoint-uri": "http://127.0.0.1:9997/"
+        }
+    }' 'http://localhost:8181/onos/restconf/operations/fpc:register-client'
+    echo ""
 else
     echo "usage: "$0" clientId tenantId"
 fi
