diff --git a/voltha/adapters/asfvolt16_olt/asfvolt16_olt.py b/voltha/adapters/asfvolt16_olt/asfvolt16_olt.py
index 74848e2..ab7200e 100644
--- a/voltha/adapters/asfvolt16_olt/asfvolt16_olt.py
+++ b/voltha/adapters/asfvolt16_olt/asfvolt16_olt.py
@@ -18,109 +18,14 @@
 Asfvolt16 OLT adapter
 """
 
-import structlog
-from zope.interface import implementer
+from voltha.adapters.iadapter import IAdapter
 
-from voltha.protos.device_pb2 import DeviceType, DeviceTypes
-from voltha.adapters.interface import IAdapterInterface
-from voltha.protos.adapter_pb2 import Adapter
-from voltha.protos.adapter_pb2 import AdapterConfig
-from voltha.protos.common_pb2 import LogLevel
-
-log = structlog.get_logger()
-
-@implementer(IAdapterInterface)
-class Asfvolt16Adapter(object):
-    name = 'asfvolt16_olt'
-
-    supported_device_types = [
-        DeviceType(
-            id=name,
-            adapter=name,
-            accepts_bulk_flow_update=False
-        )
-    ]
-
+class Asfvolt16Adapter(IAdapter):
     def __init__(self, adapter_agent, config):
-        self.adapter_agent = adapter_agent
-        self.config = config
-        self.descriptor = Adapter(
-            id=self.name,
-            vendor='Edgecore',
-            version='0.1',
-            config=AdapterConfig(log_level=LogLevel.INFO)
-        )
-
+        super(Asfvolt16Adapter, self).__init__(adapter_agent=adapter_agent,
+                                               config=config,
+                                               name='asfvolt16_olt',
+                                               vendor='Edgecore',
+                                               version='0.1')
         # register for adapter messages
         self.adapter_agent.register_for_inter_adapter_messages()
-
-    def start(self):
-        log.debug('starting')
-        log.info('started')
-
-    def stop(self):
-        log.debug('stopping')
-        log.info('stopped')
-
-    def adapter_descriptor(self):
-        return self.descriptor
-
-    def device_types(self):
-        return DeviceTypes(items=self.supported_device_types)
-
-    def health(self):
-        raise NotImplementedError()
-
-    def change_master_state(self, master):
-        raise NotImplementedError()
-
-    def update_pm_config(self, device, pm_config):
-        raise NotImplementedError()
-
-    def adopt_device(self, device):
-        raise NotImplementedError()
-
-    def reconcile_device(self, device):
-        raise NotImplementedError()
-
-    def abandon_device(self, device):
-        raise NotImplementedError()
-
-    def disable_device(self, device):
-        raise NotImplementedError()
-
-    def reenable_device(self, device):
-        raise NotImplementedError()
-
-    def reboot_device(self, device):
-        raise NotImplementedError()
-
-    def delete_device(self, device):
-        raise NotImplementedError()
-
-    def get_device_details(self, device):
-        raise NotImplementedError()
-
-    def update_flows_bulk(self, device, flows, groups):
-        raise NotImplementedError()
-
-    def update_flows_incrementally(self, device, flow_changes, group_changes):
-        raise NotImplementedError()
-
-    def send_proxied_message(self, proxy_address, msg):
-        raise NotImplementedError()
-
-    def receive_proxied_message(self, proxy_address, msg):
-        raise NotImplementedError()
-
-    def receive_packet_out(self, logical_device_id, egress_port_no, msg):
-        raise NotImplementedError()
-
-    def receive_inter_adapter_message(self, msg):
-        raise NotImplementedError()
-
-    def suppress_alarm(self, filter):
-        raise NotImplementedError()
-
-    def unsuppress_alarm(self, filter):
-        raise NotImplementedError()
diff --git a/voltha/adapters/iadapter.py b/voltha/adapters/iadapter.py
new file mode 100644
index 0000000..b94c35a
--- /dev/null
+++ b/voltha/adapters/iadapter.py
@@ -0,0 +1,121 @@
+#
+# 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.
+#
+
+"""
+Adapter abstract base class
+"""
+
+import structlog
+from zope.interface import implementer
+
+from voltha.protos.device_pb2 import DeviceType, DeviceTypes
+from voltha.adapters.interface import IAdapterInterface
+from voltha.protos.adapter_pb2 import Adapter
+from voltha.protos.adapter_pb2 import AdapterConfig
+from voltha.protos.common_pb2 import LogLevel
+from voltha.protos.health_pb2 import HealthStatus
+
+log = structlog.get_logger()
+
+@implementer(IAdapterInterface)
+class IAdapter(object):
+    def __init__(self, adapter_agent, config, name, vendor, version):
+        log.debug('Initializing adapter: {} {} {}'.format(vendor, name, version))
+        self.adapter_agent = adapter_agent
+        self.config = config
+        self.name = name
+        self.supported_device_types = [
+            DeviceType(
+                id=name,
+                adapter=name,
+                accepts_bulk_flow_update=True
+            )
+        ]
+        self.descriptor = Adapter(
+            id=self.name,
+            vendor=vendor,
+            version=version,
+            config=AdapterConfig(log_level=LogLevel.INFO)
+        )
+
+    def start(self):
+        log.info('Starting adapter: {}'.format(self.name))
+
+    def stop(self):
+        log.info('Stopping adapter: {}'.format(self.name))
+
+    def adapter_descriptor(self):
+        return self.descriptor
+
+    def device_types(self):
+        return DeviceTypes(items=self.supported_device_types)
+
+    def health(self):
+        return HealthStatus(state=HealthStatus.HealthState.HEALTHY)
+
+    def change_master_state(self, master):
+        raise NotImplementedError()
+
+    def update_pm_config(self, device, pm_config):
+        raise NotImplementedError()
+
+    def adopt_device(self, device):
+        raise NotImplementedError()
+
+    def reconcile_device(self, device):
+        raise NotImplementedError()
+
+    def abandon_device(self, device):
+        raise NotImplementedError()
+
+    def disable_device(self, device):
+        raise NotImplementedError()
+
+    def reenable_device(self, device):
+        raise NotImplementedError()
+
+    def reboot_device(self, device):
+        raise NotImplementedError()
+
+    def delete_device(self, device):
+        raise NotImplementedError()
+
+    def get_device_details(self, device):
+        raise NotImplementedError()
+
+    def update_flows_bulk(self, device, flows, groups):
+        raise NotImplementedError()
+
+    def update_flows_incrementally(self, device, flow_changes, group_changes):
+        raise NotImplementedError()
+
+    def send_proxied_message(self, proxy_address, msg):
+        raise NotImplementedError()
+
+    def receive_proxied_message(self, proxy_address, msg):
+        raise NotImplementedError()
+
+    def receive_packet_out(self, logical_device_id, egress_port_no, msg):
+        raise NotImplementedError()
+
+    def receive_inter_adapter_message(self, msg):
+        raise NotImplementedError()
+
+    def suppress_alarm(self, filter):
+        raise NotImplementedError()
+
+    def unsuppress_alarm(self, filter):
+        raise NotImplementedError()
diff --git a/voltha/adapters/ponsim_olt/ponsim_olt.py b/voltha/adapters/ponsim_olt/ponsim_olt.py
index be57fac..e6f42ab 100644
--- a/voltha/adapters/ponsim_olt/ponsim_olt.py
+++ b/voltha/adapters/ponsim_olt/ponsim_olt.py
@@ -27,23 +27,17 @@
 from scapy.layers.inet import Raw
 from twisted.internet import reactor
 from twisted.internet.defer import inlineCallbacks
-from zope.interface import implementer
 
 from common.frameio.frameio import BpfProgramFilter, hexify
 from common.utils.asleep import asleep
 from twisted.internet.task import LoopingCall
-from voltha.adapters.interface import IAdapterInterface
+from voltha.adapters.iadapter import IAdapter
 from voltha.core.logical_device_agent import mac_str_to_tuple
 from voltha.protos import third_party
 from voltha.protos import ponsim_pb2
-from voltha.protos.adapter_pb2 import Adapter
-from voltha.protos.adapter_pb2 import AdapterConfig
-from voltha.protos.common_pb2 import LogLevel, OperStatus, ConnectStatus, \
-    AdminState
-from voltha.protos.device_pb2 import DeviceType, DeviceTypes, Port, Device, \
-    PmConfig, PmConfigs
+from voltha.protos.common_pb2 import OperStatus, ConnectStatus, AdminState
+from voltha.protos.device_pb2 import Port, Device, PmConfig, PmConfigs
 from voltha.protos.events_pb2 import KpiEvent, KpiEventType, MetricValuePairs
-from voltha.protos.health_pb2 import HealthStatus
 from google.protobuf.empty_pb2 import Empty
 
 from voltha.protos.logical_device_pb2 import LogicalPort, LogicalDevice
@@ -181,56 +175,16 @@
         except Exception as e:
             log.exception('failed-to-send-alarm', e=e)
 
-
-@implementer(IAdapterInterface)
-class PonSimOltAdapter(object):
-    name = 'ponsim_olt'
-
-    supported_device_types = [
-        DeviceType(
-            id=name,
-            adapter=name,
-            accepts_bulk_flow_update=True
-        )
-    ]
-
+class PonSimOltAdapter(IAdapter):
     def __init__(self, adapter_agent, config):
-        self.adapter_agent = adapter_agent
-        self.config = config
-        self.descriptor = Adapter(
-            id=self.name,
-            vendor='Voltha project',
-            version='0.4',
-            config=AdapterConfig(log_level=LogLevel.INFO)
-        )
+        super(PonSimOltAdapter, self).__init__(adapter_agent=adapter_agent,
+                                               config=config,
+                                               name='ponsim_olt',
+                                               vendor='Voltha project',
+                                               version='0.4')
         self.devices_handlers = dict()  # device_id -> PonSimOltHandler()
         self.logical_device_id_to_root_device_id = dict()
 
-    def start(self):
-        log.debug('starting')
-        log.info('started')
-
-    def stop(self):
-        """
-        This method is called when this device instance is no longer
-        required,  which means there is a request to remove this device.
-        :return:
-        """
-        log.debug('stopping')
-        log.info('stopped')
-
-    def adapter_descriptor(self):
-        return self.descriptor
-
-    def device_types(self):
-        return DeviceTypes(items=self.supported_device_types)
-
-    def health(self):
-        return HealthStatus(state=HealthStatus.HealthState.HEALTHY)
-
-    def change_master_state(self, master):
-        raise NotImplementedError()
-
     def update_pm_config(self, device, pm_config):
         log.info("adapter-update-pm-config", device=device,
                  pm_config=pm_config)
@@ -259,9 +213,6 @@
         except Exception, e:
             log.exception('Exception', e=e)
 
-    def abandon_device(self, device):
-        raise NotImplementedError()
-
     def disable_device(self, device):
         log.info('disable-device', device_id=device.id)
         reactor.callLater(0, self.devices_handlers[device.id].disable)
@@ -283,9 +234,6 @@
         reactor.callLater(0, self.devices_handlers[device.id].delete)
         return device
 
-    def get_device_details(self, device):
-        raise NotImplementedError()
-
     def update_flows_bulk(self, device, flows, groups):
         log.info('bulk-flow-update', device_id=device.id,
                  flows=flows, groups=groups)
@@ -293,17 +241,11 @@
         handler = self.devices_handlers[device.id]
         return handler.update_flow_table(flows.items)
 
-    def update_flows_incrementally(self, device, flow_changes, group_changes):
-        raise NotImplementedError()
-
     def send_proxied_message(self, proxy_address, msg):
         log.info('send-proxied-message', proxy_address=proxy_address, msg=msg)
         handler = self.devices_handlers[proxy_address.device_id]
         handler.send_proxied_message(proxy_address, msg)
 
-    def receive_proxied_message(self, proxy_address, msg):
-        raise NotImplementedError()
-
     def receive_packet_out(self, logical_device_id, egress_port_no, msg):
         def ldi_to_di(ldi):
             di = self.logical_device_id_to_root_device_id.get(ldi)
@@ -317,16 +259,6 @@
         handler = self.devices_handlers[device_id]
         handler.packet_out(egress_port_no, msg)
 
-    def receive_inter_adapter_message(self, msg):
-        raise NotImplementedError()
-
-    def suppress_alarm(self, filter):
-        raise NotImplementedError()
-
-    def unsuppress_alarm(self, filter):
-        raise NotImplementedError()
-
-
 class PonSimOltHandler(object):
     def __init__(self, adapter, device_id):
         self.adapter = adapter
diff --git a/voltha/adapters/ponsim_onu/ponsim_onu.py b/voltha/adapters/ponsim_onu/ponsim_onu.py
index 05df340..781e212 100644
--- a/voltha/adapters/ponsim_onu/ponsim_onu.py
+++ b/voltha/adapters/ponsim_onu/ponsim_onu.py
@@ -21,21 +21,16 @@
 import structlog
 from twisted.internet import reactor
 from twisted.internet.defer import DeferredQueue, inlineCallbacks
-from zope.interface import implementer
 from common.utils.asleep import asleep
 
-from voltha.adapters.interface import IAdapterInterface
+from voltha.adapters.iadapter import IAdapter
 from voltha.core.logical_device_agent import mac_str_to_tuple
 from voltha.protos import third_party
-from voltha.protos.adapter_pb2 import Adapter
-from voltha.protos.adapter_pb2 import AdapterConfig
-from voltha.protos.common_pb2 import LogLevel, OperStatus, ConnectStatus, \
-    AdminState
-from voltha.protos.device_pb2 import DeviceType, DeviceTypes, Port
-from voltha.protos.health_pb2 import HealthStatus
+from voltha.protos.common_pb2 import OperStatus, ConnectStatus, AdminState
+from voltha.protos.device_pb2 import Port
 from voltha.protos.logical_device_pb2 import LogicalPort
 from voltha.protos.openflow_13_pb2 import OFPPS_LIVE, OFPPF_FIBER, \
-    OFPPF_1GB_FD, OFPPC_NO_RECV
+    OFPPF_1GB_FD
 from voltha.protos.openflow_13_pb2 import ofp_port
 from voltha.protos.ponsim_pb2 import FlowTable
 
@@ -43,52 +38,15 @@
 log = structlog.get_logger()
 
 
-@implementer(IAdapterInterface)
-class PonSimOnuAdapter(object):
-    name = 'ponsim_onu'
-
-    supported_device_types = [
-        DeviceType(
-            id=name,
-            adapter=name,
-            accepts_bulk_flow_update=True
-        )
-    ]
-
+class PonSimOnuAdapter(IAdapter):
     def __init__(self, adapter_agent, config):
-        self.adapter_agent = adapter_agent
-        self.config = config
-        self.descriptor = Adapter(
-            id=self.name,
-            vendor='Voltha project',
-            version='0.4',
-            config=AdapterConfig(log_level=LogLevel.INFO)
-        )
+        super(PonSimOnuAdapter, self).__init__(adapter_agent=adapter_agent,
+                                               config=config,
+                                               name='ponsim_onu',
+                                               vendor='Voltha project',
+                                               version='0.4')
         self.devices_handlers = dict()  # device_id -> PonSimOltHandler()
 
-    def start(self):
-        log.debug('starting')
-        log.info('started')
-
-    def stop(self):
-        log.debug('stopping')
-        log.info('stopped')
-
-    def adapter_descriptor(self):
-        return self.descriptor
-
-    def device_types(self):
-        return DeviceTypes(items=self.supported_device_types)
-
-    def health(self):
-        return HealthStatus(state=HealthStatus.HealthState.HEALTHY)
-
-    def change_master_state(self, master):
-        raise NotImplementedError()
-
-    def update_pm_config(self, device, pm_configs):
-        raise NotImplementedError()
-
     def adopt_device(self, device):
         self.devices_handlers[device.id] = PonSimOnuHandler(self, device.id)
         reactor.callLater(0, self.devices_handlers[device.id].activate, device)
@@ -103,9 +61,6 @@
                               device)
         return device
 
-    def abandon_device(self, device):
-        raise NotImplementedError()
-
     def disable_device(self, device):
         log.info('disable-device', device_id=device.id)
         reactor.callLater(0, self.devices_handlers[device.id].disable)
@@ -136,9 +91,6 @@
         handler = self.devices_handlers[device.id]
         return handler.update_flow_table(flows.items)
 
-    def update_flows_incrementally(self, device, flow_changes, group_changes):
-        raise NotImplementedError()
-
     def send_proxied_message(self, proxy_address, msg):
         log.info('send-proxied-message', proxy_address=proxy_address, msg=msg)
 
@@ -157,16 +109,6 @@
         log.info('packet-out', logical_device_id=logical_device_id,
                  egress_port_no=egress_port_no, msg_len=len(msg))
 
-    def receive_inter_adapter_message(self, msg):
-        raise NotImplementedError()
-
-    def suppress_alarm(self, filter):
-        raise NotImplementedError()
-
-    def unsuppress_alarm(self, filter):
-        raise NotImplementedError()
-
-
 class PonSimOnuHandler(object):
     def __init__(self, adapter, device_id):
         self.adapter = adapter
