diff --git a/app/src/test/java/org/opencord/sadis/impl/BaseSadis.java b/app/src/test/java/org/opencord/sadis/impl/BaseSadis.java
index 7d2604a..7979223 100644
--- a/app/src/test/java/org/opencord/sadis/impl/BaseSadis.java
+++ b/app/src/test/java/org/opencord/sadis/impl/BaseSadis.java
@@ -17,6 +17,10 @@
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.Lists;
+import org.onlab.packet.Ip4Address;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
 import org.onosproject.codec.impl.CodecManager;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreServiceAdapter;
@@ -26,8 +30,10 @@
 import org.onosproject.net.config.Config;
 import org.onosproject.net.config.NetworkConfigEvent;
 import org.opencord.sadis.BaseConfig;
-import org.opencord.sadis.BaseInformationService;
 import org.opencord.sadis.BaseInformation;
+import org.opencord.sadis.BaseInformationService;
+import org.opencord.sadis.SubscriberAndDeviceInformation;
+import org.opencord.sadis.UniTagInformation;
 
 import java.io.InputStream;
 import java.time.Duration;
@@ -48,6 +54,115 @@
     protected NetworkConfigEvent event;
     protected static NetworkConfigListener configListener;
 
+    private static final short UNI_TAG_MATCH_1 = 100;
+    private static final short UNI_TAG_MATCH_2 = 200;
+    private static final short C_TAG_1 = 2;
+    private static final short S_TAG_1 = 2;
+    private static final short S_TAG_2 = 3;
+    private static final int C_TAG_PRIORITY = 0;
+    private static final int S_TAG_PRIORITY = 1;
+    private static final int TECH_PROF_ID_1 = 64;
+    private static final int TECH_PROF_ID_2 = 65;
+
+    private static final String HSA = "HSA";
+    private static final String IPTV = "IPTV";
+    private static final String NAS_PORT_ID = "1/1/2";
+
+    private static final short PORT_1 = 125;
+    private static final short PORT_2 = 129;
+    private static final short PORT_3 = 130;
+    private static final short PORT_4 = 132;
+
+    private static final short SLOT_1 = 3;
+    private static final short SLOT_2 = 4;
+    private static final short SLOT_3 = 7;
+    private static final short SLOT_4 = 1;
+
+    private static final String MAC1 = "aa:bb:cc:dd:ee:ff";
+    private static final String MAC2 = "ff:aa:dd:cc:bb:ee";
+    private static final String MAC3 = "ff:cc:dd:aa:ee:bb";
+
+    private static final String NAS1 = "XXX-NASID";
+    private static final String NAS2 = "YYY-NASID";
+    private static final String NAS3 = "MNO-NASID";
+    private static final String NAS4 = "PQR-NASID";
+
+    private static final String CIRCUIT1 = "circuit123";
+    private static final String CIRCUIT2 = "circuit234";
+    private static final String CIRCUIT3 = "circuit567";
+    private static final String CIRCUIT4 = "circuit678";
+
+    private static final String REMOTE1 = "remote123";
+    private static final String REMOTE2 = "remote234";
+    private static final String REMOTE3 = "remote567";
+    private static final String REMOTE4 = "remote678";
+
+    private static final String IP1 = "10.10.10.10";
+    private static final String IP2 = "1.1.1.1";
+    private static final String IP3 = "30.30.30.30";
+    private static final String IP4 = "15.15.15.15";
+
+    protected static final String ID1 = "1";
+    protected static final String ID2 = "2";
+    protected static final String ID3 = "3";
+    protected static final String ID4 = "4";
+    protected static final String ID5 = "5";
+
+    UniTagInformation ttService1 = new UniTagInformation.Builder()
+            .setUniTagMatch(VlanId.vlanId(UNI_TAG_MATCH_1))
+            .setPonCTag(VlanId.vlanId(C_TAG_1))
+            .setPonSTag(VlanId.vlanId(S_TAG_1))
+            .setUsPonCTagPriority(C_TAG_PRIORITY)
+            .setUsPonSTagPriority(S_TAG_PRIORITY)
+            .setDsPonCTagPriority(C_TAG_PRIORITY)
+            .setDsPonSTagPriority(S_TAG_PRIORITY)
+            .setTechnologyProfileId(TECH_PROF_ID_1)
+            .setUpstreamBandwidthProfile(HSA)
+            .setDownstreamBandwidthProfile(HSA)
+            .setServiceName(HSA)
+            .build();
+
+    UniTagInformation ttService2 = new UniTagInformation.Builder()
+            .setUniTagMatch(VlanId.vlanId(UNI_TAG_MATCH_2))
+            .setPonCTag(VlanId.vlanId(C_TAG_1))
+            .setPonSTag(VlanId.vlanId(S_TAG_2))
+            .setUsPonCTagPriority(C_TAG_PRIORITY)
+            .setUsPonSTagPriority(S_TAG_PRIORITY)
+            .setDsPonCTagPriority(C_TAG_PRIORITY)
+            .setDsPonSTagPriority((S_TAG_PRIORITY))
+            .setTechnologyProfileId(TECH_PROF_ID_2)
+            .setUpstreamBandwidthProfile(IPTV)
+            .setDownstreamBandwidthProfile(IPTV)
+            .setServiceName(IPTV)
+            .setIsIgmpRequired(true)
+            .setIsDhcpRequired(true)
+            .setEnableMacLearning(true)
+            .setConfiguredMacAddress(MAC2)
+            .build();
+
+    UniTagInformation attService1 = new UniTagInformation.Builder()
+            .setPonCTag(VlanId.vlanId(C_TAG_1))
+            .setPonSTag(VlanId.vlanId(S_TAG_2))
+            .setTechnologyProfileId(TECH_PROF_ID_1)
+            .setUpstreamBandwidthProfile(HSA)
+            .setDownstreamBandwidthProfile(HSA)
+            .build();
+
+    List<UniTagInformation> uniTagListForTT = Lists.newArrayList(ttService1);
+    List<UniTagInformation> uniTagList2ForTT = Lists.newArrayList(ttService1, ttService2);
+    List<UniTagInformation> uniTagList3Att = Lists.newArrayList(attService1);
+
+    SubscriberAndDeviceInformationBuilder entry1 = SubscriberAndDeviceInformationBuilder.build(ID1, NAS_PORT_ID,
+            PORT_1, SLOT_1, MAC1, NAS1, IP1, CIRCUIT1, REMOTE1, uniTagListForTT);
+    SubscriberAndDeviceInformationBuilder entry2 = SubscriberAndDeviceInformationBuilder.build(ID2, NAS_PORT_ID,
+            PORT_2, SLOT_2, MAC1, NAS2, IP2, CIRCUIT2, REMOTE2, uniTagList2ForTT);
+    SubscriberAndDeviceInformationBuilder entry3 = SubscriberAndDeviceInformationBuilder.build(ID3, NAS_PORT_ID,
+            PORT_3, SLOT_3, MAC2, NAS3, IP3, CIRCUIT3, REMOTE3, uniTagListForTT);
+    SubscriberAndDeviceInformationBuilder entry4 = SubscriberAndDeviceInformationBuilder.build(ID4, NAS_PORT_ID,
+            PORT_4, SLOT_4, MAC3, NAS4, IP4, CIRCUIT4, REMOTE4, uniTagList2ForTT);
+    SubscriberAndDeviceInformationBuilder entry5 = SubscriberAndDeviceInformationBuilder.build(ID5, NAS_PORT_ID,
+            PORT_3, SLOT_3, MAC2, NAS3, IP3, CIRCUIT3, REMOTE3, uniTagList3Att);
+
     public void setUp(String localConfig, Class configClass) throws Exception {
         sadis = new SadisManager();
         sadis.coreService = new MockCoreService();
@@ -104,6 +219,33 @@
         }
     }
 
