diff --git a/voltha/adapters/openolt/openolt_device.py b/voltha/adapters/openolt/openolt_device.py
index 4af9cc6..25beae4 100644
--- a/voltha/adapters/openolt/openolt_device.py
+++ b/voltha/adapters/openolt/openolt_device.py
@@ -356,9 +356,11 @@
 
         # Post ONU Discover alarm  20180809_0805
         try:
-            OnuDiscoveryAlarm(self.alarm_mgr.alarms, pon_id=intf_id, serial_number=serial_number_str).raise_alarm()
+            OnuDiscoveryAlarm(self.alarm_mgr.alarms, pon_id=intf_id,
+                              serial_number=serial_number_str).raise_alarm()
         except Exception as disc_alarm_error:
-            self.log.exception("onu-discovery-alarm-error", errmsg=disc_alarm_error.message)
+            self.log.exception("onu-discovery-alarm-error",
+                               errmsg=disc_alarm_error.message)
             # continue for now.
 
         pir = self.bw_mgr.pir(serial_number_str)
@@ -539,11 +541,13 @@
 
                 # tcont creation (onu)
                 tcont = TcontsConfigData()
-                tcont.alloc_id = platform.mk_alloc_id(onu_indication.onu_id)
+                tcont.alloc_id = platform.mk_alloc_id(
+                    onu_indication.intf_id, onu_indication.onu_id)
 
                 # gem port creation
                 gem_port = GemportsConfigData()
                 gem_port.gemport_id = platform.mk_gemport_id(
+                    onu_indication.intf_id,
                     onu_indication.onu_id)
 
                 # ports creation/update
@@ -588,11 +592,13 @@
 
                 # tcont creation (onu)
                 tcont = TcontsConfigData()
-                tcont.alloc_id = platform.mk_alloc_id(onu_indication.onu_id)
+                tcont.alloc_id = platform.mk_alloc_id(
+                    onu_indication.intf_id, onu_indication.onu_id)
 
                 # gem port creation
                 gem_port = GemportsConfigData()
                 gem_port.gemport_id = platform.mk_gemport_id(
+                    onu_indication.intf_id,
                     onu_indication.onu_id)
                 gem_port.tcont_ref = str(tcont.alloc_id)
 
@@ -842,18 +848,17 @@
 
 
     def new_onu_id(self, intf_id):
-        onu_id = None
         onu_devices = self.adapter_agent.get_child_devices(self.device_id)
-        for i in range(1, 512):
-            id_not_taken = True
-            for child_device in onu_devices:
-                if child_device.proxy_address.onu_id == i:
-                    id_not_taken = False
-                    break
-            if id_not_taken:
-                onu_id = i
-                break
-        return onu_id
+        pon_onu_ids = [onu_device.proxy_address.onu_id for onu_device in
+                              onu_devices if
+                           onu_device.proxy_address.channel_id == intf_id]
+        for i in range(1, platform.MAX_ONUS_PER_PON):
+            if i not in pon_onu_ids:
+                return i
+
+        self.log.error('All available onu_ids taken on this pon',
+                       intf_id=intf_id, ids_taken=platform.MAX_ONUS_PER_PON)
+        return None
 
     def stringify_vendor_specific(self, vendor_specific):
         return ''.join(str(i) for i in [
diff --git a/voltha/adapters/openolt/openolt_flow_mgr.py b/voltha/adapters/openolt/openolt_flow_mgr.py
index ae388e0..e72c929 100644
--- a/voltha/adapters/openolt/openolt_flow_mgr.py
+++ b/voltha/adapters/openolt/openolt_flow_mgr.py
@@ -268,7 +268,7 @@
     def add_hsia_flow(self, intf_id, onu_id, classifier, action,
                       direction, hsia_id, logical_flow):
 
-        gemport_id = platform.mk_gemport_id(onu_id)
+        gemport_id = platform.mk_gemport_id(intf_id, onu_id)
         flow_id = platform.mk_flow_id(intf_id, onu_id, hsia_id)
 
         flow = openolt_pb2.Flow(
@@ -290,7 +290,7 @@
         classifier['pkt_tag_type'] = 'single_tag'
         classifier.pop('vlan_vid', None)
 
-        gemport_id = platform.mk_gemport_id(onu_id)
+        gemport_id = platform.mk_gemport_id(intf_id, onu_id)
         flow_id = platform.mk_flow_id(intf_id, onu_id, DHCP_FLOW_INDEX)
 
         upstream_flow = openolt_pb2.Flow(
@@ -351,7 +351,7 @@
         uplink_action = {}
         uplink_action['trap_to_host'] = True
 
-        gemport_id = platform.mk_gemport_id(onu_id)
+        gemport_id = platform.mk_gemport_id(intf_id, onu_id)
 
         # Add Upstream EAPOL Flow.
 
diff --git a/voltha/adapters/openolt/openolt_platform.py b/voltha/adapters/openolt/openolt_platform.py
index c2a9b5e..c4b7cac 100644
--- a/voltha/adapters/openolt/openolt_platform.py
+++ b/voltha/adapters/openolt/openolt_platform.py
@@ -93,23 +93,23 @@
 
 """
 
+MAX_ONUS_PER_PON = 112
 
 def mk_uni_port_num(intf_id, onu_id):
     return intf_id << 11 | onu_id << 4
 
 
-def mk_alloc_id(onu_id, idx=0):
+def mk_alloc_id(intf_id, onu_id, idx=0):
     # FIXME - driver should do prefixing 1 << 10 as it is Maple specific
     # return 1<<10 | onu_id<<6 | idx
-    return 1023 + onu_id  # FIXME
+    return 1023 + intf_id * MAX_ONUS_PER_PON + onu_id  # FIXME
 
 
-def mk_gemport_id(onu_id, idx=0):
-    return 1 << 10 | onu_id << 3 | idx
-
+def mk_gemport_id(intf_id, onu_id, idx=0):
+    return 1024 + (((MAX_ONUS_PER_PON * intf_id + onu_id - 1) * 7) + idx)
 
 def onu_id_from_gemport_id(gemport_id):
-    return (gemport_id & ~(1 << 10)) >> 3
+    return (((gemport_id - 1024) // 7) % MAX_ONUS_PER_PON) + 1
 
 
 def mk_flow_id(intf_id, onu_id, idx):
