diff --git a/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py b/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
index 6b40a5f..c31bcfa 100644
--- a/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
+++ b/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
@@ -351,8 +351,7 @@
             self.add_port(port_no=ASFVOLT_NNI_PORT,
                           port_type=Port.ETHERNET_NNI,
                           label='NNI facing Ethernet port')
-            self.logical_device_id = \
-                self.add_logical_device(device_id=device.id)
+            self.add_logical_device(device_id=device.id)
             self.add_logical_port(port_no=ASFVOLT_NNI_PORT,
                                   port_type=Port.ETHERNET_NNI,
                                   device_id=device.id,
@@ -755,8 +754,24 @@
                 break
         self.adapter_agent.delete_port(self.device_id, port)
 
+    @inlineCallbacks
     def add_logical_device(self, device_id):
         self.log.info('adding-logical-device', device_id=device_id)
+        # Initialze default values for dpid and serial_num
+        dpid = None
+        serial_num = self.host_and_port
+
+        try:
+            asfvolt_system_info = \
+                yield self.bal.get_asfvolt_system_info(device_id)
+            if asfvolt_system_info is not None:
+                if asfvolt_system_info.mac_address is not None:
+                    dpid = asfvolt_system_info.mac_address
+                if asfvolt_system_info.serial_num is not None:
+                    serial_num = asfvolt_system_info.serial_num
+        except Exception as e:
+            self.log.error('using-default-values', exc=str(e))
+
         ld = LogicalDevice(
             # not setting id and datapth_id will let the adapter
             # agent pick id
@@ -765,7 +780,7 @@
                 hw_desc='n/a',
                 sw_desc='logical device for Edgecore ASFvOLT16 OLT',
                 #serial_num=uuid4().hex,
-                serial_num=self.host_and_port,
+                serial_num=serial_num,
                 dp_desc='n/a'
             ),
             switch_features=ofp_switch_features(
@@ -780,8 +795,8 @@
             ),
             root_device_id=device_id
         )
-        ld_initialized = self.adapter_agent.create_logical_device(ld)
-        return ld_initialized.id
+        ld_initialized = self.adapter_agent.create_logical_device(ld, dpid=dpid)
+        self.logical_device_id = ld_initialized.id
 
     def add_logical_port(self, port_no, port_type,
                          device_id, logical_device_id):
diff --git a/voltha/adapters/asfvolt16_olt/bal.py b/voltha/adapters/asfvolt16_olt/bal.py
index 9237ee4..e0cab9f 100644
--- a/voltha/adapters/asfvolt16_olt/bal.py
+++ b/voltha/adapters/asfvolt16_olt/bal.py
@@ -16,7 +16,7 @@
 
 from twisted.internet.defer import inlineCallbacks, returnValue
 from voltha.adapters.asfvolt16_olt.protos import bal_pb2, \
-    bal_model_types_pb2, bal_model_ids_pb2, bal_indications_pb2
+    bal_model_types_pb2, bal_model_ids_pb2, bal_indications_pb2, asfvolt_pb2
 from voltha.adapters.asfvolt16_olt.grpc_client import GrpcClient
 from voltha.adapters.asfvolt16_olt.asfvolt16_ind_handler \
                                        import Asfvolt16IndHandler
@@ -50,6 +50,7 @@
         self.grpc_client.connect(host_and_port)
         self.stub = bal_pb2.BalStub(self.grpc_client.channel)
         self.ind_stub = bal_indications_pb2.BalGetIndStub(self.grpc_client.channel)
+        self.asfvolt_stub = asfvolt_pb2.AsfvoltStub(self.grpc_client.channel)
         self.olt.running = True
 
         # Right now Bi-Directional GRPC support is not there in grpc-c.
@@ -505,6 +506,21 @@
         except Exception as e:
             self.log.info('OLT-HeartBeat-failed', exc=str(e))
 
+    @inlineCallbacks
+    def get_asfvolt_system_info(self, device_id):
+        self.log.info('get-asfvolt-system-info')
+        try:
+            obj = bal_pb2.BalDefault()
+            obj.device_id = device_id
+            asfvolt_system_info = \
+                 yield self.asfvolt_stub.AsfvoltGetSystemInfo(obj, timeout=GRPC_TIMEOUT)
+            self.log.debug('asf-volt-system-info',
+                            asfvolt_system_info=asfvolt_system_info)
+            returnValue(asfvolt_system_info)
+        except Exception as e:
+            self.log.error('get-asfvolt-system-info-failed', exc=str(e))
+            returnValue(None)
+
     def get_indication_info(self, device_id):
         while self.olt.running:
             try:
diff --git a/voltha/adapters/asfvolt16_olt/protos/asfvolt.proto b/voltha/adapters/asfvolt16_olt/protos/asfvolt.proto
new file mode 100644
index 0000000..71869b6
--- /dev/null
+++ b/voltha/adapters/asfvolt16_olt/protos/asfvolt.proto
@@ -0,0 +1,41 @@
+//
+// Copyright 2017 the original author or authors.
+//
+// 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.
+//
+
+syntax = "proto3";
+
+import "bal.proto";
+
+message AsfSystemInfo {
+    string product_name      = 1;
+    string part_num          = 2;
+    string serial_num        = 3;
+    string mac_address       = 4;
+    string mac_range         = 5;
+    string manufacturer      = 6;
+    string manufacture_date  = 7;
+    string vendor            = 8;
+    string platform_name     = 9;
+    string label_revision    = 10;
+    string country_code      = 11;
+    string diag_version      = 12;
+    string onie_version      = 13;
+}
+
+service Asfvolt {
+    /* The grpc-c doesn't accept empty parameters in the RPC request.
+       Hence filling in some default message in the RPC request */
+    rpc AsfvoltGetSystemInfo(BalDefault) returns(AsfSystemInfo) {};
+}