+    private static final class SubscriberAndDeviceInformationBuilder extends SubscriberAndDeviceInformation {
+
+        public static SubscriberAndDeviceInformationBuilder build(String id, String nasPortId,
+                                                                  short port, short slot, String mac,
+                                                                  String nasId, String ipAddress, String circuitId,
+                                                                  String remoteId,
+                                                                  List<UniTagInformation> uniTagList) {
+
+            SubscriberAndDeviceInformationBuilder info = new SubscriberAndDeviceInformationBuilder();
+            info.setId(id);
+            if (slot != -1) {
+                info.setSlot(slot);
+            }
+            info.setNasPortId(nasPortId);
+            info.setUplinkPort(port);
+            info.setHardwareIdentifier(MacAddress.valueOf(mac));
+            info.setIPAddress(Ip4Address.valueOf(ipAddress));
+            info.setNasId(nasId);
+            info.setCircuitId(circuitId);
+            info.setRemoteId(remoteId);
+
+            info.setUniTagList(uniTagList);
+
+            return info;
+        }
+
+    }
 
     /**
      * Mocks an ONOS configuration delegate to allow JSON based configuration to
diff --git a/app/src/test/java/org/opencord/sadis/impl/SubscriberAndDeviceManagerTest.java b/app/src/test/java/org/opencord/sadis/impl/SubscriberAndDeviceManagerTest.java
index 6ff5cc3..fa68966 100644
--- a/app/src/test/java/org/opencord/sadis/impl/SubscriberAndDeviceManagerTest.java
+++ b/app/src/test/java/org/opencord/sadis/impl/SubscriberAndDeviceManagerTest.java
@@ -24,34 +24,17 @@
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.onlab.packet.Ip4Address;
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.VlanId;
 
-import org.opencord.sadis.SubscriberAndDeviceInformation;
 import org.opencord.sadis.BaseConfig;
-import org.opencord.sadis.BaseInformationService;
 import org.opencord.sadis.BaseInformation;
+import org.opencord.sadis.BaseInformationService;
+import org.opencord.sadis.SubscriberAndDeviceInformation;
 
 /**
  * Set of tests of the SADIS ONOS application component.
  */
 public class SubscriberAndDeviceManagerTest extends BaseSadis {
 
-    SubscriberAndDeviceInformationBuilder entry1 = SubscriberAndDeviceInformationBuilder.build("1", (short) 2,
-            (short) 2, "1/1/2", (short) 125, (short) 3, "aa:bb:cc:dd:ee:ff", "XXX-NASID", "10.10.10.10",
-            "circuit123", "remote123", 64, "1Gb", "1Gb");
-    SubscriberAndDeviceInformationBuilder entry2 = SubscriberAndDeviceInformationBuilder.build("2", (short) 4,
-            (short) 4, "1/1/2", (short) 129, (short) 4, "aa:bb:cc:dd:ee:ff", "YYY-NASID", "1.1.1.1",
-            "circuit234", "remote234", 64, "10Gb", "10Gb");
-    SubscriberAndDeviceInformationBuilder entry3 = SubscriberAndDeviceInformationBuilder.build("3", (short) 7,
-            (short) 8, "1/1/2", (short) 130, (short) 7, "ff:aa:dd:cc:bb:ee", "MNO-NASID", "30.30.30.30",
-            "circuit567", "remote567", 64, "10Gb", "10Gb");
-    SubscriberAndDeviceInformationBuilder entry4 = SubscriberAndDeviceInformationBuilder.build("4", (short) 2,
-            (short) 1, "1/1/2", (short) 132, (short) 1, "ff:cc:dd:aa:ee:bb", "PQR-NASID", "15.15.15.15",
-            "circuit678", "remote678", 64, "5Gb", "5Gb");
-
-
     @Before
     public void setUp() throws Exception {
         config = new SubscriberAndDeviceInformationConfig();
@@ -74,23 +57,9 @@
     private void checkEntriesForSubscriberAndAccessDevice(BaseConfig config) {
         List<SubscriberAndDeviceInformation> entries = config.getEntries();
         assertEquals(3, entries.size());
-
-        SubscriberAndDeviceInformation sub = SubscriberAndDeviceInformationBuilder.build("1", (short) 2, (short) 2,
-                "1/1/2", (short) 125,
-                (short) 3, "aa:bb:cc:dd:ee:ff", "XXX-NASID", "10.10.10.10", "circuit123", "remote123",
-                64, "1Gb", "1Gb");
-        assertTrue(checkEquality(sub, entries.get(0)));
-
-
-        sub = SubscriberAndDeviceInformationBuilder.build("2", (short) 4, (short) 4, "1/1/2", (short) 129,
-                (short) 4, "aa:bb:cc:dd:ee:ff", "YYY-NASID", "1.1.1.1", "circuit234", "remote234",
-                64, "10Gb", "10Gb");
-        assertTrue(checkEquality(sub, entries.get(1)));
-
-        sub = SubscriberAndDeviceInformationBuilder.build("cc:dd:ee:ff:aa:bb", (short) -1, (short) -1, null,
-                (short) -1, (short) -1, "cc:dd:ee:ff:aa:bb", "CCC-NASID", "12.12.12.12", "circuit345", "remote345",
-                64, "10Gb", "10Gb");
-        assertTrue(checkEquality(sub, entries.get(2)));
+        assertTrue(checkEquality(entry1, entries.get(0)));
+        assertTrue(checkEquality(entry2, entries.get(1)));
+        assertTrue(checkEquality(entry5, entries.get(2)));
     }
 
     @Test
@@ -98,14 +67,15 @@
 
         BaseInformationService<SubscriberAndDeviceInformation> subscriberService = sadis.getSubscriberInfoService();
 
-        checkGetForExisting("1", entry1, subscriberService);
-        checkGetForExisting("2", entry2, subscriberService);
+        checkGetForExisting(ID1, entry1, subscriberService);
+        checkGetForExisting(ID2, entry2, subscriberService);
+        checkGetForExisting(ID5, entry5, subscriberService);
 
-        invalidateId("1", subscriberService);
-        checkFromBoth("1", entry1, subscriberService);
+        invalidateId(ID1, subscriberService);
+        checkFromBoth(ID1, entry1, subscriberService);
 
         invalidateAll(subscriberService);
-        checkFromBoth("2", entry2, subscriberService);
+        checkFromBoth(ID2, entry2, subscriberService);
     }
 
 
@@ -120,14 +90,14 @@
         config.init(subject, "sadis-remote-mode-test", node("/RemoteConfig.json"), mapper, delegate);
         configListener.event(event);
 
-        checkGetForExisting("3", entry3, subscriberService);
-        checkGetForExisting("4", entry4, subscriberService);
+        checkGetForExisting(ID3, entry3, subscriberService);
+        checkGetForExisting(ID4, entry4, subscriberService);
 
-        invalidateId("3", subscriberService);
-        checkFromBoth("3", entry3, subscriberService);
+        invalidateId(ID3, subscriberService);
+        checkFromBoth(ID3, entry3, subscriberService);
 
         invalidateAll(subscriberService);
-        checkFromBoth("4", entry4, subscriberService);
+        checkFromBoth(ID4, entry4, subscriberService);
     }
 
     @Test
