diff --git a/ponsim/bal_servicer.py b/ponsim/bal_servicer.py
new file mode 100644
index 0000000..f036d67
--- /dev/null
+++ b/ponsim/bal_servicer.py
@@ -0,0 +1,74 @@
+#
+# 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.
+#
+import structlog
+from common.utils.grpc_utils import twisted_async
+from voltha.protos import third_party
+from voltha.protos.ponsim_pb2 import PonSimDeviceInfo
+from google.protobuf.empty_pb2 import Empty
+from voltha.adapters.asfvolt16_olt.protos.bal_pb2 import BalServicer, BalErr
+from voltha.adapters.asfvolt16_olt.protos.bal_errno_pb2 import BAL_ERR_OK
+
+_ = third_party
+
+log = structlog.get_logger()
+
+class BalHandler(BalServicer):
+
+    def __init__(self, thread_pool, ponsim):
+        self.thread_pool = thread_pool
+        self.ponsim = ponsim
+
+    @twisted_async
+    def GetDeviceInfo(self, request, context):
+        log.info('get-device-info')
+        ports = self.ponsim.get_ports()
+        return PonSimDeviceInfo(
+            nni_port=ports[0],
+            uni_ports=ports[1:]
+        )
+
+    @twisted_async
+    def UpdateFlowTable(self, request, context):
+        log.info('flow-table-update', request=request, port=request.port)
+        if request.port == 0:
+            # by convention this is the olt port
+            self.ponsim.olt_install_flows(request.flows)
+        else:
+            self.ponsim.onu_install_flows(request.port, request.flows)
+        return Empty()
+
+    def GetStats(self, request, context):
+        return self.ponsim.get_stats()
+
+    def BalApiInit(self, request, context):
+        log.info('olt-connection-successful', request=request)
+        return BalErr(err=BAL_ERR_OK)
+
+    def BalApiFinish(self, request, context):
+        log.info('BalApi', request=request)
+        return BalErr(err=BAL_ERR_OK)
+
+    def BalCfgSet(self, request, context):
+        log.info('olt-activation-successful', request=request)
+        return BalErr(err=BAL_ERR_OK)
+
+    def BalAccessTerminalCfgSet(self, request, context):
+        log.info('olt-activation-successful', request=request)
+        return BalErr(err=BAL_ERR_OK)
+
+    def BalCfgClear(self, request, context):
+        log.info('BalCfClear', request=request)
+        return BalErr(err=BAL_ERR_OK)
diff --git a/ponsim/grpc_server.py b/ponsim/grpc_server.py
index fb08346..13d0ab9 100644
--- a/ponsim/grpc_server.py
+++ b/ponsim/grpc_server.py
@@ -18,65 +18,12 @@
 import os
 from concurrent import futures
 
-from common.utils.grpc_utils import twisted_async
 from voltha.protos import third_party
-from voltha.protos.ponsim_pb2 import PonSimServicer, \
-    add_PonSimServicer_to_server, PonSimDeviceInfo
-from google.protobuf.empty_pb2 import Empty
-
-from voltha.protos.ponsim_pb2 import XPonSimServicer, add_XPonSimServicer_to_server
 
 _ = third_party
 
 log = structlog.get_logger()
 
-
-class FlowUpdateHandler(PonSimServicer):
-
-    def __init__(self, thread_pool, ponsim):
-        self.thread_pool = thread_pool
-        self.ponsim = ponsim
-
-    @twisted_async
-    def GetDeviceInfo(self, request, context):
-        log.info('get-device-info')
-        ports = self.ponsim.get_ports()
-        return PonSimDeviceInfo(
-            nni_port=ports[0],
-            uni_ports=ports[1:]
-        )
-
-    @twisted_async
-    def UpdateFlowTable(self, request, context):
-        log.info('flow-table-update', request=request, port=request.port)
-        if request.port == 0:
-            # by convention this is the olt port
-            self.ponsim.olt_install_flows(request.flows)
-        else:
-            self.ponsim.onu_install_flows(request.port, request.flows)
-        return Empty()
-
-    def GetStats(self, request, context):
-        return self.ponsim.get_stats()
-
-class XPonHandler(XPonSimServicer):
-
-    def __init__(self, thread_pool, x_pon_sim):
-        self.thread_pool = thread_pool
-        self.x_pon_sim = x_pon_sim
-
-    def CreateInterface(self, request, context):
-        self.x_pon_sim.CreateInterface(request)
-        return Empty()
-
-    def UpdateInterface(self, request, context):
-        self.x_pon_sim.UpdateInterface(request)
-        return Empty()
-
-    def RemoveInterface(self, request, context):
-        self.x_pon_sim.RemoveInterface(request)
-        return Empty()
-
 class GrpcServer(object):
 
     def __init__(self, port, ponsim, x_pon_sim):
