diff --git a/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py b/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
index c4279fe..b589398 100644
--- a/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
+++ b/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
@@ -336,6 +336,7 @@
                                   port_type=Port.ETHERNET_NNI,
                                   device_id=device.id,
                                   logical_device_id=self.logical_device_id)
+            reactor.callInThread(self.bal.get_indication_info, self.device_id)
 
         self.bal.activate_olt()
 
@@ -578,7 +579,6 @@
 
     def BalIfaceIndication(self, device_id, Iface_ID):
         self.log.info('Interface Indication')
-        import pdb;pdb.set_trace()
         device = self.adapter_agent.get_device(self.device_id)
         self._handle_pon_pm_counter_req_towards_device(device,Iface_ID)
 
diff --git a/voltha/adapters/asfvolt16_olt/asfvolt16_ind_handler.py b/voltha/adapters/asfvolt16_olt/asfvolt16_ind_handler.py
new file mode 100755
index 0000000..6648376
--- /dev/null
+++ b/voltha/adapters/asfvolt16_olt/asfvolt16_ind_handler.py
@@ -0,0 +1,387 @@
+#
+# 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.
+#
+
+"""
+Asfvolt16 OLT adapter
+"""
+from twisted.internet import reactor
+from common.utils.grpc_utils import twisted_async
+from voltha.adapters.asfvolt16_olt.protos import bal_indications_pb2
+from voltha.adapters.asfvolt16_olt.protos import bal_model_types_pb2, \
+    bal_errno_pb2, bal_pb2, bal_model_ids_pb2
+from voltha.adapters.asfvolt16_olt.grpc_server import GrpcServer
+
+
+class Asfvolt16IndHandler(object):
+    def __init__(self, log):
+        self.log = log
+
+    def bal_acc_term_oper_sta_cng_ind(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['_object_type'] = 'access_terminal_indication'
+        ind_info['_sub_group_type'] = 'oper_state_change'
+        bal_err = bal_pb2.BalErr()
+        return bal_err
+
+    def bal_acc_term_ind(self, indication, device_handler):
+        #     ind_info: {'_object_type': <str>
+        #                'actv_status': <str>}
+        ind_info = dict()
+        ind_info['_object_type'] = 'access_terminal_indication'
+        ind_info['_sub_group_type'] = 'access_terminal_indication'
+        if indication.access_term_ind.data.admin_state == \
+                bal_model_types_pb2.BAL_STATE_UP:
+            ind_info['activation_successful'] = True
+        else:
+            ind_info['activation_successful'] = False
+
+        reactor.callLater(0,
+                          device_handler.handle_access_term_ind,
+                          ind_info,
+                          indication.access_term_ind.key.access_term_id)
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_flow_oper_sts_cng(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['_object_type'] = 'flow_indication'
+        ind_info['_sub_group_type'] = 'oper_state_change'
+        ind_info['_object_type'] = indication.objType
+        ind_info['_sub_group_type'] = indication.sub_group
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_flow_ind(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['_object_type'] = 'flow_indication'
+        ind_info['_sub_group_type'] = 'flow_indication'
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_group_ind(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['_object_type'] = 'group_indication'
+        ind_info['_sub_group_type'] = 'group_indication'
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_iface_oper_sts_cng(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['_object_type'] = 'interface_indication'
+        ind_info['_sub_group_type'] = 'oper_state_change'
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_iface_los(self, indication, device_handler):
+        los_status = indication.interface_los.data.status
+        if los_status != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
+            balIfaceLos_dict = {}
+            balIfaceLos_dict["los_status"] = los_status.__str__()
+            reactor.callLater(0, \
+                              device_handler.BalIfaceLosAlarm, \
+                              indication.device_id, \
+                              indication.interface_los.key.intf_id, \
+                              los_status, balIfaceLos_dict)
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_iface_ind(self, indication, device_handler):
+        self.log.info('Awaiting ONU discovery')
+        reactor.callLater(0,\
+                          device_handler.BalIfaceIndication,\
+                          indication.device_id.decode('unicode-escape'),\
+                          indication.interface_ind.key.intf_id)
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_iface_stat(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['_object_type'] = 'interface_indication'
+        ind_info['_sub_group_type'] = 'stat_indication'
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_subs_term_oper_sts_cng(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['_object_type'] = 'sub_term_indication'
+        ind_info['_sub_group_type'] = 'oper_state_change'
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_subs_term_discovery_ind(self, indication, device_handler):
+        #     ind_info: {'object_type': <int>
+        #                '_sub_group_type': <str>
+        #                '_device_id': <str>
+        #                '_pon_id' : <int>
+        #                'onu_id' : <int>
+        #                '_vendor_id' : <str>
+        #                '__vendor_specific' : <str>
+        #                'activation_successful':[True or False]}
+        onu_data = indication.terminal_disc
+        ind_info = dict()
+        ind_info['_object_type'] = 'sub_term_indication'
+        ind_info['_sub_group_type'] = 'onu_discovery'
+        ind_info['_pon_id'] = onu_data.key.intf_id
+        ind_info['onu_id'] = onu_data.key.sub_term_id
+        ind_info['_vendor_id'] = onu_data.data.serial_number.vendor_id
+        ind_info['_vendor_specific'] = \
+            onu_data.data.serial_number.vendor_specific
+        reactor.callLater(0,
+                          device_handler.handle_sub_term_ind,
+                          ind_info)
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_subs_term_alarm_ind(self, indication, device_handler):
+        # Loss of signal
+        los = indication.terminal_alarm.data.alarm.los
+        # Loss of busrt
+        lob = indication.terminal_alarm.data.alarm.lob
+        # Loss of PLOAM miss channel
+        lopc_miss = indication.terminal_alarm.data.alarm.lopc_miss
+        # Loss of PLOAM channel
+        lopc_mic_error = indication.terminal_alarm.data.alarm.lopc_mic_error
+
+        balSubTermAlarm_Dict = {}
+        balSubTermAlarm_Dict["LOS Status"] = los.__str__()
+        balSubTermAlarm_Dict["LOB Status"] = lob.__str__()
+        balSubTermAlarm_Dict["LOPC MISS Status"] = lopc_miss.__str__()
+        balSubTermAlarm_Dict["LOPC MIC ERROR Status"] = lopc_mic_error.__str__()
+
+        if los != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
+            reactor.callLater(0, device_handler.BalSubsTermLosAlarm, \
+                              indication.terminal_alarm.key.intf_id, \
+                              los, balSubTermAlarm_Dict)
+
+        if lob != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
+            reactor.callLater(0, device_handler.BalSubsTermLobAlarm, \
+                              indication.terminal_alarm.key.intf_id, \
+                              lob, balSubTermAlarm_Dict)
+
+        if lopc_miss != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
+            reactor.callLater(0, device_handler.BalSubsTermLopcMissAlarm, \
+                              indication.terminal_alarm.key.intf_id, \
+                              lopc_miss, balSubTermAlarm_Dict)
+
+        if lopc_mic_error != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
+            reactor.callLater(0, device_handler.BalSubsTermLopcMicErrorAlarm, \
+                              indication.terminal_alarm.key.intf_id, \
+                              lopc_mic_error, balSubTermAlarm_Dict)
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_subs_term_dgi_ind(self, indication, device_handler):
+        #     ind_info: {'_object_type': <str>
+        #                '_device_id': <str>
+        #                '_pon_id' : <int>
+        #                'onu_id' : <int>
+        #                '_vendor_id' : <str>
+        #                '__vendor_specific' : <str>
+        #                'activation_successful':[True or False]}
+        dgi_status = indication.terminal_dgi.data.dgi_status
+        if dgi_status != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
+            ind_info = dict()
+            ind_info['_object_type'] = 'sub_term_indication'
+            ind_info['_sub_group_type'] = 'dgi_indication'
+
+            balSubTermDgi_Dict = {}
+            balSubTermDgi_Dict["dgi_status"] = dgi_status.__str__()
+            reactor.callLater(0,
+                              device_handler.BalSubsTermDgiAlarm, \
+                              indication.device_id, \
+                              indication.terminal_dgi.key.intf_id,\
+                              indication.terminal_dgi.key.sub_term_id, \
+                              dgi_status,balSubTermDgi_Dict, ind_info)
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_subs_term_ind(self, indication, device_handler):
+        #     ind_info: {'_object_type': <str>
+        #                '_sub_group_type': <str>
+        #                '_device_id': <str>
+        #                '_pon_id' : <int>
+        #                'onu_id' : <int>
+        #                '_vendor_id' : <str>
+        #                '__vendor_specific' : <str>
+        #                'activation_successful':[True or False]}
+        onu_data = indication.terminal_ind
+        ind_info = dict()
+        ind_info['_object_type'] = 'sub_term_indication'
+        ind_info['_sub_group_type'] = 'sub_term_indication'
+        ind_info['_pon_id'] = onu_data.key.intf_id
+        ind_info['onu_id'] = onu_data.key.sub_term_id
+        ind_info['_vendor_id'] = onu_data.data.serial_number.vendor_id
+        ind_info['_vendor_specific'] = \
+            onu_data.data.serial_number.vendor_specific
+        if (bal_model_types_pb2.BAL_STATE_DOWN == onu_data.data.admin_state):
+            ind_info['activation_successful'] = False
+        elif (bal_model_types_pb2.BAL_STATE_UP == onu_data.data.admin_state):
+            ind_info['activation_successful'] = True
+
+        reactor.callLater(0,
+                          device_handler.handle_sub_term_ind,
+                          ind_info)
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_tm_queue_ind_info(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['_object_type'] = 'tm_q_indication'
+        ind_info['_sub_group_type'] = 'tm_q_indication'
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_tm_sched_ind_info(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['_object_type'] = 'tm_sched_indication'
+        ind_info['_sub_group_type'] = 'tm_sched_indication'
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_pkt_bearer_channel_rx_ind(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['flow_id'] = indication.pktData.data.flow_id
+        ind_info['flow_type'] = indication.pktData.data.flow_type
+        ind_info['intf_id'] = indication.pktData.data.intf_id
+        ind_info['intf_type'] = indication.pktData.data.intf_type
+        ind_info['svc_port'] = indication.pktData.data.svc_port
+        ind_info['flow_cookie'] = indication.pktData.data.flow_cookie
+        ind_info['packet'] = indication.pktData.data.pkt
+        reactor.callLater(0,
+                          device_handler.handle_packet_in,
+                          ind_info)
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_pkt_omci_channel_rx_ind(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['_object_type'] = 'packet_in_indication'
+        ind_info['_sub_group_type'] = 'omci_message'
+        packet_data = indication.balOmciResp.key.packet_send_dest
+        ind_info['onu_id'] = packet_data.itu_omci_channel.sub_term_id
+        ind_info['packet'] = indication.balOmciResp.data.pkt
+        self.log.info('ONU Id is',
+                      onu_id=packet_data.itu_omci_channel.sub_term_id)
+        reactor.callLater(0,
+                          device_handler.handle_omci_ind,
+                          ind_info)
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def bal_pkt_ieee_oam_channel_rx_ind(self, indication, device_handler):
+        ind_info = dict()
+        ind_info['_object_type'] = 'packet_in_indication'
+        ind_info['_sub_group_type'] = 'ieee_oam_message'
+        bal_err = bal_pb2.BalErr()
+        bal_err.err = bal_errno_pb2.BAL_ERR_OK
+        return bal_err
+
+    def handle_indication_from_bal(self, bal_ind, device_handler):
+        indication_handler = self.indication_handler_map.get((bal_ind.objType,
+                                                              bal_ind.sub_group),
+                                                              None)
+        if indication_handler is None:
+            self.log.debug('No handler', objType=bal_ind.objType,
+                                         sub_group=bal_ind.sub_group)
+            pass  # no-op
+        else:
+            indication_handler(self, bal_ind, device_handler)
+
+    indication_handler_map = {
+        (bal_model_ids_pb2.BAL_OBJ_ID_ACCESS_TERMINAL,
+         bal_model_ids_pb2.BAL_ACCESS_TERMINAL_AUTO_ID_IND):
+            bal_acc_term_ind,
+        (bal_model_ids_pb2.BAL_OBJ_ID_ACCESS_TERMINAL,
+         bal_model_ids_pb2.BAL_ACCESS_TERMINAL_AUTO_ID_OPER_STATUS_CHANGE):
+            bal_acc_term_oper_sta_cng_ind,
+
+        (bal_model_ids_pb2.BAL_OBJ_ID_FLOW,
+         bal_model_ids_pb2.BAL_FLOW_AUTO_ID_OPER_STATUS_CHANGE):
+            bal_flow_oper_sts_cng,
+        (bal_model_ids_pb2.BAL_OBJ_ID_FLOW,
+         bal_model_ids_pb2.BAL_FLOW_AUTO_ID_IND):
+            bal_flow_ind,
+
+        (bal_model_ids_pb2.BAL_OBJ_ID_GROUP,
+         bal_model_ids_pb2.BAL_GROUP_AUTO_ID_IND):
+            bal_group_ind,
+
+        (bal_model_ids_pb2.BAL_OBJ_ID_INTERFACE,
+         bal_model_ids_pb2.BAL_INTERFACE_AUTO_ID_IND):
+            bal_iface_ind,
+        (bal_model_ids_pb2.BAL_OBJ_ID_INTERFACE,
+         bal_model_ids_pb2.BAL_INTERFACE_AUTO_ID_LOS):
+            bal_iface_los,
+        (bal_model_ids_pb2.BAL_OBJ_ID_INTERFACE,
+         bal_model_ids_pb2.BAL_INTERFACE_AUTO_ID_IND):
+            bal_iface_oper_sts_cng,
+
+        (bal_model_ids_pb2.BAL_OBJ_ID_SUBSCRIBER_TERMINAL,
+         bal_model_ids_pb2.\
+         BAL_SUBSCRIBER_TERMINAL_AUTO_ID_OPER_STATUS_CHANGE):
+            bal_subs_term_oper_sts_cng,
+        (bal_model_ids_pb2.BAL_OBJ_ID_SUBSCRIBER_TERMINAL,
+         bal_model_ids_pb2.\
+         BAL_SUBSCRIBER_TERMINAL_AUTO_ID_SUB_TERM_DISC):
+            bal_subs_term_discovery_ind,
+        (bal_model_ids_pb2.BAL_OBJ_ID_SUBSCRIBER_TERMINAL,
+         bal_model_ids_pb2.\
+         BAL_SUBSCRIBER_TERMINAL_AUTO_ID_SUB_TERM_ALARM):
+            bal_subs_term_alarm_ind,
+        (bal_model_ids_pb2.BAL_OBJ_ID_SUBSCRIBER_TERMINAL,
+         bal_model_ids_pb2.\
+         BAL_SUBSCRIBER_TERMINAL_AUTO_ID_DGI):
+            bal_subs_term_dgi_ind,
+        (bal_model_ids_pb2.BAL_OBJ_ID_SUBSCRIBER_TERMINAL,
+         bal_model_ids_pb2.\
+         BAL_SUBSCRIBER_TERMINAL_AUTO_ID_IND):
+            bal_subs_term_ind,
+
+        (bal_model_ids_pb2.BAL_OBJ_ID_TM_QUEUE,
+         bal_model_ids_pb2.BAL_TM_QUEUE_AUTO_ID_IND):
+            bal_tm_queue_ind_info,
+
+        (bal_model_ids_pb2.BAL_OBJ_ID_TM_SCHED,
+         bal_model_ids_pb2.BAL_TM_SCHED_AUTO_ID_IND):
+            bal_tm_sched_ind_info,
+
+        (bal_model_ids_pb2.BAL_OBJ_ID_PACKET,
+         bal_model_ids_pb2.BAL_PACKET_AUTO_ID_BEARER_CHANNEL_RX):
+            bal_pkt_bearer_channel_rx_ind,
+        (bal_model_ids_pb2.BAL_OBJ_ID_PACKET,
+         bal_model_ids_pb2.BAL_PACKET_AUTO_ID_ITU_OMCI_CHANNEL_RX):
+            bal_pkt_omci_channel_rx_ind,
+        (bal_model_ids_pb2.BAL_OBJ_ID_PACKET,
+         bal_model_ids_pb2.BAL_PACKET_AUTO_ID_IEEE_OAM_CHANNEL_RX):
+            bal_pkt_ieee_oam_channel_rx_ind,
+    }
diff --git a/voltha/adapters/asfvolt16_olt/asfvolt16_rx_handler.py b/voltha/adapters/asfvolt16_olt/asfvolt16_rx_handler.py
index 64b3ca6..7113aae 100644
--- a/voltha/adapters/asfvolt16_olt/asfvolt16_rx_handler.py
+++ b/voltha/adapters/asfvolt16_olt/asfvolt16_rx_handler.py
@@ -23,6 +23,7 @@
 from voltha.adapters.asfvolt16_olt.protos import bal_model_types_pb2, \
     bal_errno_pb2, bal_pb2
 from voltha.adapters.asfvolt16_olt.grpc_server import GrpcServer
+from voltha.adapters.asfvolt16_olt.asfvolt16_ind_handler import Asfvolt16IndHandler
 
 
 class Asfvolt16RxHandler(object):
@@ -34,6 +35,7 @@
         self.grpc_server = None
         self.grpc_server_port = port
         self.log = log
+        self.ind_handler = Asfvolt16IndHandler(log)
 
     def start(self):
         self.grpc_server = GrpcServer(self.grpc_server_port, self, self.log)
@@ -48,9 +50,8 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Not implemented yet',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['_object_type'] = 'access_terminal_indication'
-        ind_info['_sub_group_type'] = 'oper_state_change'
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_acc_term_oper_sts_cng_ind(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -60,21 +61,8 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Received access terminal Indication',
                       device_id=device_id, obj_type=request.objType)
-        #     ind_info: {'_object_type': <str>
-        #                'actv_status': <str>}
-        ind_info = dict()
-        ind_info['_object_type'] = 'access_terminal_indication'
-        ind_info['_sub_group_type'] = 'access_terminal_indication'
-        if request.access_term_ind.data.admin_state == \
-                bal_model_types_pb2.BAL_STATE_UP:
-            ind_info['activation_successful'] = True
-        else:
-            ind_info['activation_successful'] = False
-
         device_handler = self.adapter.devices_handlers[device_id]
-        reactor.callLater(0,
-                          device_handler.handle_access_term_ind,
-                          ind_info,request.access_term_ind.key.access_term_id)
+        self.ind_handler.bal_acc_term_ind(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -84,11 +72,8 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Not implemented yet',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['_object_type'] = 'flow_indication'
-        ind_info['_sub_group_type'] = 'oper_state_change'
-        ind_info['_object_type'] = request.objType
-        ind_info['_sub_group_type'] = request.sub_group
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_flow_oper_sts_cng(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -98,9 +83,8 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Not implemented yet',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['_object_type'] = 'flow_indication'
-        ind_info['_sub_group_type'] = 'flow_indication'
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_flow_ind(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -110,9 +94,8 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Not implemented yet',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['_object_type'] = 'group_indication'
-        ind_info['_sub_group_type'] = 'group_indication'
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_group_ind(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -122,9 +105,8 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Not implemented yet',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['_object_type'] = 'interface_indication'
-        ind_info['_sub_group_type'] = 'oper_state_change'
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_iface_oper_sts_cng(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -134,21 +116,8 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Interface Loss Of Signal Alarm',\
                       device_id=device_id, obj_type=request.objType)
-        los_status = request.interface_los.data.status
-        if los_status != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
-
-           balIfaceLos_dict = { }
-           balIfaceLos_dict["los_status"]=los_status.__str__()
-
-           device_handler = self.adapter.devices_handlers[device_id]
-           reactor.callLater(0,\
-                             device_handler.BalIfaceLosAlarm,\
-                             device_id,request.interface_los.key.intf_id,\
-                             los_status,balIfaceLos_dict)
-
-        ind_info = dict()
-        ind_info['_object_type'] = 'interface_indication'
-        ind_info['_sub_group_type'] = 'loss_of_signal'
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_iface_los(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -158,10 +127,8 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Interface indication Received',
                       device_id=device_id, obj_type=request.objType)
-        self.log.info('Awaiting ONU discovery')
-        reactor.callLater(0,\
-                          device_handler.BalIfaceIndication,\
-                          device_id,request.interface_ind.key.intf_id)
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_iface_ind(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -171,9 +138,8 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Not implemented yet',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['_object_type'] = 'interface_indication'
-        ind_info['_sub_group_type'] = 'stat_indication'
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_iface_stat(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -183,41 +149,19 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Not implemented yet',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['_object_type'] = 'sub_term_indication'
-        ind_info['_sub_group_type'] = 'oper_state_change'
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_subs_term_oper_sts_cng(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
 
     @twisted_async
     def BalSubsTermDiscoveryInd(self, request, context):
-        #     ind_info: {'object_type': <int>
-        #                '_sub_group_type': <str>
-        #                '_device_id': <str>
-        #                '_pon_id' : <int>
-        #                'onu_id' : <int>
-        #                '_vendor_id' : <str>
-        #                '__vendor_specific' : <str>
-        #                'activation_successful':[True or False]}
-
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Subscriber terminal discovery Indication',
                       device_id=device_id, obj_type=request.objType)
-        onu_data = request.terminal_disc
-        ind_info = dict()
-        ind_info['_object_type'] = 'sub_term_indication'
-        ind_info['_sub_group_type'] = 'onu_discovery'
-        ind_info['_device_id'] = device_id
-        ind_info['_pon_id'] = onu_data.key.intf_id
-        ind_info['onu_id'] = onu_data.key.sub_term_id
-        ind_info['_vendor_id'] = onu_data.data.serial_number.vendor_id
-        ind_info['_vendor_specific'] = \
-            onu_data.data.serial_number.vendor_specific
         device_handler = self.adapter.devices_handlers[device_id]
-        reactor.callLater(0,
-                          device_handler.handle_sub_term_ind,
-                          ind_info)
+        self.ind_handler.bal_subs_term_discovery_ind(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -227,115 +171,30 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('ONU Alarms for Subscriber Terminal',\
                       device_id=device_id, obj_type=request.objType)
-        #Loss of signal
-        los = request.terminal_alarm.data.alarm.los
-        #Loss of busrt
-        lob = request.terminal_alarm.data.alarm.lob
-        #Loss of PLOAM miss channel
-        lopc_miss = request.terminal_alarm.data.alarm.lopc_miss
-        #Loss of PLOAM channel
-        lopc_mic_error = request.terminal_alarm.data.alarm.lopc_mic_error
-
-        balSubTermAlarm_Dict = { }
-        balSubTermAlarm_Dict["LOS Status"]=los.__str__()
-        balSubTermAlarm_Dict["LOB Status"]=lob.__str__()
-        balSubTermAlarm_Dict["LOPC MISS Status"]=lopc_miss.__str__()
-        balSubTermAlarm_Dict["LOPC MIC ERROR Status"]=lopc_mic_error.__str__()
-
         device_handler = self.adapter.devices_handlers[device_id]
-
-        if los != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
-           reactor.callLater(0, device_handler.BalSubsTermLosAlarm,\
-                             device_id,request.terminal_alarm.key.intf_id,\
-                             los, balSubTermAlarm_Dict)
-
-        if lob != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
-           reactor.callLater(0, device_handler.BalSubsTermLobAlarm,\
-                             device_id,request.terminal_alarm.key.intf_id,\
-                             lob, balSubTermAlarm_Dict)
-
-        if lopc_miss != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
-           reactor.callLater(0, device_handler.BalSubsTermLopcMissAlarm,\
-                             device_id,request.terminal_alarm.key.intf_id,\
-                             lopc_miss, balSubTermAlarm_Dict)
-
-        if lopc_mic_error != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
-           reactor.callLater(0, device_handler.BalSubsTermLopcMicErrorAlarm,\
-                             device_id,request.terminal_alarm.key.intf_id,\
-                             lopc_mic_error, balSubTermAlarm_Dict)
-
+        self.ind_handler.bal_subs_term_alarm_ind(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
 
     @twisted_async
     def BalSubsTermDgiInd(self, request, context):
-        self.log.info('Subscriber terminal Indication received')
-        #     ind_info: {'_object_type': <str>
-        #                '_device_id': <str>
-        #                '_pon_id' : <int>
-        #                'onu_id' : <int>
-        #                '_vendor_id' : <str>
-        #                '__vendor_specific' : <str>
-        #                'activation_successful':[True or False]}
         device_id = request.device_id.decode('unicode-escape')
-        self.log.info('Subscriber terminal dying gasp',\
+        self.log.info('Subscriber terminal dying gasp', \
                       device_id=device_id, obj_type=request.objType)
-
-        dgi_status = request.terminal_dgi.data.dgi_status
-
-        if dgi_status != bal_model_types_pb2.BAL_ALARM_STATUS_NO__CHANGE:
-
-           ind_info = dict()
-           ind_info['_object_type'] = 'sub_term_indication'
-           ind_info['_sub_group_type'] = 'dgi_indication'
-
-           balSubTermDgi_Dict = { }
-           balSubTermDgi_Dict["dgi_status"]=dgi_status.__str__()
-
-           device_handler = self.adapter.devices_handlers[device_id]
-           reactor.callLater(0,
-                             device_handler.BalSubsTermDgiAlarm,
-                             device_id,request.terminal_dgi.key.intf_id,\
-                             request.terminal_dgi.key.sub_term_id, \
-                             dgi_status,balSubTermDgi_Dict, ind_info)
-
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_subs_term_dgi_ind(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
 
     @twisted_async
     def BalSubsTermInd(self, request, context):
-        #     ind_info: {'_object_type': <str>
-        #                '_sub_group_type': <str>
-        #                '_device_id': <str>
-        #                '_pon_id' : <int>
-        #                'onu_id' : <int>
-        #                '_vendor_id' : <str>
-        #                '__vendor_specific' : <str>
-        #                'activation_successful':[True or False]}
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Subscriber terminal indication received',
                       device_id=device_id, obj_type=request.objType)
-        onu_data = request.terminal_ind
-        ind_info = dict()
-        ind_info['_object_type'] = 'sub_term_indication'
-        ind_info['_sub_group_type'] = 'sub_term_indication'
-        ind_info['_device_id'] = device_id
-        ind_info['_pon_id'] = onu_data.key.intf_id
-        ind_info['onu_id'] = onu_data.key.sub_term_id
-        ind_info['_vendor_id'] = onu_data.data.serial_number.vendor_id
-        ind_info['_vendor_specific'] = \
-            onu_data.data.serial_number.vendor_specific
-        if (bal_model_types_pb2.BAL_STATE_DOWN == onu_data.data.admin_state):
-            ind_info['activation_successful'] = False
-        elif (bal_model_types_pb2.BAL_STATE_UP == onu_data.data.admin_state):
-            ind_info['activation_successful'] = True
-
         device_handler = self.adapter.devices_handlers[device_id]
-        reactor.callLater(0,
-                          device_handler.handle_sub_term_ind,
-                          ind_info)
+        self.ind_handler.bal_subs_term_ind(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -345,9 +204,8 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Not implemented yet',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['_object_type'] = 'tm_q_indication'
-        ind_info['_sub_group_type'] = 'tm_q_indication'
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_tm_queue_ind_info(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -357,9 +215,8 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Not implemented yet',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['_object_type'] = 'tm_sched_indication'
-        ind_info['_sub_group_type'] = 'tm_sched_indication'
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_tm_sched_ind_info(request, device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -369,18 +226,9 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Received Packet-In',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['flow_id'] = request.pktData.data.flow_id
-        ind_info['flow_type'] = request.pktData.data.flow_type
-        ind_info['intf_id'] = request.pktData.data.intf_id
-        ind_info['intf_type'] = request.pktData.data.intf_type
-        ind_info['svc_port'] = request.pktData.data.svc_port
-        ind_info['flow_cookie'] = request.pktData.data.flow_cookie
-        ind_info['packet'] = request.pktData.data.pkt
         device_handler = self.adapter.devices_handlers[device_id]
-        reactor.callLater(0,
-                          device_handler.handle_packet_in,
-                          ind_info)
+        self.ind_handler.bal_pkt_bearer_channel_rx_ind(request,
+                                                       device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -390,20 +238,9 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Received OMCI Messages',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['_object_type'] = 'packet_in_indication'
-        ind_info['_sub_group_type'] = 'omci_message'
-        ind_info['_device_id'] = device_id
-        packet_data = request.balOmciResp.key.packet_send_dest
-        ind_info['onu_id'] = packet_data.itu_omci_channel.sub_term_id
-        ind_info['packet'] = request.balOmciResp.data.pkt
-        self.log.info('ONU Id is',
-                      onu_id=packet_data.itu_omci_channel.sub_term_id)
-
         device_handler = self.adapter.devices_handlers[device_id]
-        reactor.callLater(0,
-                          device_handler.handle_omci_ind,
-                          ind_info)
+        self.ind_handler.bal_pkt_omci_channel_rx_ind(request,
+                                                     device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
@@ -413,9 +250,9 @@
         device_id = request.device_id.decode('unicode-escape')
         self.log.info('Not implemented yet',
                       device_id=device_id, obj_type=request.objType)
-        ind_info = dict()
-        ind_info['_object_type'] = 'packet_in_indication'
-        ind_info['_sub_group_type'] = 'ieee_oam_message'
+        device_handler = self.adapter.devices_handlers[device_id]
+        self.ind_handler.bal_pkt_ieee_oam_channel_rx_ind(request,
+                                                         device_handler)
         bal_err = bal_pb2.BalErr()
         bal_err.err = bal_errno_pb2.BAL_ERR_OK
         return bal_err
diff --git a/voltha/adapters/asfvolt16_olt/bal.py b/voltha/adapters/asfvolt16_olt/bal.py
index 6416804..5f68ac5 100644
--- a/voltha/adapters/asfvolt16_olt/bal.py
+++ b/voltha/adapters/asfvolt16_olt/bal.py
@@ -16,9 +16,13 @@
 
 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_model_types_pb2, bal_model_ids_pb2, bal_indications_pb2
 from voltha.adapters.asfvolt16_olt.grpc_client import GrpcClient
+from voltha.adapters.asfvolt16_olt.asfvolt16_ind_handler \
+                                       import Asfvolt16IndHandler
 from common.utils.nethelpers import get_my_primary_local_ipv4
+from common.utils.asleep import asleep
+import time
 import os
 
 """
@@ -32,14 +36,23 @@
         self.log = log
         self.grpc_client = GrpcClient(self.log)
         self.stub = None
+        self.ind_stub = None
         self.device_id = None
         self.olt = olt
+        self.interval = 0.1
+        self.ind_obj = Asfvolt16IndHandler(log)
 
     @inlineCallbacks
     def connect_olt(self, host_and_port, device_id):
         self.device_id = device_id
         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.olt.running = True
+
+        # Right now Bi-Directional GRPC support is not there in grpc-c.
+        # This code may be needed when bidirectional supported added
+        # in GRPC-C
         init = bal_pb2.BalInit()
         try:
             os.environ["SERVICE_HOST_IP"]
@@ -50,16 +63,10 @@
 
         ip_port = []
         ip_port.append(str(adapter_ip))
-        #ip_port.append("192.168.140.34")
         ip_port.append(":")
         ip_port.append(str(ADAPTER_PORT))
         init.voltha_adapter_ip_port ="".join(ip_port)
         self.log.info('Adapter port Ip', init.voltha_adapter_ip_port)
-
-        '''
-        TODO: Need to determine out what information
-        needs to be sent to the OLT at this stage.
-        '''
         self.log.info('connecting-olt', host_and_port=host_and_port,
                       init_details=init)
         yield self.stub.BalApiInit(init)
@@ -155,22 +162,30 @@
         obj.hdr.obj_type = bal_model_ids_pb2.BAL_OBJ_ID_PACKET
         if pkt_info['dest_type'] == 'onu':
             # Set the destination ONU info
-            obj.packet.key.packet_send_dest.type = bal_model_types_pb2.BAL_DEST_TYPE_SUB_TERM
-            obj.packet.key.packet_send_dest.sub_term.sub_term_id = pkt_info['onu_id']
+            obj.packet.key.packet_send_dest.type = \
+                bal_model_types_pb2.BAL_DEST_TYPE_SUB_TERM
+            obj.packet.key.packet_send_dest.sub_term.sub_term_id = \
+                pkt_info['onu_id']
             # TODO: Need to provide correct values for sub_term_uni and int_id
-            #obj.packet.key.packet_send_dest.sub_term.sub_term_uni = egress_port
+            # obj.packet.key.packet_send_dest.sub_term.sub_term_uni = egress_port
             obj.packet.key.packet_send_dest.sub_term.intf_id = pkt_info['intf_id']
             obj.packet.data.intf_type = bal_model_types_pb2.BAL_INTF_TYPE_PON
         elif pkt_info['dest_type'] == 'gem_port':
-            obj.packet.key.packet_send_dest.type = bal_model_types_pb2.BAL_DEST_TYPE_SVC_PORT
-            obj.packet.key.packet_send_dest.svc_port.svc_port_id = pkt_info['gem_port']
-            obj.packet.key.packet_send_dest.svc_port.intf_id = pkt_info['intf_id']
+            obj.packet.key.packet_send_dest.type = \
+                bal_model_types_pb2.BAL_DEST_TYPE_SVC_PORT
+            obj.packet.key.packet_send_dest.svc_port.svc_port_id = \
+                pkt_info['gem_port']
+            obj.packet.key.packet_send_dest.svc_port.intf_id = \
+                pkt_info['intf_id']
             obj.packet.data.intf_type = bal_model_types_pb2.BAL_INTF_TYPE_PON
         elif pkt_info['dest_type'] == 'nni':
-            obj.packet.key.packet_send_dest.type = bal_model_types_pb2.BAL_DEST_TYPE_NNI
-            obj.packet.key.packet_send_dest.nni.intf_id = pkt_info['intf_id']
+            obj.packet.key.packet_send_dest.type = \
+                bal_model_types_pb2.BAL_DEST_TYPE_NNI
+            obj.packet.key.packet_send_dest.nni.intf_id = \
+                pkt_info['intf_id']
         else:
-            self.log.error('unsupported-dest-type', dest_type=pkt_info['dest_type'])
+            self.log.error('unsupported-dest-type',
+                           dest_type=pkt_info['dest_type'])
 
         # Set the Packet-out info
         # TODO: Need to provide correct value for intf_id
@@ -201,7 +216,7 @@
 
             obj.flow.data.admin_state = bal_model_types_pb2.BAL_STATE_UP
             obj.flow.data.access_int_id = intf_id
-            #obj.flow.data.network_int_id = intf_id
+            # obj.flow.data.network_int_id = intf_id
             obj.flow.data.sub_term_id = onu_id
             obj.flow.data.svc_port_id = gem_port
             obj.flow.data.classifier.presence_mask = 0
@@ -320,7 +335,7 @@
 
             obj.flow.data.admin_state = bal_model_types_pb2.BAL_STATE_DOWN
             obj.flow.data.access_int_id = intf_id
-            #obj.flow.data.network_int_id = intf_id
+            # obj.flow.data.network_int_id = intf_id
             obj.flow.data.sub_term_id = onu_id
             self.log.info('deleting-flows-from-OLT-Device',
                           flow_details=obj)
@@ -330,7 +345,6 @@
                           flow_id, onu_id, exc=str(e))
         return
 
-
     @inlineCallbacks
     def create_scheduler(self, id, direction, owner_info, num_priority):
         try:
@@ -340,7 +354,7 @@
             obj.hdr.obj_type = bal_model_ids_pb2.BAL_OBJ_ID_TM_SCHED
             # Fill Access Terminal Details
             if direction == 'downstream':
-                obj.tm_sched_cfg.key.dir =\
+                obj.tm_sched_cfg.key.dir = \
                     bal_model_types_pb2.BAL_TM_SCHED_DIR_DS
             else:
                 obj.tm_sched_cfg.key.dir = \
@@ -351,7 +365,7 @@
                 obj.tm_sched_cfg.data.owner.type = \
                     bal_model_types_pb2.BAL_TM_SCHED_OWNER_TYPE_AGG_PORT
                 obj.tm_sched_cfg.data.owner.agg_port.presence_mask = 0
-                obj.tm_sched_cfg.data.owner.agg_port.intf_id =\
+                obj.tm_sched_cfg.data.owner.agg_port.intf_id = \
                     owner_info['intf_id']
                 obj.tm_sched_cfg.data.owner.agg_port.presence_mask |= \
                     bal_model_types_pb2.BAL_TM_SCHED_OWNER_AGG_PORT_ID_INTF_ID
@@ -390,7 +404,8 @@
             obj.intf_id = intf_id
             obj.intf_type = interface_type
             stats = yield self.stub.BalCfgStatGet(obj)
-            self.log.info('Fetching statistics success', stats_data = stats.data)
+            self.log.info('Fetching statistics success',
+                          stats_data=stats.data)
             returnValue(stats)
         except Exception as e:
             self.log.info('Fetching statistics failed', exc=str(e))
@@ -399,10 +414,10 @@
     def set_bal_reboot(self, device_id):
         self.log.info('Set Reboot')
         try:
-            obj =  bal_pb2.BalReboot()
+            obj = bal_pb2.BalReboot()
             obj.device_id = device_id
             err = yield self.stub.BalApiReboot(obj)
-            self.log.info('OLT Reboot Success', reboot_err= err)
+            self.log.info('OLT Reboot Success', reboot_err=err)
             returnValue(err)
         except Exception as e:
             self.log.info('OLT Reboot failed', exc=str(e))
@@ -411,10 +426,26 @@
     def get_bal_heartbeat(self, device_id):
         self.log.info('Get HeartBeat')
         try:
-            obj =  bal_pb2.BalHeartbeat()
+            obj = bal_pb2.BalHeartbeat()
             obj.device_id = device_id
             rebootStatus = yield self.stub.BalApiHeartbeat(obj)
-            self.log.info('OLT HeartBeat Response Received from', device=device_id, rebootStatus=rebootStatus)
+            self.log.info('OLT HeartBeat Response Received from',
+                          device=device_id, rebootStatus=rebootStatus)
             returnValue(rebootStatus)
         except Exception as e:
             self.log.info('OLT HeartBeat failed', exc=str(e))
+
+    def get_indication_info(self, device_id):
+        while self.olt.running:
+            try:
+                obj = bal_pb2.BalDefault()
+                obj.device_id = str(device_id)
+                bal_ind = self.ind_stub.BalGetIndFromDevice(obj)
+                if bal_ind.ind_present == True:
+                    self.log.info('Indication-received',
+                                  device=device_id, bal_ind=bal_ind)
+                    self.ind_obj.handle_indication_from_bal(bal_ind, self.olt)
+                time.sleep(self.interval)
+            except Exception as e:
+                self.log.info('Failed-to-get-indication-info', exc=str(e))
+        self.log.debug('stop-indication-receive-thread')
diff --git a/voltha/adapters/asfvolt16_olt/protos/bal.proto b/voltha/adapters/asfvolt16_olt/protos/bal.proto
index f1faf2a..8d84b73 100644
--- a/voltha/adapters/asfvolt16_olt/protos/bal.proto
+++ b/voltha/adapters/asfvolt16_olt/protos/bal.proto
@@ -25,6 +25,10 @@
     BalErrno err = 1;
 }
 
+message BalDefault {
+    string device_id = 1;                     /**< device id */
+}
+
 enum BalRebootStatus
 {
     BAL_OLT_UP_AFTER_REBOOT               =  0;
diff --git a/voltha/adapters/asfvolt16_olt/protos/bal_indications.proto b/voltha/adapters/asfvolt16_olt/protos/bal_indications.proto
index 7cb1c35..477c663 100644
--- a/voltha/adapters/asfvolt16_olt/protos/bal_indications.proto
+++ b/voltha/adapters/asfvolt16_olt/protos/bal_indications.proto
@@ -46,6 +46,7 @@
          BalPacketIeeeOamChannelRx balOamResp                        = 20; // PLOAM response
       }
       string device_id                                               = 21; //Deviced Id
+      uint32 ind_present                                             = 23;
 }
 
 service BalInd {
@@ -71,3 +72,8 @@
       rpc BalPktOmciChannelRxInd(BalIndications) returns(BalErr) {}
       rpc BalPktIeeeOamChannelRxInd(BalIndications) returns(BalErr) {}
 }
+
+service BalGetInd {
+      //Get bal indications from the device
+      rpc BalGetIndFromDevice(BalDefault) returns(BalIndications) {}
+}