@@ -136,60 +106,16 @@
         config.init(subject, "sadis-remote-mode-test", node("/RemoteConfig.json"), mapper, delegate);
         configListener.event(event);
 
-        checkGetForExisting("3", null, service);
-        checkGetForNonExist("1", service);
+        checkGetForExisting(ID3, null, service);
+        checkGetForNonExist(ID1, service);
 
         config.init(subject, "sadis-local-mode-test", node("/LocalSubConfig.json"), mapper, delegate);
         configListener.event(event);
 
-        checkGetForExisting("1", null, service);
-        checkGetForNonExist("3", service);
+        checkGetForExisting(ID1, null, service);
+        checkGetForNonExist(ID3, service);
     }
 
-
-    private static final class SubscriberAndDeviceInformationBuilder extends SubscriberAndDeviceInformation {
-
-        public static SubscriberAndDeviceInformationBuilder build(String id, short cTag, short sTag, String nasPortId,
-                                                                  short port, short slot, String mac, String nasId,
-                                                                  String ipAddress, String circuitId, String remoteId,
-                                                                  int technologyProfileId,
-                                                                  String upstreamBandwidthProfile,
-                                                                  String downstreamBandwidthProfile) {
-
-            SubscriberAndDeviceInformationBuilder info = new SubscriberAndDeviceInformationBuilder();
-            info.setId(id);
-            if (cTag != -1) {
-                info.setCTag(VlanId.vlanId(cTag));
-            }
-            if (sTag != -1) {
-                info.setSTag(VlanId.vlanId(sTag));
-            }
-            info.setNasPortId(nasPortId);
-            if (port != -1) {
-                info.setUplinkPort(port);
-            }
-            if (slot != -1) {
-                info.setSlot(slot);
-            }
-            info.setHardwareIdentifier(MacAddress.valueOf(mac));
-            info.setIPAddress(Ip4Address.valueOf(ipAddress));
-            info.setNasId(nasId);
-            info.setCircuitId(circuitId);
-            info.setRemoteId(remoteId);
-
-            if (technologyProfileId != -1) {
-                info.setTechnologyProfileId(technologyProfileId);
-            }
-
-            info.setUpstreamBandwidthProfile(upstreamBandwidthProfile);
-            info.setDownstreamBandwidthProfile(downstreamBandwidthProfile);
-
-            return info;
-        }
-
-    }
-
-    @Override
     public boolean checkEquality(BaseInformation localEntry, BaseInformation entry) {
         SubscriberAndDeviceInformation sub = (SubscriberAndDeviceInformation) localEntry;
         SubscriberAndDeviceInformation other = (SubscriberAndDeviceInformation) localEntry;
@@ -197,13 +123,6 @@
         if (other == null) {
             return false;
         }
-        if (sub.cTag() == null) {
-            if (other.cTag() != null) {
-                return false;
-            }
-        } else if (!sub.cTag().equals(other.cTag())) {
-            return false;
-        }
         if (sub.hardwareIdentifier() == null) {
             if (other.hardwareIdentifier() != null) {
                 return false;
@@ -242,13 +161,6 @@
         if (sub.uplinkPort() != other.uplinkPort()) {
             return false;
         }
-        if (sub.sTag() == null) {
-            if (other.sTag() != null) {
-                return false;
-            }
-        } else if (!sub.sTag().equals(other.sTag())) {
-            return false;
-        }
         if (sub.slot() != other.slot()) {
             return false;
         }
@@ -266,25 +178,13 @@
         } else if (!sub.remoteId().equals(other.remoteId())) {
             return false;
         }
-        if (sub.technologyProfileId() != other.technologyProfileId()) {
-            return false;
-        }
-        if (sub.upstreamBandwidthProfile() == null) {
-            if (other.upstreamBandwidthProfile() != null) {
+        if (sub.uniTagList() == null) {
+            if (other.uniTagList() != null) {
                 return false;
             }
-        } else if (!sub.upstreamBandwidthProfile().equals(other.upstreamBandwidthProfile())) {
-            return false;
-        }
-        if (sub.downstreamBandwidthProfile() == null) {
-            if (other.downstreamBandwidthProfile() != null) {
-                return false;
-            }
-        } else if (!sub.downstreamBandwidthProfile().equals(other.downstreamBandwidthProfile())) {
+        } else if (!sub.uniTagList().equals(other.uniTagList())) {
             return false;
         }
         return true;
     }
-
-
 }
diff --git a/app/src/test/resources/3 b/app/src/test/resources/3
index 496bf28..418b0b0 100644
--- a/app/src/test/resources/3
+++ b/app/src/test/resources/3
@@ -1,7 +1,5 @@
 {
       "id": "3",
-      "cTag": 7,
-      "sTag": 8,
       "nasPortId": "1/1/2",
       "uplinkPort": 130,
       "slot": 7,
@@ -10,7 +8,19 @@
       "nasId":"MNO-NASID",
       "circuitId":"circuit567",
       "remoteId":"remote567",
-      "technologyProfileId":64,
-      "upstreamBandwidthProfile":"10Gb",
-      "downstreamBandwidthProfile":"10Gb"
+      "uniTagList": [
+     	{
+     	    "uniTagMatch":100,
+     		"ponCTag":2,
+     		"ponSTag":2,
+     		"usPonCTagPriority":0,
+     		"usPonSTagPriority":1,
+     		"dsPonCTagPriority": 0,
+     		"dsPonSTagPriority": 0,
+     		"technologyProfileId":64,
+     		"upstreamBandwidthProfile":"HSA",
+     		"downstreamBandwidthProfile":"HSA",
+     		"serviceName":"HSIA"
+     	}
+     ]
 }
diff --git a/app/src/test/resources/4 b/app/src/test/resources/4
index 757e741..ea0b618 100644
--- a/app/src/test/resources/4
+++ b/app/src/test/resources/4
@@ -1,7 +1,5 @@
 {
       "id": "4",
-      "cTag": 2,
-      "sTag": 1,
       "nasPortId": "1/1/2",
       "uplinkPort": 132,
       "slot": 1,
@@ -10,7 +8,32 @@
       "nasId":"PQR-NASID",
       "circuitId":"circuit678",
       "remoteId":"remote678",
-      "technologyProfileId":64,
-      "upstreamBandwidthProfile":"5Gb",
-      "downstreamBandwidthProfile":"5Gb"
+      "uniTagList": [
+      	{
+      	    "uniTagMatch":100,
+      		"ponCTag":2,
+      		"ponSTag":2,
+      		"usPonCTagPriority":0,
+      		"usPonSTagPriority":1,
+      		"dsPonCTagPriority":0,
+      		"dsPonSTagPriority":0,
+      		"technologyProfileId":64,
+      		"upstreamBandwidthProfile":"HSA",
+      		"downstreamBandwidthProfile":"HSA",
+      		"serviceName":"HSIA"
+      	},
+      	{
+      		"uniTagMatch":200,
+      		"ponCTag":3,
+      		"ponSTag":2,
+      		"usPonCTagPriority":0,
+      		"usPonSTagPriority":1,
+      		"dsPonCTagPriority":0,
+      		"dsPonSTagPriority":0,
+      		"technologyProfileId":65,
+      		"upstreamBandwidthProfile":"IPTV",
+      		"downstreamBandwidthProfile":"IPTV",
+      		"serviceName":"IPTV"
+      	}
+      ]
 }
diff --git a/app/src/test/resources/LocalSubConfig.json b/app/src/test/resources/LocalSubConfig.json
index 99c861a..1efee37 100644
--- a/app/src/test/resources/LocalSubConfig.json
+++ b/app/src/test/resources/LocalSubConfig.json
@@ -12,8 +12,6 @@
 	[
 		{
 			"id": "1",
-			"cTag": 2,
-			"sTag": 2,
 			"nasPortId": "1/1/2",
 			"uplinkPort": 125,
 			"slot": 3,
@@ -22,15 +20,25 @@
 			"nasId":"XXX-NASID",
 			"circuitId":"circuit123",
 			"remoteId":"remote123",
-			"technologyProfileId":64,
-			"upstreamBandwidthProfile":"1Gb",
-			"downstreamBandwidthProfile":"1Gb"
+			"uniTagList": [
+				{
+					"uniTagMatch":100,
+					"ponCTag":"2,",
+					"ponSTag":"2",
+					"usPonCTagPriority":0,
+					"usPonSTagPriority":1,
+					"dsPonCTagPriority":0,
+					"dsPonSTagPriority":1,
+					"technologyProfileId":64,
+					"upstreamBandwidthProfile":"HSA",
+					"downstreamBandwidthProfile":"HSA",
+					"serviceName":"HSIA"
+				}
+			]
 		},
 
 		{
 			"id": "2",
-			"cTag": 4,
-			"sTag": 4,
 			"nasPortId": "1/1/2",
 			"uplinkPort": 129,
 			"slot": 4,
@@ -39,21 +47,57 @@
 			"nasId":"YYY-NASID",
 			"circuitId":"circuit234",
 			"remoteId":"remote234",
-			"technologyProfileId":64,
-			"upstreamBandwidthProfile":"10Gb",
-			"downstreamBandwidthProfile":"10Gb"
+			"uniTagList": [
+				{
+					"uniTagMatch":100,
+					"ponCTag":"2,",
+					"ponSTag":"2",
+					"usPonCTagPriority":0,
+					"usPonSTagPriority":1,
+					"dsPonCTagPriority":0,
+					"dsPonSTagPriority":1,
+					"technologyProfileId":64,
+					"upstreamBandwidthProfile":"HSA",
+					"downstreamBandwidthProfile":"HSA",
+					"serviceName":"HSIA"
+				},
+				{
+					"uniTagMatch":200,
+					"ponCTag":3,
+					"ponSTag":2,
+					"usPonCTagPriority":0,
+					"usPonSTagPriority":1,
+					"dsPonCTagPriority": 0,
+					"dsPonSTagPriority": 1,
+					"technologyProfileId":65,
+					"upstreamBandwidthProfile":"IPTV",
+					"downstreamBandwidthProfile":"IPTV",
+					"serviceName":"IPTV",
+					"isIgmpRequired": "true",
+					"isDhcpRequired": "true",
+					"configuredMacAddress": "\"ff:aa:dd:cc:bb:ee\""
+				}
+			]
 		},
-
 		{
-			"id": "cc:dd:ee:ff:aa:bb",
-			"hardwareIdentifier": "cc:dd:ee:ff:aa:bb",
-			"ipAddress":"12.12.12.12",
-			"nasId":"CCC-NASID",
-			"circuitId":"circuit345",
-			"remoteId":"remote345",
-			"technologyProfileId":64,
-			"upstreamBandwidthProfile":"10Gb",
-			"downstreamBandwidthProfile":"10Gb"
+			"id": "5",
+			"nasPortId": "1/1/2",
+			"uplinkPort": 125,
+			"slot": 3,
+			"hardwareIdentifier": "aa:bb:cc:dd:ee:ff",
+			"ipAddress":"10.10.10.10",
+			"nasId":"XXX-NASID",
+			"circuitId":"circuit123",
+			"remoteId":"remote123",
+			"uniTagList": [
+				{
+					"ponCTag":"2,",
+					"ponSTag":"2",
+					"technologyProfileId":64,
+					"upstreamBandwidthProfile":"HSA",
+					"downstreamBandwidthProfile":"HSA"
+				}
+			]
 		}
 	]
 }