@@ -86,12 +33,16 @@
         self.ponsim = ponsim
         self.x_pon_sim = x_pon_sim
 
-    def start(self):
+    '''
+    service_list: a list of (add_xyzSimServicer_to_server, xyzServicerClass)
+    e.g. [(add_PonSimServicer_to_server, FlowUpdateHandler),
+          (add_XPonSimServicer_to_server, XPonHandler)]
+    '''
+    def start(self, service_list):
         log.debug('starting')
-        handler = FlowUpdateHandler(self.thread_pool, self.ponsim)
-        add_PonSimServicer_to_server(handler, self.server)
-        x_pon_handler = XPonHandler(self.thread_pool, self.x_pon_sim)
-        add_XPonSimServicer_to_server(x_pon_handler, self.server)
+        for add_x_to_server, xServiceClass in service_list:
+            x_handler = xServiceClass(self.thread_pool, self.ponsim)
+            add_x_to_server(x_handler, self.server)
 
         # read in key and certificate
         try:
@@ -108,7 +59,6 @@
         # create server credentials
         server_credentials = grpc.ssl_server_credentials(((private_key, certificate_chain,),))
         self.server.add_secure_port('[::]:%s' % self.port, server_credentials)
-
         self.server.start()
         log.info('started')
 
diff --git a/ponsim/main.py b/ponsim/main.py
index 3140afd..63b47f6 100755
--- a/ponsim/main.py
+++ b/ponsim/main.py
@@ -28,16 +28,21 @@
 
 from common.structlog_setup import setup_logging
 from grpc_server import GrpcServer
-from ponsim import PonSim
 from realio import RealIo
-
+from voltha.protos.ponsim_pb2 import add_PonSimServicer_to_server
+from voltha.protos.ponsim_pb2 import add_XPonSimServicer_to_server
+from voltha.adapters.asfvolt16_olt.protos.bal_pb2 import add_BalServicer_to_server
+import ponsim_servicer
+import bal_servicer
+from ponsim import PonSim
 from ponsim import XPonSim
 
 defs = dict(
     config=os.environ.get('CONFIG', './ponsim.yml'),
     grpc_port=int(os.environ.get('GRPC_PORT', 50060)),
     name=os.environ.get('NAME', 'pon1'),
-    onus=int(os.environ.get("ONUS", 1))
+    onus=int(os.environ.get("ONUS", 1)),
+    device_type='ponsim'
 )
 
 
@@ -139,6 +144,14 @@
                         default=False,
                         help=_help)
 
+    _help = ('device type - ponsim or bal'
+             ' (default: %s)' % defs['device_type'])
+    parser.add_argument('-d', '--device_type',
+                        dest='device_type',
+                        action='store',
+                        default=defs['device_type'],
+                        help=_help)
+
     args = parser.parse_args()
 
     return args
@@ -169,13 +182,19 @@
         if not args.no_banner:
             print_banner(self.log)
 
-        self.startup_components()
+        if args.device_type == 'ponsim':
+            grpc_services =  [(add_PonSimServicer_to_server, ponsim_servicer.FlowUpdateHandler)]
+        elif args.device_type == 'bal':
+            grpc_services =  [(add_BalServicer_to_server, bal_servicer.BalHandler)]
+        grpc_services.append((add_XPonSimServicer_to_server, ponsim_servicer.XPonHandler))
+
+        self.startup_components(grpc_services)
 
     def start(self):
         self.start_reactor()  # will not return except Keyboard interrupt
 
     @inlineCallbacks
-    def startup_components(self):
+    def startup_components(self, grpc_services):
         try:
             self.log.info('starting-internal-components')
 
@@ -188,7 +207,7 @@
             self.x_pon_sim = XPonSim()
 
             self.grpc_server = GrpcServer(self.args.grpc_port, self.ponsim, self.x_pon_sim)
-            yield self.grpc_server.start()
+            yield self.grpc_server.start(grpc_services)
 
             self.log.info('started-internal-services')
 
diff --git a/ponsim/ponsim_servicer.py b/ponsim/ponsim_servicer.py
new file mode 100644
index 0000000..b7a524f
--- /dev/null
+++ b/ponsim/ponsim_servicer.py
@@ -0,0 +1,71 @@
+#
+# 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.
+#
+import structlog
+from common.utils.grpc_utils import twisted_async
+from voltha.protos import third_party
+from voltha.protos.ponsim_pb2 import PonSimServicer, PonSimDeviceInfo
+from google.protobuf.empty_pb2 import Empty
+from voltha.protos.ponsim_pb2 import XPonSimServicer
+
+_ = third_party
+
+log = structlog.get_logger()
+
+class FlowUpdateHandler(PonSimServicer):
+
+    def __init__(self, thread_pool, ponsim):
+        self.thread_pool = thread_pool
+        self.ponsim = ponsim
+
+    @twisted_async
+    def GetDeviceInfo(self, request, context):
+        log.info('get-device-info')
+        ports = self.ponsim.get_ports()
+        return PonSimDeviceInfo(
+            nni_port=ports[0],
+            uni_ports=ports[1:]
+        )
+
+    @twisted_async
+    def UpdateFlowTable(self, request, context):
+        log.info('flow-table-update', request=request, port=request.port)
+        if request.port == 0:
+            # by convention this is the olt port
+            self.ponsim.olt_install_flows(request.flows)
+        else:
+            self.ponsim.onu_install_flows(request.port, request.flows)
+        return Empty()
+
+    def GetStats(self, request, context):
+        return self.ponsim.get_stats()
+
+class XPonHandler(XPonSimServicer):
+
+    def __init__(self, thread_pool, x_pon_sim):
+        self.thread_pool = thread_pool
+        self.x_pon_sim = x_pon_sim
+
+    def CreateInterface(self, request, context):
+        self.x_pon_sim.CreateInterface(request)
+        return Empty()
+
+    def UpdateInterface(self, request, context):
+        self.x_pon_sim.UpdateInterface(request)
+        return Empty()
+
+    def RemoveInterface(self, request, context):
+        self.x_pon_sim.RemoveInterface(request)
+        return Empty()
diff --git a/tests/itests/voltha/adapters/asfvolt16_olt/test_device_state_changes.py b/tests/itests/voltha/adapters/asfvolt16_olt/test_device_state_changes.py
index b3fb0d5..89edc54 100644
--- a/tests/itests/voltha/adapters/asfvolt16_olt/test_device_state_changes.py
+++ b/tests/itests/voltha/adapters/asfvolt16_olt/test_device_state_changes.py
@@ -14,17 +14,17 @@
     The prerequisite for this test are:
      1. voltha ensemble is running
           docker-compose -f compose/docker-compose-system-test.yml up -d
-     2.  asfvolt16_olt simulator is running
+     2. ponsim olt is running with 1 OLT and 4 ONUs using device_type 'bal'
           sudo -s
           . ./env.sh
-          ./voltha/adapters/asfvolt16_olt/sim.py
+          ./ponsim/main.py -v -o 4 -d bal
     """
 
     # Retrieve details of the REST entry point
     rest_endpoint = get_endpoint_from_consul(LOCAL_CONSUL, 'chameleon-rest')
 
     # Construct the base_url
-    base_url = 'http://' + rest_endpoint
+    base_url = 'https://' + rest_endpoint
 
     def wait_till(self, msg, predicate, interval=0.1, timeout=5.0):
         deadline = time() + timeout
diff --git a/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py b/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
index 2ca9d81..e0563e7 100644
--- a/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
+++ b/voltha/adapters/asfvolt16_olt/asfvolt16_device_handler.py
@@ -19,7 +19,7 @@
 """
 
 from uuid import uuid4
-
+from common.frameio.frameio import BpfProgramFilter
 from voltha.protos.common_pb2 import OperStatus, ConnectStatus
 from voltha.protos.device_pb2 import Port
 from voltha.protos.common_pb2 import AdminState
@@ -31,18 +31,33 @@
 from voltha.adapters.asfvolt16_olt.bal import Bal
 from voltha.adapters.device_handler import OltDeviceHandler
 
+# TODO: VLAN ID needs to come from some sort of configuration.
+PACKET_IN_VLAN = 4091
+is_inband_frame = BpfProgramFilter('(ether[14:2] & 0xfff) = 0x{:03x}'.format(
+    PACKET_IN_VLAN))
+
+#TODO: hardcoded NNI port ID to be removed once port enumeration is supported.
+nni_port_no = 1
+
+# TODO - hardcoded OLT ID to be removed once multiple OLT devices is supported.
+olt_id = 1
+
 class Asfvolt16Handler(OltDeviceHandler):
     def __init__(self, adapter, device_id):
         super(Asfvolt16Handler, self).__init__(adapter, device_id)
+        self.filter = is_inband_frame
         self.bal = Bal(self.log)
+        self.host_and_port = None
+
+    def __del__(self):
+        super(Asfvolt16Handler, self).__del__()
+
+    def __str__(self):
+        return "Asfvolt16Handler: {}".format(self.host_and_port)
 
     def activate(self, device):
-        '''
-        TODO: Revisit how to determine the NNI port number.
-        Hardcoding for now.
-        '''
-        port_no = 1
-        self.log.info('activating-olt', device=device)
+
+        self.log.info('activating-asfvolt16-olt', device=device)
 
         if self.logical_device_id is not None:
             return
@@ -53,24 +68,23 @@
             self.adapter_agent.update_device(device)
             return
 
+        self.host_and_port = device.host_and_port
+
         device.root = True
         device.vendor = 'Edgecore'
         device.model = 'ASFvOLT16'
         device.serial_number = device.host_and_port
         self.adapter_agent.update_device(device)
 
-        self.add_port(port_no=port_no, port_type=Port.ETHERNET_NNI)
+        self.add_port(port_no=nni_port_no, port_type=Port.ETHERNET_NNI)
         self.logical_device_id = self.add_logical_device(device_id=device.id)
-        self.add_logical_port(port_no=port_no,
+        self.add_logical_port(port_no=nni_port_no,
                               port_type=Port.ETHERNET_NNI,
                               device_id=device.id,
                               logical_device_id=self.logical_device_id)
 
         self.bal.connect_olt(device.host_and_port)
-        # TODO - Add support for multiple OLT devices.
-        # Only single OLT is supported currently and it id is
-        # hard-coded to 0.
-        self.bal.activate_olt(olt_id=0)
+        self.bal.activate_olt(olt_id)
 
         device = self.adapter_agent.get_device(device.id)
         device.parent_id = self.logical_device_id
@@ -78,6 +92,9 @@
         device.oper_status = OperStatus.ACTIVATING
         self.adapter_agent.update_device(device)
 
+        # Open the frameio port to receive in-band packet_in messages
+        self.activate_io_port()
+
     def add_port(self, port_no, port_type):
         self.log.info('adding-port', port_no=port_no, port_type=port_type)
         if port_type is Port.ETHERNET_NNI:
diff --git a/voltha/adapters/device_handler.py b/voltha/adapters/device_handler.py
index a3bc0a6..33bbd35 100644
--- a/voltha/adapters/device_handler.py
+++ b/voltha/adapters/device_handler.py
@@ -14,6 +14,8 @@
 # limitations under the License.
 #
 import structlog
+from scapy.layers.l2 import Ether, Dot1Q
+from voltha.registry import registry
 from voltha.protos.common_pb2 import OperStatus, ConnectStatus, AdminState
 
 class DeviceHandler(object):
@@ -41,6 +43,11 @@
 class OltDeviceHandler(DeviceHandler):
     def __init__(self, adapter, device_id):
         super(OltDeviceHandler, self).__init__(adapter, device_id)
+        self.filter = None
+
+    def __del__(self):
+        if self.io_port is not None:
+            registry('frameio').close_port(self.io_port)
 
     def disable(self):
         super(OltDeviceHandler, self).disable()
@@ -81,5 +88,45 @@
 
         self.log.info('deleted', device_id=self.device_id)
 
+    def activate_io_port(self):
+        if self.io_port is None:
+            self.log.info('registering-frameio')
+            self.io_port = registry('frameio').open_port(
+                self.interface, self.rcv_io, self.filter)
+
+    def deactivate_io_port(self):
+        io, self.io_port = self.io_port, None
+
+        if io is not None:
+            registry('frameio').close_port(io)
+
+    def rcv_io(self, port, frame):
+        self.log.info('received', iface_name=port.iface_name,
+                      frame_len=len(frame))
+        pkt = Ether(frame)
+        if pkt.haslayer(Dot1Q):
+            outer_shim = pkt.getlayer(Dot1Q)
+            if isinstance(outer_shim.payload, Dot1Q):
+                inner_shim = outer_shim.payload
+                cvid = inner_shim.vlan
+                logical_port = cvid
+                popped_frame = (
+                    Ether(src=pkt.src, dst=pkt.dst, type=inner_shim.type) /
+                    inner_shim.payload
+                )
+                kw = dict(
+                    logical_device_id=self.logical_device_id,
+                    logical_port_no=logical_port,
+                )
+                self.log.info('sending-packet-in', **kw)
+                self.adapter_agent.send_packet_in(
+                    packet=str(popped_frame), **kw)
+            '''
+            # TODO: handle non dot1q pkts
+            elif pkt.haslayer(Raw):
+                raw_data = json.loads(pkt.getlayer(Raw).load)
+                self.alarms.send_alarm(self, raw_data)
+            '''
+
 class OnuDeviceHandler(DeviceHandler):
     pass
