diff --git a/src/main/java/org.onosproject.xran/XranStore.java b/src/main/java/org.onosproject.xran/XranStore.java
index 00c4a81..349e8f5 100644
--- a/src/main/java/org.onosproject.xran/XranStore.java
+++ b/src/main/java/org.onosproject.xran/XranStore.java
@@ -51,6 +51,8 @@
 
     RnibLink getLink(ECGI ecgi, MMEUES1APID mme);
 
+    void modifyLinkRrmConf(RnibLink link, JsonNode rrmConf);
+
     void storeLink(RnibLink link);
 
     boolean removeLink(LinkId link);
@@ -71,7 +73,7 @@
 
     RnibCell getCell(ECGI cellId);
 
-    boolean modifyCellRrmConf(RnibCell cell, JsonNode rrmConf);
+    void modifyCellRrmConf(RnibCell cell, JsonNode rrmConf);
 
     void storeCell(RnibCell cell);
 
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionResponse.java b/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionResponse.java
index 8f6ad01..15c84e6 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionResponse.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionResponse.java
@@ -4,17 +4,17 @@
 
 package org.onosproject.xran.codecs.pdu;
 
+import org.onosproject.xran.codecs.api.*;
 import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
 import org.openmuc.jasn1.ber.BerLength;
 import org.openmuc.jasn1.ber.BerTag;
 import org.openmuc.jasn1.ber.types.BerInteger;
-import org.onosproject.xran.codecs.api.CRNTI;
-import org.onosproject.xran.codecs.api.ECGI;
-import org.onosproject.xran.codecs.api.ERABResponse;
+import org.openmuc.jasn1.ber.types.string.BerUTF8String;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
 
 public class BearerAdmissionResponse implements Serializable {
 
@@ -229,5 +229,48 @@
 		sb.append("}");
 	}
 
+	public static XrancPdu constructPacket(ECGI ecgi, CRNTI crnti, ERABParams erabParams, BerInteger numParams, boolean b) {
+		ERABResponse erabResponse = new ERABResponse();
+
+		for (int i = 0; i < numParams.intValue(); i++) {
+			ERABParamsItem erabParamsItem = erabParams.getERABParamsItem().get(i);
+
+			ERABResponseItem responseItem = new ERABResponseItem();
+			responseItem.setId(erabParamsItem.getId());
+
+			// FIXME: add logic
+			responseItem.setDecision(new ERABDecision(b ? 0 : 1));
+
+			erabResponse.setERABResponse(responseItem);
+		}
+
+
+		BearerAdmissionResponse bearerAdmissionResponse = new BearerAdmissionResponse();
+		bearerAdmissionResponse.setCrnti(crnti);
+		bearerAdmissionResponse.setEcgi(ecgi);
+		bearerAdmissionResponse.setErabResponse(erabResponse);
+		bearerAdmissionResponse.setNumErabList(numParams);
+
+		XrancPduBody body = new XrancPduBody();
+		body.setBearerAdmissionResponse(bearerAdmissionResponse);
+
+		BerUTF8String ver = null;
+		try {
+			ver = new BerUTF8String("3");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		XrancApiID apiID = new XrancApiID(9);
+		XrancPduHdr hdr = new XrancPduHdr();
+		hdr.setVer(ver);
+		hdr.setApiId(apiID);
+
+		XrancPdu pdu = new XrancPdu();
+		pdu.setHdr(hdr);
+		pdu.setBody(body);
+
+		return pdu;
+	}
+
 }
 
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigRequest.java b/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigRequest.java
index 9aa3254..d2a8b69 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigRequest.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigRequest.java
@@ -8,10 +8,12 @@
 import org.openmuc.jasn1.ber.BerLength;
 import org.openmuc.jasn1.ber.BerTag;
 import org.onosproject.xran.codecs.api.ECGI;
+import org.openmuc.jasn1.ber.types.string.BerUTF8String;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
 
 public class CellConfigRequest implements Serializable {
 
@@ -132,5 +134,26 @@
 		sb.append("}");
 	}
 
+	public static XrancPdu constructPacket(ECGI ecgi) throws UnsupportedEncodingException {
+		CellConfigRequest cellConfigRequest = new CellConfigRequest();
+		cellConfigRequest.setEcgi(ecgi);
+
+		BerUTF8String ver = new BerUTF8String("3");
+
+		XrancApiID apiID = new XrancApiID(0);
+		XrancPduBody body = new XrancPduBody();
+		body.setCellConfigRequest(cellConfigRequest);
+
+		XrancPduHdr hdr = new XrancPduHdr();
+		hdr.setVer(ver);
+		hdr.setApiId(apiID);
+
+		XrancPdu pdu = new XrancPdu();
+		pdu.setBody(body);
+		pdu.setHdr(hdr);
+
+		return pdu;
+	}
+
 }
 
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/HORequest.java b/src/main/java/org.onosproject.xran/codecs/pdu/HORequest.java
index 7079944..f6a3076 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/HORequest.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/HORequest.java
@@ -9,10 +9,12 @@
 import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
 import org.openmuc.jasn1.ber.BerLength;
 import org.openmuc.jasn1.ber.BerTag;
+import org.openmuc.jasn1.ber.types.string.BerUTF8String;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
 
 public class HORequest implements Serializable {
 
@@ -196,5 +198,29 @@
 		sb.append("}");
 	}
 
+	public static XrancPdu constructPacket(CRNTI crnti, ECGI ecgis, ECGI ecgit) throws UnsupportedEncodingException {
+		HORequest hoRequest = new HORequest();
+
+		hoRequest.setCrnti(crnti);
+		hoRequest.setEcgiS(ecgis);
+		hoRequest.setEcgiT(ecgit);
+
+		BerUTF8String ver = new BerUTF8String("3");
+
+		XrancApiID apiID = new XrancApiID(12);
+		XrancPduBody body = new XrancPduBody();
+		body.setHORequest(hoRequest);
+
+		XrancPduHdr hdr = new XrancPduHdr();
+		hdr.setVer(ver);
+		hdr.setApiId(apiID);
+
+		XrancPdu pdu = new XrancPdu();
+		pdu.setBody(body);
+		pdu.setHdr(hdr);
+
+		return pdu;
+	}
+
 }
 
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/L2MeasConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/L2MeasConfig.java
index a474ec3..f0de6d1 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/L2MeasConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/L2MeasConfig.java
@@ -9,10 +9,12 @@
 import org.openmuc.jasn1.ber.BerLength;
 import org.openmuc.jasn1.ber.BerTag;
 import org.openmuc.jasn1.ber.types.BerInteger;
+import org.openmuc.jasn1.ber.types.string.BerUTF8String;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
 
 public class L2MeasConfig implements Serializable {
 
@@ -164,5 +166,35 @@
 		sb.append("}");
 	}
 
+	public static XrancPdu constructPacket(ECGI ecgi, int l2MeasInterval) {
+
+		BerInteger reportIntervalMS = new BerInteger(l2MeasInterval);
+		L2MeasConfig measConfig = new L2MeasConfig();
+		measConfig.setEcgi(ecgi);
+		measConfig.setReportIntervalMs(reportIntervalMS);
+
+		BerUTF8String ver = null;
+		try {
+			ver = new BerUTF8String("3");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+
+		XrancApiID apiID = new XrancApiID(17);
+		XrancPduBody body = new XrancPduBody();
+		body.setL2MeasConfig(measConfig);
+
+		XrancPduHdr hdr = new XrancPduHdr();
+		hdr.setVer(ver);
+		hdr.setApiId(apiID);
+
+		XrancPdu pdu = new XrancPdu();
+		pdu.setBody(body);
+		pdu.setHdr(hdr);
+
+		return pdu;
+
+	}
+
 }
 
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java
index e7ff333..4c9bae7 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java
@@ -7,7 +7,6 @@
 import org.onosproject.xran.codecs.api.CRNTI;
 import org.onosproject.xran.codecs.api.ECGI;
 import org.onosproject.xran.codecs.api.XICICPA;
-import org.onosproject.xran.entities.RnibCell;
 import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
 import org.openmuc.jasn1.ber.BerLength;
 import org.openmuc.jasn1.ber.BerTag;
@@ -1347,6 +1346,14 @@
         public void addBerInteger(BerInteger berInteger) {
             seqOf.add(berInteger);
         }
+
+        public List<BerInteger> getSeqOf() {
+            return seqOf;
+        }
+
+        public void setSeqOf(List<BerInteger> seqOf) {
+            this.seqOf = seqOf;
+        }
     }
 
     public static class EndPrbUl implements Serializable {
@@ -1474,6 +1481,14 @@
         public void addBerInteger(BerInteger berInteger) {
             seqOf.add(berInteger);
         }
+
+        public List<BerInteger> getSeqOf() {
+            return seqOf;
+        }
+
+        public void setSeqOf(List<BerInteger> seqOf) {
+            this.seqOf = seqOf;
+        }
     }
 
     public static class SubframeBitmaskUl implements Serializable {
@@ -1600,18 +1615,18 @@
 
     }
 
-    public static XrancPdu constructPacket(RnibCell cell) {
+    public static XrancPdu constructPacket(RRMConfig config) {
         XrancPduBody body = new XrancPduBody();
-        body.setRRMConfig(cell.getRrmConfig());
+        body.setRRMConfig(config);
 
         BerUTF8String ver = null;
         try {
-            ver = new BerUTF8String("4");
+            ver = new BerUTF8String("3");
         } catch (UnsupportedEncodingException e) {
             e.printStackTrace();
         }
 
-        XrancApiID apiID = new XrancApiID(26);
+        XrancApiID apiID = new XrancApiID(29);
         XrancPduHdr hdr = new XrancPduHdr();
         hdr.setVer(ver);
         hdr.setApiId(apiID);
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasConfig.java
index c6704ce..f8b5403 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasConfig.java
@@ -8,10 +8,12 @@
 import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
 import org.openmuc.jasn1.ber.BerLength;
 import org.openmuc.jasn1.ber.BerTag;
+import org.openmuc.jasn1.ber.types.string.BerUTF8String;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -389,5 +391,37 @@
 		sb.append("}");
 	}
 
+	public static XrancPdu constructPacket(ECGI ecgi, CRNTI crnti, RXSigMeasConfig.MeasCells measCells, int interval) {
+		RXSigRepQty rxSigRepQty = new RXSigRepQty(2);
+		RXSigMeasRepInterval repInterval = new RXSigMeasRepInterval(interval);
+
+		RXSigMeasConfig sigMeasConfig = new RXSigMeasConfig();
+		sigMeasConfig.setCrnti(crnti);
+		sigMeasConfig.setEcgi(ecgi);
+		sigMeasConfig.setReportQty(rxSigRepQty);
+		sigMeasConfig.setMeasCells(measCells);
+		sigMeasConfig.setReportInterval(repInterval);
+
+		XrancPduBody body = new XrancPduBody();
+		body.setRXSigMeasConfig(sigMeasConfig);
+
+		BerUTF8String ver = null;
+		try {
+			ver = new BerUTF8String("3");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		XrancApiID apiID = new XrancApiID(15);
+		XrancPduHdr hdr = new XrancPduHdr();
+		hdr.setVer(ver);
+		hdr.setApiId(apiID);
+
+		XrancPdu pdu = new XrancPdu();
+		pdu.setHdr(hdr);
+		pdu.setBody(body);
+
+		return pdu;
+	}
+
 }
 
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionResponse.java b/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionResponse.java
index db6ed32..5d323b7 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionResponse.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionResponse.java
@@ -10,10 +10,12 @@
 import org.onosproject.xran.codecs.api.AdmEstResponse;
 import org.onosproject.xran.codecs.api.CRNTI;
 import org.onosproject.xran.codecs.api.ECGI;
+import org.openmuc.jasn1.ber.types.string.BerUTF8String;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
 
 public class UEAdmissionResponse implements Serializable {
 
@@ -196,5 +198,33 @@
 		sb.append("}");
 	}
 
+	public static XrancPdu constructPacket(ECGI ecgi, CRNTI crnti, boolean b) {
+		AdmEstResponse response = new AdmEstResponse(b ? 0 : 1);
+
+		UEAdmissionResponse ueAdmissionResponse = new UEAdmissionResponse();
+		ueAdmissionResponse.setCrnti(crnti);
+		ueAdmissionResponse.setEcgi(ecgi);
+		ueAdmissionResponse.setAdmEstResponse(response);
+
+		XrancPduBody body = new XrancPduBody();
+		body.setUEAdmissionResponse(ueAdmissionResponse);
+
+		BerUTF8String ver = null;
+		try {
+			ver = new BerUTF8String("3");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		XrancApiID apiID = new XrancApiID(3);
+		XrancPduHdr hdr = new XrancPduHdr();
+		hdr.setVer(ver);
+		hdr.setApiId(apiID);
+
+		XrancPdu pdu = new XrancPdu();
+		pdu.setHdr(hdr);
+		pdu.setBody(body);
+		return pdu;
+	}
+
 }
 
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityEnquiry.java b/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityEnquiry.java
index 84758d1..db212e5 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityEnquiry.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityEnquiry.java
@@ -9,10 +9,12 @@
 import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
 import org.openmuc.jasn1.ber.BerLength;
 import org.openmuc.jasn1.ber.BerTag;
+import org.openmuc.jasn1.ber.types.string.BerUTF8String;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
 
 
 public class UECapabilityEnquiry implements Serializable {
@@ -165,5 +167,31 @@
 		sb.append("}");
 	}
 
+	public static XrancPdu constructPacket(ECGI ecgi, CRNTI crnti) {
+		UECapabilityEnquiry capabilityEnquiry = new UECapabilityEnquiry();
+		capabilityEnquiry.setCrnti(crnti);
+		capabilityEnquiry.setEcgi(ecgi);
+
+		XrancPduBody body = new XrancPduBody();
+		body.setUECapabilityEnquiry(capabilityEnquiry);
+
+		BerUTF8String ver = null;
+		try {
+			ver = new BerUTF8String("3");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		XrancApiID apiID = new XrancApiID(25);
+		XrancPduHdr hdr = new XrancPduHdr();
+		hdr.setVer(ver);
+		hdr.setApiId(apiID);
+
+		XrancPdu pdu = new XrancPdu();
+		pdu.setHdr(hdr);
+		pdu.setBody(body);
+
+		return pdu;
+	}
+
 }
 
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UEAttachComplete.java b/src/main/java/org.onosproject.xran/codecs/pdu/UEContextUpdate.java
similarity index 97%
rename from src/main/java/org.onosproject.xran/codecs/pdu/UEAttachComplete.java
rename to src/main/java/org.onosproject.xran/codecs/pdu/UEContextUpdate.java
index 74050d7..d9d6066 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UEAttachComplete.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UEContextUpdate.java
@@ -16,7 +16,7 @@
 import java.io.InputStream;
 import java.io.Serializable;
 
-public class UEAttachComplete implements Serializable {
+public class UEContextUpdate implements Serializable {
 
 	private static final long serialVersionUID = 1L;
 
@@ -28,10 +28,10 @@
 	private MMEUES1APID mMEUES1APID = null;
 	private ENBUES1APID eNBUES1APID = null;
 	
-	public UEAttachComplete() {
+	public UEContextUpdate() {
 	}
 
-	public UEAttachComplete(byte[] code) {
+	public UEContextUpdate(byte[] code) {
 		this.code = code;
 	}
 
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
index f02d36a..6efe465 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
@@ -12,9 +12,12 @@
 import org.openmuc.jasn1.ber.BerTag;
 import org.openmuc.jasn1.ber.types.BerBitString;
 import org.openmuc.jasn1.ber.types.BerInteger;
+import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
 
 public class XICICConfig implements Serializable {
 
@@ -446,5 +449,26 @@
 		sb.append("}");
 	}
 
+	public static XrancPdu constructPacket(RRMConfig config) {
+		XrancPduBody body = new XrancPduBody();
+		body.setRRMConfig(config);
+
+		BerUTF8String ver = null;
+		try {
+			ver = new BerUTF8String("3");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+
+		XrancApiID apiID = new XrancApiID(23);
+		XrancPduHdr hdr = new XrancPduHdr();
+		hdr.setVer(ver);
+		hdr.setApiId(apiID);
+
+		XrancPdu pdu = new XrancPdu();
+		pdu.setHdr(hdr);
+		pdu.setBody(body);
+		return pdu;
+	}
 }
 
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduBody.java b/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduBody.java
index c0a38fc..2770211 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduBody.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduBody.java
@@ -20,16 +20,14 @@
 	private CellConfigReport cellConfigReport = null;
 	private UEAdmissionRequest uEAdmissionRequest = null;
 	private UEAdmissionResponse uEAdmissionResponse = null;
-	private UEAttachComplete uEAttachComplete = null;
 	private UEAdmissionStatus uEAdmissionStatus = null;
+	private UEContextUpdate uEContextUpdate = null;
 	private UEReconfigInd uEReconfigInd = null;
 	private UEReleaseInd uEReleaseInd = null;
 	private BearerAdmissionRequest bearerAdmissionRequest = null;
 	private BearerAdmissionResponse bearerAdmissionResponse = null;
 	private BearerAdmissionStatus bearerAdmissionStatus = null;
 	private BearerReleaseInd bearerReleaseInd = null;
-	private UECapabilityEnquiry uECapabilityEnquiry = null;
-	private UECapabilityInfo uECapabilityInfo = null;
 	private HORequest hORequest = null;
 	private HOFailure hOFailure = null;
 	private HOComplete hOComplete = null;
@@ -42,16 +40,18 @@
 	private SchedMeasReportPerCell schedMeasReportPerCell = null;
 	private PDCPMeasReportPerUe pDCPMeasReportPerUe = null;
 	private XICICConfig xICICConfig = null;
-	private RRMConfig rRMConfig = null;
-	private RRMConfigStatus rRMConfigStatus = null;
+	private UECapabilityInfo uECapabilityInfo = null;
+	private UECapabilityEnquiry uECapabilityEnquiry = null;
 	private ScellAdd scellAdd = null;
 	private ScellAddStatus scellAddStatus = null;
 	private ScellDelete scellDelete = null;
+	private RRMConfig rRMConfig = null;
+	private RRMConfigStatus rRMConfigStatus = null;
 	private SeNBAdd seNBAdd = null;
 	private SeNBAddStatus seNBAddStatus = null;
 	private SeNBDelete seNBDelete = null;
 	private TrafficSplitConfig trafficSplitConfig = null;
-	
+
 	public XrancPduBody() {
 	}
 
@@ -91,14 +91,6 @@
 		return uEAdmissionResponse;
 	}
 
-	public void setUEAttachComplete(UEAttachComplete uEAttachComplete) {
-		this.uEAttachComplete = uEAttachComplete;
-	}
-
-	public UEAttachComplete getUEAttachComplete() {
-		return uEAttachComplete;
-	}
-
 	public void setUEAdmissionStatus(UEAdmissionStatus uEAdmissionStatus) {
 		this.uEAdmissionStatus = uEAdmissionStatus;
 	}
@@ -107,6 +99,14 @@
 		return uEAdmissionStatus;
 	}
 
+	public void setUEContextUpdate(UEContextUpdate uEContextUpdate) {
+		this.uEContextUpdate = uEContextUpdate;
+	}
+
+	public UEContextUpdate getUEContextUpdate() {
+		return uEContextUpdate;
+	}
+
 	public void setUEReconfigInd(UEReconfigInd uEReconfigInd) {
 		this.uEReconfigInd = uEReconfigInd;
 	}
@@ -155,22 +155,6 @@
 		return bearerReleaseInd;
 	}
 
-	public void setUECapabilityEnquiry(UECapabilityEnquiry uECapabilityEnquiry) {
-		this.uECapabilityEnquiry = uECapabilityEnquiry;
-	}
-
-	public UECapabilityEnquiry getUECapabilityEnquiry() {
-		return uECapabilityEnquiry;
-	}
-
-	public void setUECapabilityInfo(UECapabilityInfo uECapabilityInfo) {
-		this.uECapabilityInfo = uECapabilityInfo;
-	}
-
-	public UECapabilityInfo getUECapabilityInfo() {
-		return uECapabilityInfo;
-	}
-
 	public void setHORequest(HORequest hORequest) {
 		this.hORequest = hORequest;
 	}
@@ -267,20 +251,20 @@
 		return xICICConfig;
 	}
 
-	public void setRRMConfig(RRMConfig rRMConfig) {
-		this.rRMConfig = rRMConfig;
+	public void setUECapabilityInfo(UECapabilityInfo uECapabilityInfo) {
+		this.uECapabilityInfo = uECapabilityInfo;
 	}
 
-	public RRMConfig getRRMConfig() {
-		return rRMConfig;
+	public UECapabilityInfo getUECapabilityInfo() {
+		return uECapabilityInfo;
 	}
 
-	public void setRRMConfigStatus(RRMConfigStatus rRMConfigStatus) {
-		this.rRMConfigStatus = rRMConfigStatus;
+	public void setUECapabilityEnquiry(UECapabilityEnquiry uECapabilityEnquiry) {
+		this.uECapabilityEnquiry = uECapabilityEnquiry;
 	}
 
-	public RRMConfigStatus getRRMConfigStatus() {
-		return rRMConfigStatus;
+	public UECapabilityEnquiry getUECapabilityEnquiry() {
+		return uECapabilityEnquiry;
 	}
 
 	public void setScellAdd(ScellAdd scellAdd) {
@@ -307,6 +291,22 @@
 		return scellDelete;
 	}
 
+	public void setRRMConfig(RRMConfig rRMConfig) {
+		this.rRMConfig = rRMConfig;
+	}
+
+	public RRMConfig getRRMConfig() {
+		return rRMConfig;
+	}
+
+	public void setRRMConfigStatus(RRMConfigStatus rRMConfigStatus) {
+		this.rRMConfigStatus = rRMConfigStatus;
+	}
+
+	public RRMConfigStatus getRRMConfigStatus() {
+		return rRMConfigStatus;
+	}
+
 	public void setSeNBAdd(SeNBAdd seNBAdd) {
 		this.seNBAdd = seNBAdd;
 	}
@@ -357,7 +357,7 @@
 			codeLength += 2;
 			return codeLength;
 		}
-		
+
 		if (seNBDelete != null) {
 			codeLength += seNBDelete.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 33
@@ -366,7 +366,7 @@
 			codeLength += 2;
 			return codeLength;
 		}
-		
+
 		if (seNBAddStatus != null) {
 			codeLength += seNBAddStatus.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 32
@@ -375,7 +375,7 @@
 			codeLength += 2;
 			return codeLength;
 		}
-		
+
 		if (seNBAdd != null) {
 			codeLength += seNBAdd.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 31
@@ -384,159 +384,159 @@
 			codeLength += 2;
 			return codeLength;
 		}
-		
-		if (scellDelete != null) {
-			codeLength += scellDelete.encode(os, false);
+
+		if (rRMConfigStatus != null) {
+			codeLength += rRMConfigStatus.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 30
 			os.write(0xBE);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (scellAddStatus != null) {
-			codeLength += scellAddStatus.encode(os, false);
+
+		if (rRMConfig != null) {
+			codeLength += rRMConfig.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 29
 			os.write(0xBD);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (scellAdd != null) {
-			codeLength += scellAdd.encode(os, false);
+
+		if (scellDelete != null) {
+			codeLength += scellDelete.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 28
 			os.write(0xBC);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (rRMConfigStatus != null) {
-			codeLength += rRMConfigStatus.encode(os, false);
+
+		if (scellAddStatus != null) {
+			codeLength += scellAddStatus.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 27
 			os.write(0xBB);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (rRMConfig != null) {
-			codeLength += rRMConfig.encode(os, false);
+
+		if (scellAdd != null) {
+			codeLength += scellAdd.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 26
 			os.write(0xBA);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (xICICConfig != null) {
-			codeLength += xICICConfig.encode(os, false);
+
+		if (uECapabilityEnquiry != null) {
+			codeLength += uECapabilityEnquiry.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 25
 			os.write(0xB9);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (pDCPMeasReportPerUe != null) {
-			codeLength += pDCPMeasReportPerUe.encode(os, false);
+
+		if (uECapabilityInfo != null) {
+			codeLength += uECapabilityInfo.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 24
 			os.write(0xB8);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (schedMeasReportPerCell != null) {
-			codeLength += schedMeasReportPerCell.encode(os, false);
+
+		if (xICICConfig != null) {
+			codeLength += xICICConfig.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 23
 			os.write(0xB7);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (schedMeasReportPerUE != null) {
-			codeLength += schedMeasReportPerUE.encode(os, false);
+
+		if (pDCPMeasReportPerUe != null) {
+			codeLength += pDCPMeasReportPerUe.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 22
 			os.write(0xB6);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (radioMeasReportPerCell != null) {
-			codeLength += radioMeasReportPerCell.encode(os, false);
+
+		if (schedMeasReportPerCell != null) {
+			codeLength += schedMeasReportPerCell.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 21
 			os.write(0xB5);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (radioMeasReportPerUE != null) {
-			codeLength += radioMeasReportPerUE.encode(os, false);
+
+		if (schedMeasReportPerUE != null) {
+			codeLength += schedMeasReportPerUE.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 20
 			os.write(0xB4);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (l2MeasConfig != null) {
-			codeLength += l2MeasConfig.encode(os, false);
+
+		if (radioMeasReportPerCell != null) {
+			codeLength += radioMeasReportPerCell.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 19
 			os.write(0xB3);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (rXSigMeasReport != null) {
-			codeLength += rXSigMeasReport.encode(os, false);
+
+		if (radioMeasReportPerUE != null) {
+			codeLength += radioMeasReportPerUE.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 18
 			os.write(0xB2);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (rXSigMeasConfig != null) {
-			codeLength += rXSigMeasConfig.encode(os, false);
+
+		if (l2MeasConfig != null) {
+			codeLength += l2MeasConfig.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 17
 			os.write(0xB1);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (hOComplete != null) {
-			codeLength += hOComplete.encode(os, false);
+
+		if (rXSigMeasReport != null) {
+			codeLength += rXSigMeasReport.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 16
 			os.write(0xB0);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (hOFailure != null) {
-			codeLength += hOFailure.encode(os, false);
+
+		if (rXSigMeasConfig != null) {
+			codeLength += rXSigMeasConfig.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 15
 			os.write(0xAF);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (hORequest != null) {
-			codeLength += hORequest.encode(os, false);
+
+		if (hOComplete != null) {
+			codeLength += hOComplete.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 14
 			os.write(0xAE);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (uECapabilityInfo != null) {
-			codeLength += uECapabilityInfo.encode(os, false);
+
+		if (hOFailure != null) {
+			codeLength += hOFailure.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 13
 			os.write(0xAD);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (uECapabilityEnquiry != null) {
-			codeLength += uECapabilityEnquiry.encode(os, false);
+
+		if (hORequest != null) {
+			codeLength += hORequest.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 12
 			os.write(0xAC);
 			codeLength += 1;
 			return codeLength;
 		}
-		
+
 		if (bearerReleaseInd != null) {
 			codeLength += bearerReleaseInd.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 11
@@ -544,7 +544,7 @@
 			codeLength += 1;
 			return codeLength;
 		}
-		
+
 		if (bearerAdmissionStatus != null) {
 			codeLength += bearerAdmissionStatus.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 10
@@ -552,7 +552,7 @@
 			codeLength += 1;
 			return codeLength;
 		}
-		
+
 		if (bearerAdmissionResponse != null) {
 			codeLength += bearerAdmissionResponse.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 9
@@ -560,7 +560,7 @@
 			codeLength += 1;
 			return codeLength;
 		}
-		
+
 		if (bearerAdmissionRequest != null) {
 			codeLength += bearerAdmissionRequest.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 8
@@ -568,7 +568,7 @@
 			codeLength += 1;
 			return codeLength;
 		}
-		
+
 		if (uEReleaseInd != null) {
 			codeLength += uEReleaseInd.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 7
@@ -576,7 +576,7 @@
 			codeLength += 1;
 			return codeLength;
 		}
-		
+
 		if (uEReconfigInd != null) {
 			codeLength += uEReconfigInd.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 6
@@ -584,23 +584,23 @@
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (uEAdmissionStatus != null) {
-			codeLength += uEAdmissionStatus.encode(os, false);
+
+		if (uEContextUpdate != null) {
+			codeLength += uEContextUpdate.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 5
 			os.write(0xA5);
 			codeLength += 1;
 			return codeLength;
 		}
-		
-		if (uEAttachComplete != null) {
-			codeLength += uEAttachComplete.encode(os, false);
+
+		if (uEAdmissionStatus != null) {
+			codeLength += uEAdmissionStatus.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 4
 			os.write(0xA4);
 			codeLength += 1;
 			return codeLength;
 		}
-		
+
 		if (uEAdmissionResponse != null) {
 			codeLength += uEAdmissionResponse.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 3
@@ -608,7 +608,7 @@
 			codeLength += 1;
 			return codeLength;
 		}
-		
+
 		if (uEAdmissionRequest != null) {
 			codeLength += uEAdmissionRequest.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 2
@@ -616,7 +616,7 @@
 			codeLength += 1;
 			return codeLength;
 		}
-		
+
 		if (cellConfigReport != null) {
 			codeLength += cellConfigReport.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 1
@@ -624,7 +624,7 @@
 			codeLength += 1;
 			return codeLength;
 		}
-		
+
 		if (cellConfigRequest != null) {
 			codeLength += cellConfigRequest.encode(os, false);
 			// write tag: CONTEXT_CLASS, CONSTRUCTED, 0
@@ -632,7 +632,7 @@
 			codeLength += 1;
 			return codeLength;
 		}
-		
+
 		throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
 	}
 
@@ -675,14 +675,14 @@
 		}
 
 		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 4)) {
-			uEAttachComplete = new UEAttachComplete();
-			codeLength += uEAttachComplete.decode(is, false);
+			uEAdmissionStatus = new UEAdmissionStatus();
+			codeLength += uEAdmissionStatus.decode(is, false);
 			return codeLength;
 		}
 
 		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 5)) {
-			uEAdmissionStatus = new UEAdmissionStatus();
-			codeLength += uEAdmissionStatus.decode(is, false);
+			uEContextUpdate = new UEContextUpdate();
+			codeLength += uEContextUpdate.decode(is, false);
 			return codeLength;
 		}
 
@@ -723,119 +723,119 @@
 		}
 
 		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 12)) {
-			uECapabilityEnquiry = new UECapabilityEnquiry();
-			codeLength += uECapabilityEnquiry.decode(is, false);
-			return codeLength;
-		}
-
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) {
-			uECapabilityInfo = new UECapabilityInfo();
-			codeLength += uECapabilityInfo.decode(is, false);
-			return codeLength;
-		}
-
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 14)) {
 			hORequest = new HORequest();
 			codeLength += hORequest.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 15)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 13)) {
 			hOFailure = new HOFailure();
 			codeLength += hOFailure.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 16)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 14)) {
 			hOComplete = new HOComplete();
 			codeLength += hOComplete.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 17)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 15)) {
 			rXSigMeasConfig = new RXSigMeasConfig();
 			codeLength += rXSigMeasConfig.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 18)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 16)) {
 			rXSigMeasReport = new RXSigMeasReport();
 			codeLength += rXSigMeasReport.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 19)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 17)) {
 			l2MeasConfig = new L2MeasConfig();
 			codeLength += l2MeasConfig.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 20)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 18)) {
 			radioMeasReportPerUE = new RadioMeasReportPerUE();
 			codeLength += radioMeasReportPerUE.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 21)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 19)) {
 			radioMeasReportPerCell = new RadioMeasReportPerCell();
 			codeLength += radioMeasReportPerCell.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 22)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 20)) {
 			schedMeasReportPerUE = new SchedMeasReportPerUE();
 			codeLength += schedMeasReportPerUE.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 23)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 21)) {
 			schedMeasReportPerCell = new SchedMeasReportPerCell();
 			codeLength += schedMeasReportPerCell.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 24)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 22)) {
 			pDCPMeasReportPerUe = new PDCPMeasReportPerUe();
 			codeLength += pDCPMeasReportPerUe.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 25)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 23)) {
 			xICICConfig = new XICICConfig();
 			codeLength += xICICConfig.decode(is, false);
 			return codeLength;
 		}
 
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 24)) {
+			uECapabilityInfo = new UECapabilityInfo();
+			codeLength += uECapabilityInfo.decode(is, false);
+			return codeLength;
+		}
+
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 25)) {
+			uECapabilityEnquiry = new UECapabilityEnquiry();
+			codeLength += uECapabilityEnquiry.decode(is, false);
+			return codeLength;
+		}
+
 		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 26)) {
-			rRMConfig = new RRMConfig();
-			codeLength += rRMConfig.decode(is, false);
-			return codeLength;
-		}
-
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 27)) {
-			rRMConfigStatus = new RRMConfigStatus();
-			codeLength += rRMConfigStatus.decode(is, false);
-			return codeLength;
-		}
-
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 28)) {
 			scellAdd = new ScellAdd();
 			codeLength += scellAdd.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 29)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 27)) {
 			scellAddStatus = new ScellAddStatus();
 			codeLength += scellAddStatus.decode(is, false);
 			return codeLength;
 		}
 
-		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 30)) {
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 28)) {
 			scellDelete = new ScellDelete();
 			codeLength += scellDelete.decode(is, false);
 			return codeLength;
 		}
 
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 29)) {
+			rRMConfig = new RRMConfig();
+			codeLength += rRMConfig.decode(is, false);
+			return codeLength;
+		}
+
+		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 30)) {
+			rRMConfigStatus = new RRMConfigStatus();
+			codeLength += rRMConfigStatus.decode(is, false);
+			return codeLength;
+		}
+
 		if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 31)) {
 			seNBAdd = new SeNBAdd();
 			codeLength += seNBAdd.decode(is, false);
@@ -905,9 +905,9 @@
 			return;
 		}
 
-		if (uEAttachComplete != null) {
-			sb.append("\"uEAttachComplete\": ");
-			uEAttachComplete.appendAsString(sb, indentLevel + 1);
+		if (uEContextUpdate != null) {
+			sb.append("\"uEContextUpdate\": ");
+			uEContextUpdate.appendAsString(sb, indentLevel + 1);
 			return;
 		}
 
diff --git a/src/main/java/org.onosproject.xran/controller/XranController.java b/src/main/java/org.onosproject.xran/controller/XranController.java
index 9f2ae7a..42ca41e 100644
--- a/src/main/java/org.onosproject.xran/controller/XranController.java
+++ b/src/main/java/org.onosproject.xran/controller/XranController.java
@@ -16,12 +16,11 @@
 
 package org.onosproject.xran.controller;
 
-import org.onosproject.xran.entities.RnibCell;
+import org.onosproject.xran.codecs.pdu.RRMConfig;
 import org.onosproject.xran.entities.RnibLink;
 import org.onosproject.xran.providers.XranDeviceListener;
 import org.onosproject.xran.providers.XranHostListener;
 
-import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.SynchronousQueue;
 
 /**
@@ -39,5 +38,5 @@
 
     void removeListener(XranHostListener listener);
 
-    SynchronousQueue<String> sendModifiedRRMConf(RnibCell cell);
+    SynchronousQueue<String> sendModifiedRRMConf(RRMConfig rrmConfig, boolean xICIC);
 }
diff --git a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
index a3740bc..a5e073a 100644
--- a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
+++ b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
@@ -41,7 +41,6 @@
 import org.onosproject.xran.impl.XranConfig;
 import org.onosproject.xran.providers.XranDeviceListener;
 import org.onosproject.xran.providers.XranHostListener;
-import org.onosproject.xran.samplemessages.*;
 import org.onosproject.xran.wrapper.CellMap;
 import org.onosproject.xran.wrapper.LinkMap;
 import org.onosproject.xran.wrapper.UeMap;
@@ -49,10 +48,12 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.xml.bind.DatatypeConverter;
 import java.io.IOException;
 import java.util.*;
-import java.util.concurrent.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.SynchronousQueue;
 import java.util.stream.Collectors;
 
 import static org.onosproject.net.DeviceId.deviceId;
@@ -153,14 +154,14 @@
 
     @Override
     public SynchronousQueue<String> sendHORequest(RnibLink newLink, RnibLink oldLink) {
-        ECGI newEcgi = newLink.getLinkId().getSourceId(),
-                oldEcgi = oldLink.getLinkId().getSourceId();
-        CRNTI crnti = linkMap.getCrnti(newLink.getLinkId().getDestinationId());
+        ECGI newEcgi = newLink.getLinkId().getEcgi(),
+                oldEcgi = oldLink.getLinkId().getEcgi();
+        CRNTI crnti = linkMap.getCrnti(newLink.getLinkId().getMmeues1apid());
         ChannelHandlerContext newCtx = cellMap.getCtx(newEcgi),
                 oldCtx = cellMap.getCtx(oldEcgi);
 
         try {
-            XrancPdu xrancPdu = HandoffRequest.constructPacket(crnti, oldEcgi, newEcgi);
+            XrancPdu xrancPdu = HORequest.constructPacket(crnti, oldEcgi, newEcgi);
             newCtx.writeAndFlush(getSctpMessage(xrancPdu));
             oldCtx.writeAndFlush(getSctpMessage(xrancPdu));
         } catch (IOException e) {
@@ -194,11 +195,16 @@
     }
 
     @Override
-    public SynchronousQueue<String> sendModifiedRRMConf(RnibCell cell) {
-        ECGI ecgi = cell.getEcgi();
+    public SynchronousQueue<String> sendModifiedRRMConf(RRMConfig rrmConfig, boolean xICIC) {
+        ECGI ecgi = rrmConfig.getEcgi();
         ChannelHandlerContext ctx = cellMap.getCtx(ecgi);
         try {
-            XrancPdu pdu = RRMConfig.constructPacket(cell);
+            XrancPdu pdu;
+            if (xICIC) {
+                pdu = XICICConfig.constructPacket(rrmConfig);
+            } else {
+                pdu = RRMConfig.constructPacket(rrmConfig);
+            }
             ctx.writeAndFlush(getSctpMessage(pdu));
         } catch (IOException e) {
             e.printStackTrace();
@@ -261,7 +267,7 @@
                                             if (conf == null) {
                                                 try {
                                                     ChannelHandlerContext ctx = cellMap.getCtx(ecgi);
-                                                    XrancPdu xrancPdu = ConfigEncoderDecoder.constructPacket(ecgi);
+                                                    XrancPdu xrancPdu = CellConfigRequest.constructPacket(ecgi);
                                                     ctx.writeAndFlush(getSctpMessage(xrancPdu));
                                                 } catch (IOException e) {
                                                     log.error(ExceptionUtils.getFullStackTrace(e));
@@ -273,7 +279,7 @@
                                                 try {
                                                     ChannelHandlerContext ctx = cellMap.
                                                             getCtx(ecgi);
-                                                    XrancPdu xrancPdu = L2MeasConf.constructPacket(ecgi, xranConfig.getL2MeasInterval());
+                                                    XrancPdu xrancPdu = L2MeasConfig.constructPacket(ecgi, xranConfig.getL2MeasInterval());
                                                     cell.setMeasConfig(xrancPdu.getBody().getL2MeasConfig());
                                                     SctpMessage sctpMessage = getSctpMessage(xrancPdu);
                                                     ctx.writeAndFlush(sctpMessage);
@@ -325,7 +331,7 @@
                                             if (ue.getCapability() == null) {
                                                 try {
                                                     ChannelHandlerContext ctx = cellMap.getCtx(primary.getEcgi());
-                                                    XrancPdu xrancPdu = UECapabilityEnq.constructPacket(
+                                                    XrancPdu xrancPdu = UECapabilityEnquiry.constructPacket(
                                                             primary.getEcgi(),
                                                             ue.getRanId());
                                                     ctx.writeAndFlush(getSctpMessage(xrancPdu));
@@ -347,7 +353,7 @@
                                                                 measCells.setPCIARFCN(pciarfcn);
                                                             }
                                                         });
-                                                        XrancPdu xrancPdu = SignalMeasConfig.constructPacket(
+                                                        XrancPdu xrancPdu = RXSigMeasConfig.constructPacket(
                                                                 primary.getEcgi(),
                                                                 ue.getRanId(),
                                                                 measCells,
@@ -436,7 +442,7 @@
 
                 Set<ECGI> ecgiSet = xranStore.getLinksByUeId(ue.getMmeS1apId().longValue())
                         .stream()
-                        .map(l -> l.getLinkId().getSourceId())
+                        .map(l -> l.getLinkId().getEcgi())
                         .collect(Collectors.toSet());
 
                 for (XranHostListener l : xranHostListeners) {
@@ -486,6 +492,7 @@
                     ECGI ecgi = report.getEcgi();
 
                     RnibCell cell = xranStore.getCell(ecgi);
+                    cell.setVersion(recv_pdu.getHdr().getVer().toString());
                     cell.setConf(report);
 
                     break;
@@ -497,7 +504,7 @@
                     ECGI ecgi = ueAdmissionRequest.getEcgi();
                     if (xranStore.getCell(ecgi) != null) {
                         CRNTI crnti = ueAdmissionRequest.getCrnti();
-                        send_pdu = UEAdmEncoderDecoder.constructPacket(ecgi, crnti);
+                        send_pdu = UEAdmissionResponse.constructPacket(ecgi, crnti, xranConfig.admissionFlag());
                         ctx.writeAndFlush(getSctpMessage(send_pdu));
                     } else {
                         log.warn("Could not find ECGI in registered cells: {}", ecgi);
@@ -520,18 +527,18 @@
                 }
                 case 5: {
                     // Decode UE Admission Context Update.
-                    UEAttachComplete ueAttachComplete = recv_pdu.getBody().getUEAttachComplete();
+                    UEContextUpdate ueContextUpdate = recv_pdu.getBody().getUEContextUpdate();
 
-                    RnibCell cell = xranStore.getCell(ueAttachComplete.getEcgi());
+                    RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
 
-                    RnibUe ue = ueMap.get(ueAttachComplete.getMMEUES1APID());
-                    if (ueMap.get(ueAttachComplete.getMMEUES1APID()) == null) {
+                    RnibUe ue = ueMap.get(ueContextUpdate.getMMEUES1APID());
+                    if (ueMap.get(ueContextUpdate.getMMEUES1APID()) == null) {
                         ue = new RnibUe();
                     }
 
-                    ue.setMmeS1apId(ueAttachComplete.getMMEUES1APID());
-                    ue.setEnbS1apId(ueAttachComplete.getENBUES1APID());
-                    ue.setRanId(ueAttachComplete.getCrnti());
+                    ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
+                    ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
+                    ue.setRanId(ueContextUpdate.getCrnti());
 
                     hostAgent.addConnectedHost(ue, cell, ctx);
                     break;
@@ -574,22 +581,19 @@
                     }
 
                     BerInteger numErabs = bearerAdmissionRequest.getNumErabs();
-
-                    send_pdu = BearerEncoderDecoder.constructPacket(ecgi, crnti, erabParams, numErabs);
-                    // Encode and send Bearer Admission Response - API ID 9
+                    // Encode and send Bearer Admission Response
+                    send_pdu = BearerAdmissionResponse.constructPacket(ecgi, crnti, erabParams, numErabs, xranConfig.bearerFlag());
                     ctx.writeAndFlush(getSctpMessage(send_pdu));
                     break;
                 }
                 case 10: {
                     //Decode Bearer Admission Status
                     BearerAdmissionStatus bearerAdmissionStatus = recv_pdu.getBody().getBearerAdmissionStatus();
-
+                    break;
 //                    ECGI ecgi = bearerAdmissionStatus.getEcgi();
 //                    CRNTI crnti = bearerAdmissionStatus.getCrnti();
 //
 //                    RnibLink link = linkMap.get(ecgi, crnti);
-
-                    break;
                 }
                 case 11: {
                     //Decode Bearer Release Ind
@@ -610,32 +614,9 @@
                             }).collect(Collectors.toList());
 
                     link.getBearerParameters().setERABParamsItem(new ArrayList<>(unreleased));
-
-                    break;
-                }
-                case 12: {
-                    // Don't know what will invoke sending UE CAPABILITY ENQUIRY
-                    // Encode and send UE CAPABILITY ENQUIRY
-                    UECapabilityEnquiry ueCapabilityEnquiry = recv_pdu.getBody().getUECapabilityEnquiry();
-                    XrancPdu xrancPdu = UECapabilityEnq.constructPacket(ueCapabilityEnquiry.getEcgi(), ueCapabilityEnquiry.getCrnti());
-                    ctx.writeAndFlush(getSctpMessage(xrancPdu));
                     break;
                 }
                 case 13: {
-                    // Decode UE Capability Info
-                    UECapabilityInfo capabilityInfo = recv_pdu.getBody().getUECapabilityInfo();
-
-                    RnibUe ue = ueMap.get(capabilityInfo.getCrnti());
-                    if (ue != null) {
-                        ue.setCapability(capabilityInfo);
-                    } else {
-                        log.warn("Could not find UE with this CRNTI: {}", capabilityInfo.getCrnti());
-                    }
-                    break;
-
-                    //14, 15, 16 are handoff
-                }
-                case 15: {
                     HOFailure hoFailure = recv_pdu.getBody().getHOFailure();
 
                     try {
@@ -648,8 +629,9 @@
                         hoQueue.remove(hoFailure.getCrnti());
                     }
                     break;
+
                 }
-                case 16: {
+                case 14: {
                     HOComplete hoComplete = recv_pdu.getBody().getHOComplete();
 
                     RnibLink oldLink = linkMap.get(hoComplete.getEcgiS(), hoComplete.getCrntiNew()),
@@ -669,7 +651,8 @@
                     }
                     break;
                 }
-                case 18: {
+
+                case 16: {
                     // Decode RX Sig Meas Report.
                     RXSigMeasReport rxSigMeasReport = recv_pdu.getBody().getRXSigMeasReport();
                     List<RXSigReport> rxSigReportList = rxSigMeasReport.getCellMeasReports().getRXSigReport();
@@ -704,7 +687,7 @@
                     }
                     break;
                 }
-                case 20: {
+                case 18: {
                     RadioMeasReportPerUE radioMeasReportPerUE = recv_pdu.getBody().getRadioMeasReportPerUE();
 
                     List<RadioRepPerServCell> servCells = radioMeasReportPerUE.getRadioReportServCells().getRadioRepPerServCell();
@@ -738,14 +721,14 @@
                     });
                     break;
                 }
-                case 21: {
+                case 19: {
                     RadioMeasReportPerCell radioMeasReportPerCell = recv_pdu.getBody().getRadioMeasReportPerCell();
                     break;
                 }
-                case 22: {
+                case 20: {
                     SchedMeasReportPerUE schedMeasReportPerUE = recv_pdu.getBody().getSchedMeasReportPerUE();
-
-                    List<SchedMeasRepPerServCell> servCells = schedMeasReportPerUE.getSchedReportServCells().getSchedMeasRepPerServCell();
+                    List<SchedMeasRepPerServCell> servCells = schedMeasReportPerUE.getSchedReportServCells()
+                            .getSchedMeasRepPerServCell();
 
                     servCells.forEach(servCell -> {
                         RnibCell cell = cellMap.get(servCell.getPciArfcn());
@@ -758,7 +741,8 @@
                                 link.getResourceUsage().setDl(servCell.getPrbUsage().getPrbUsageDl());
                                 link.getResourceUsage().setUl(servCell.getPrbUsage().getPrbUsageUl());
                             } else {
-                                log.warn("Could not find link between: {}-{}", cell.getEcgi(), schedMeasReportPerUE.getCrnti());
+                                log.warn("Could not find link between: {}-{}", cell.getEcgi(),
+                                        schedMeasReportPerUE.getCrnti());
                             }
                         } else {
                             log.warn("Could not find cell with PCI-ARFCN: {}", servCell.getPciArfcn());
@@ -766,9 +750,8 @@
                     });
                     break;
                 }
-                case 23: {
+                case 21: {
                     SchedMeasReportPerCell schedMeasReportPerCell = recv_pdu.getBody().getSchedMeasReportPerCell();
-
                     RnibCell cell = cellMap.get(schedMeasReportPerCell.getEcgi());
                     if (cell != null) {
                         cell.setPrimaryPrbUsage(schedMeasReportPerCell.getPrbUsagePcell());
@@ -779,7 +762,7 @@
                     }
                     break;
                 }
-                case 24: {
+                case 22: {
                     PDCPMeasReportPerUe pdcpMeasReportPerUe = recv_pdu.getBody().getPDCPMeasReportPerUe();
 
                     RnibLink link = linkMap.get(pdcpMeasReportPerUe.getEcgi(), pdcpMeasReportPerUe.getCrnti());
@@ -789,11 +772,35 @@
                         link.getPdcpPackDelay().setDl(pdcpMeasReportPerUe.getPktDelayDl());
                         link.getPdcpPackDelay().setUl(pdcpMeasReportPerUe.getPktDelayUl());
                     } else {
-                        log.warn("Could not find link between: {}-{}", pdcpMeasReportPerUe.getEcgi(), pdcpMeasReportPerUe.getCrnti());
+                        log.warn("Could not find link between: {}-{}", pdcpMeasReportPerUe.getEcgi(),
+                                pdcpMeasReportPerUe.getCrnti());
                     }
                     break;
                 }
-                case 27: {
+                case 24: {
+                    // Decode UE Capability Info
+                    UECapabilityInfo capabilityInfo = recv_pdu.getBody().getUECapabilityInfo();
+
+                    RnibUe ue = ueMap.get(capabilityInfo.getCrnti());
+                    if (ue != null) {
+                        ue.setCapability(capabilityInfo);
+                    } else {
+                        log.warn("Could not find UE with this CRNTI: {}", capabilityInfo.getCrnti());
+                    }
+                    break;
+                }
+                case 25: {
+                    // Don't know what will invoke sending UE CAPABILITY ENQUIRY
+                    // Encode and send UE CAPABILITY ENQUIRY
+                    UECapabilityEnquiry ueCapabilityEnquiry = recv_pdu.getBody().getUECapabilityEnquiry();
+                    XrancPdu xrancPdu = UECapabilityEnquiry.constructPacket(ueCapabilityEnquiry.getEcgi(), ueCapabilityEnquiry.getCrnti());
+                    ctx.writeAndFlush(getSctpMessage(xrancPdu));
+                    break;
+                }
+                // TODO: Case 26: ScellAdd 27: ScellAddStatus 28: ScellDelete
+
+                case 30: {
+                    // Decode RRMConfig Status
                     RRMConfigStatus rrmConfigStatus = recv_pdu.getBody().getRRMConfigStatus();
                     try {
                         RRMCellQueue.get(rrmConfigStatus.getEcgi())
@@ -806,6 +813,7 @@
                     }
                     break;
                 }
+                //TODO Case 31: SeNBAdd 32: SeNBAddStatus 33: SeNBDelete
                 case 34: {
                     TrafficSplitConfig trafficSplitConfig = recv_pdu.getBody().getTrafficSplitConfig();
 
diff --git a/src/main/java/org.onosproject.xran/entities/RnibCell.java b/src/main/java/org.onosproject.xran/entities/RnibCell.java
index d917f02..81aeafd 100644
--- a/src/main/java/org.onosproject.xran/entities/RnibCell.java
+++ b/src/main/java/org.onosproject.xran/entities/RnibCell.java
@@ -35,6 +35,8 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * Created by dimitris on 7/22/17.
@@ -49,10 +51,12 @@
     private RRMConfig rrmConfig;
     private L2MeasConfig measConfig;
 
+    private String version;
+
     public RnibCell() {
         prbUsage = new PrbUsageContainer();
         setDefaultRRMConf();
-
+        version = "3";
     }
 
     public static URI uri(ECGI ecgi) {
@@ -81,6 +85,14 @@
         return ecgi;
     }
 
+    public String getVersion() {
+        return version;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
     public RRMConfig getRrmConfig() {
         return rrmConfig;
     }
@@ -100,10 +112,6 @@
     private void setDefaultRRMConf() {
         rrmConfig = new RRMConfig();
 
-        RRMConfig.Crnti crnti2 = new RRMConfig.Crnti();
-
-        rrmConfig.setCrnti(crnti2);
-
         rrmConfig.setEcgi(ecgi);
 
         RRMConfig.StartPrbDl startPrbDl = new RRMConfig.StartPrbDl();
@@ -164,27 +172,71 @@
         RRMConfig.Crnti crnti = new RRMConfig.Crnti();
         ueList.forEach(ue -> crnti.addCRNTI(ue.getRanId()));
 
-        RRMConfig.StartPrbDl startPrbDl = new RRMConfig.StartPrbDl();
-        RRMConfig.EndPrbDl endPrbDl = new RRMConfig.EndPrbDl();
-        int i = 0;
-        if (rrmConfigNode.get("start_prb_dl").isArray()) {
-            for (final JsonNode config : rrmConfigNode) {
-                startPrbDl.getSeqOf().set(i, new BerInteger(config.asInt()));
-                i++;
+        {
+            JsonNode start_prb_dl = rrmConfigNode.get("start_prb_dl");
+            if (start_prb_dl != null) {
+                RRMConfig.StartPrbDl startPrbDl = new RRMConfig.StartPrbDl();
+                if (start_prb_dl.isArray()) {
+                    if (rrmConfig.getStartPrbDl().getSeqOf().size() == start_prb_dl.size()) {
+                        List<BerInteger> collect = Stream.of(start_prb_dl)
+                                .map(val -> new BerInteger(val.asInt()))
+                                .collect(Collectors.toList());
+                        startPrbDl.setSeqOf(collect);
+                    }
+                }
+                rrmConfig.setStartPrbDl(startPrbDl);
             }
         }
-        i = 0;
-        if (rrmConfigNode.get("end_prb_dl").isArray()) {
-            for (final JsonNode config : rrmConfigNode) {
-                endPrbDl.getSeqOf().set(i, new BerInteger(config.asInt()));
-                i++;
-            }
-        }
-        rrmConfig.setEndPrbDl(endPrbDl);
-        rrmConfig.setStartPrbDl(startPrbDl);
-        rrmConfig.setCrnti(crnti);
-        rrmConfig.setEcgi(ecgi);
 
+        {
+            JsonNode end_prb_dl = rrmConfigNode.get("end_prb_dl");
+            if (end_prb_dl != null) {
+                RRMConfig.EndPrbDl endPrbDl = new RRMConfig.EndPrbDl();
+                if (end_prb_dl.isArray()) {
+                    if (rrmConfig.getEndPrbDl().getSeqOf().size() == end_prb_dl.size()) {
+                        List<BerInteger> collect = Stream.of(end_prb_dl)
+                                .map(val -> new BerInteger(val.asInt()))
+                                .collect(Collectors.toList());
+                        endPrbDl.setSeqOf(collect);
+                    }
+                }
+                rrmConfig.setEndPrbDl(endPrbDl);
+            }
+        }
+
+        {
+            JsonNode start_prb_ul = rrmConfigNode.get("start_prb_ul");
+            if (start_prb_ul != null) {
+                RRMConfig.StartPrbUl startPrbUl = new RRMConfig.StartPrbUl();
+                if (start_prb_ul.isArray()) {
+                    if (rrmConfig.getStartPrbUl().getSeqOf().size() == start_prb_ul.size()) {
+                        List<BerInteger> collect = Stream.of(start_prb_ul)
+                                .map(val -> new BerInteger(val.asInt()))
+                                .collect(Collectors.toList());
+                        startPrbUl.setSeqOf(collect);
+                    }
+                }
+                rrmConfig.setStartPrbUl(startPrbUl);
+            }
+        }
+
+        {
+            JsonNode end_prb_ul = rrmConfigNode.get("end_prb_ul");
+            if (end_prb_ul != null) {
+                RRMConfig.EndPrbUl endPrbUl = new RRMConfig.EndPrbUl();
+                if (end_prb_ul.isArray()) {
+                    if (rrmConfig.getEndPrbUl().getSeqOf().size() == end_prb_ul.size()) {
+                        List<BerInteger> collect = Stream.of(end_prb_ul)
+                                .map(val -> new BerInteger(val.asInt()))
+                                .collect(Collectors.toList());
+                        endPrbUl.setSeqOf(collect);
+                    }
+                }
+                rrmConfig.setEndPrbUl(endPrbUl);
+            }
+        }
+
+        rrmConfig.setCrnti(crnti);
 
         // TODO
     }
diff --git a/src/main/java/org.onosproject.xran/entities/RnibLink.java b/src/main/java/org.onosproject.xran/entities/RnibLink.java
index d9f39cc..8af1644 100644
--- a/src/main/java/org.onosproject.xran/entities/RnibLink.java
+++ b/src/main/java/org.onosproject.xran/entities/RnibLink.java
@@ -16,15 +16,20 @@
 
 package org.onosproject.xran.entities;
 
+import com.fasterxml.jackson.databind.JsonNode;
 import org.onosproject.xran.codecs.api.*;
 import org.onosproject.xran.codecs.pdu.PDCPMeasReportPerUe;
 import org.onosproject.xran.codecs.pdu.RRMConfig;
 import org.onosproject.xran.identifiers.LinkId;
+import org.openmuc.jasn1.ber.types.BerBitString;
 import org.openmuc.jasn1.ber.types.BerInteger;
 
 import java.util.Arrays;
+import java.util.List;
 import java.util.Optional;
 import java.util.Timer;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * Created by dimitris on 7/22/17.
@@ -59,6 +64,8 @@
         type = Type.NON_SERVING;
 
         linkId = LinkId.valueOf(cell, ue);
+
+        setDefaultRRMConf();
     }
 
     public Timer getTimer() {
@@ -124,6 +131,74 @@
         this.rrmParameters = rrmParameters;
     }
 
+    public void modifyRrmParameters(JsonNode rrmConfigNode) {
+        {
+            JsonNode start_prb_dl = rrmConfigNode.get("start_prb_dl");
+            if (start_prb_dl != null) {
+                RRMConfig.StartPrbDl startPrbDl = new RRMConfig.StartPrbDl();
+                if (start_prb_dl.isArray()) {
+                    if (rrmParameters.getStartPrbDl().getSeqOf().size() == start_prb_dl.size()) {
+                        List<BerInteger> collect = Stream.of(start_prb_dl)
+                                .map(val -> new BerInteger(val.asInt()))
+                                .collect(Collectors.toList());
+                        startPrbDl.setSeqOf(collect);
+                    }
+                }
+                rrmParameters.setStartPrbDl(startPrbDl);
+            }
+        }
+
+        {
+            JsonNode end_prb_dl = rrmConfigNode.get("end_prb_dl");
+            if (end_prb_dl != null) {
+                RRMConfig.EndPrbDl endPrbDl = new RRMConfig.EndPrbDl();
+                if (end_prb_dl.isArray()) {
+                    if (rrmParameters.getEndPrbDl().getSeqOf().size() == end_prb_dl.size()) {
+                        List<BerInteger> collect = Stream.of(end_prb_dl)
+                                .map(val -> new BerInteger(val.asInt()))
+                                .collect(Collectors.toList());
+                        endPrbDl.setSeqOf(collect);
+                    }
+                }
+                rrmParameters.setEndPrbDl(endPrbDl);
+            }
+        }
+
+        {
+            JsonNode start_prb_ul = rrmConfigNode.get("start_prb_ul");
+            if (start_prb_ul != null) {
+                RRMConfig.StartPrbUl startPrbUl = new RRMConfig.StartPrbUl();
+                if (start_prb_ul.isArray()) {
+                    if (rrmParameters.getStartPrbUl().getSeqOf().size() == start_prb_ul.size()) {
+                        List<BerInteger> collect = Stream.of(start_prb_ul)
+                                .map(val -> new BerInteger(val.asInt()))
+                                .collect(Collectors.toList());
+                        startPrbUl.setSeqOf(collect);
+                    }
+                }
+                rrmParameters.setStartPrbUl(startPrbUl);
+            }
+        }
+
+        {
+            JsonNode end_prb_ul = rrmConfigNode.get("end_prb_ul");
+            if (end_prb_ul != null) {
+                RRMConfig.EndPrbUl endPrbUl = new RRMConfig.EndPrbUl();
+                if (end_prb_ul.isArray()) {
+                    if (rrmParameters.getEndPrbUl().getSeqOf().size() == end_prb_ul.size()) {
+                        List<BerInteger> collect = Stream.of(end_prb_ul)
+                                .map(val -> new BerInteger(val.asInt()))
+                                .collect(Collectors.toList());
+                        endPrbUl.setSeqOf(collect);
+                    }
+                }
+                rrmParameters.setEndPrbUl(endPrbUl);
+            }
+        }
+
+        // TODO
+    }
+
     public PDCPThroughput getPdcpThroughput() {
         return pdcpThroughput;
     }
@@ -148,6 +223,50 @@
         this.resourceUsage = resourceUsage;
     }
 
+    private void setDefaultRRMConf() {
+        rrmParameters = new RRMConfig();
+
+        RRMConfig.Crnti crnti = new RRMConfig.Crnti();
+        crnti.addCRNTI(linkId.getUe().getRanId());
+
+        rrmParameters.setCrnti(crnti);
+
+        rrmParameters.setEcgi(linkId.getEcgi());
+
+        RRMConfig.StartPrbDl startPrbDl = new RRMConfig.StartPrbDl();
+        startPrbDl.addBerInteger(new BerInteger(0));
+        startPrbDl.addBerInteger(new BerInteger(50));
+
+        rrmParameters.setStartPrbDl(startPrbDl);
+
+        RRMConfig.StartPrbUl startPrbUl = new RRMConfig.StartPrbUl();
+        startPrbUl.addBerInteger(new BerInteger(50));
+        startPrbUl.addBerInteger(new BerInteger(100));
+
+        rrmParameters.setStartPrbUl(startPrbUl);
+
+        RRMConfig.EndPrbDl endPrbDl = new RRMConfig.EndPrbDl();
+        endPrbDl.addBerInteger(new BerInteger(50));
+        endPrbDl.addBerInteger(new BerInteger(100));
+
+        rrmParameters.setEndPrbDl(endPrbDl);
+
+        RRMConfig.EndPrbUl endPrbUl = new RRMConfig.EndPrbUl();
+        endPrbUl.addBerInteger(new BerInteger(50));
+        endPrbUl.addBerInteger(new BerInteger(100));
+
+        rrmParameters.setEndPrbUl(endPrbUl);
+
+        RRMConfig.SubframeBitmaskDl subframeBitmaskDl = new RRMConfig.SubframeBitmaskDl();
+        BerBitString berBitString = new BerBitString(new byte[]{(byte) 0xAA, (byte) 0x80}, 10);
+        BerBitString berBitString1 = new BerBitString(new byte[]{(byte) 0x55, (byte) 0x40}, 10);
+
+        subframeBitmaskDl.addBerBitString(berBitString);
+        subframeBitmaskDl.addBerBitString(berBitString1);
+
+        rrmParameters.setSubframeBitmaskDl(subframeBitmaskDl);
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
diff --git a/src/main/java/org.onosproject.xran/identifiers/LinkId.java b/src/main/java/org.onosproject.xran/identifiers/LinkId.java
index 9c71224..b6fd611 100644
--- a/src/main/java/org.onosproject.xran/identifiers/LinkId.java
+++ b/src/main/java/org.onosproject.xran/identifiers/LinkId.java
@@ -43,19 +43,19 @@
         return new LinkId(cell, ue);
     }
 
-    public ECGI getSourceId() {
+    public ECGI getEcgi() {
         return cell.getEcgi();
     }
 
-    public void setSourceId(ECGI sourceId) {
+    public void setEcgi(ECGI sourceId) {
         cell.setEcgi(sourceId);
     }
 
-    public MMEUES1APID getDestinationId() {
+    public MMEUES1APID getMmeues1apid() {
         return ue.getMmeS1apId();
     }
 
-    public void setDestinationId(MMEUES1APID destinationId) {
+    public void setMmeues1apid(MMEUES1APID destinationId) {
         ue.setMmeS1apId(destinationId);
     }
 
diff --git a/src/main/java/org.onosproject.xran/impl/DefaultXranStore.java b/src/main/java/org.onosproject.xran/impl/DefaultXranStore.java
index f3a9fac..3cc0e01 100644
--- a/src/main/java/org.onosproject.xran/impl/DefaultXranStore.java
+++ b/src/main/java/org.onosproject.xran/impl/DefaultXranStore.java
@@ -86,7 +86,7 @@
         list.addAll(
                 linkMap.keySet()
                         .stream()
-                        .filter(k -> k.getSourceId().equals(ecgi))
+                        .filter(k -> k.getEcgi().equals(ecgi))
                         .map(v -> linkMap.get(v))
                         .collect(Collectors.toList()));
 
@@ -101,7 +101,7 @@
         list.addAll(
                 linkMap.keySet()
                         .stream()
-                        .filter(k -> k.getSourceId().getEUTRANcellIdentifier().equals(eci))
+                        .filter(k -> k.getEcgi().getEUTRANcellIdentifier().equals(eci))
                         .map(v -> linkMap.get(v))
                         .collect(Collectors.toList()));
 
@@ -116,7 +116,7 @@
         list.addAll(
                 linkMap.keySet()
                         .stream()
-                        .filter(k -> k.getDestinationId().equals(mme))
+                        .filter(k -> k.getMmeues1apid().equals(mme))
                         .map(v -> linkMap.get(v))
                         .collect(Collectors.toList()));
 
@@ -130,8 +130,8 @@
 
         Optional<LinkId> first = linkMap.keySet()
                 .stream()
-                .filter(linkId -> linkId.getSourceId().getEUTRANcellIdentifier().equals(eci))
-                .filter(linkId -> linkId.getDestinationId().equals(mme))
+                .filter(linkId -> linkId.getEcgi().getEUTRANcellIdentifier().equals(eci))
+                .filter(linkId -> linkId.getMmeues1apid().equals(mme))
                 .findFirst();
 
         return first.map(linkId -> linkMap.get(linkId)).orElse(null);
@@ -145,8 +145,17 @@
         if (cell != null && ue != null) {
             RnibLink link = new RnibLink(cell, ue);
 
+            // TODO: check logic for each type
             try {
-                link.setType(RnibLink.Type.valueOf(type));
+                RnibLink.Type linkType = RnibLink.Type.valueOf(type);
+                switch (linkType) {
+                    case NON_SERVING:
+                        break;
+                    case SERVING_PRIMARY:
+                        break;
+                    case SERVING_SECONDARY:
+                        break;
+                }
             } catch (Exception e) {
                 log.error(ExceptionUtils.getFullStackTrace(e));
             }
@@ -177,6 +186,11 @@
     }
 
     @Override
+    public void modifyLinkRrmConf(RnibLink link, JsonNode rrmConf) {
+        link.modifyRrmParameters(rrmConf);
+    }
+
+    @Override
     public List<Object> getNodes() {
         List<Object> list = Lists.newArrayList();
         list.add(cellMap.values());
@@ -233,13 +247,11 @@
     }
 
     @Override
-    public boolean modifyCellRrmConf(RnibCell cell, JsonNode rrmConf) {
-
+    public void modifyCellRrmConf(RnibCell cell, JsonNode rrmConf) {
         List<RnibLink> linkList = getLinksByECGI(cell.getEcgi());
         List<RnibUe> ueList = linkList.stream().map(link -> link.getLinkId().getUe()).collect(Collectors.toList());
 
         cell.modifyRrmConfig(rrmConf, ueList);
-        return false;
     }
 
     @Override
diff --git a/src/main/java/org.onosproject.xran/impl/XranConfig.java b/src/main/java/org.onosproject.xran/impl/XranConfig.java
index be27c89..5f59d4d 100644
--- a/src/main/java/org.onosproject.xran/impl/XranConfig.java
+++ b/src/main/java/org.onosproject.xran/impl/XranConfig.java
@@ -56,6 +56,10 @@
 
     private static final String L2_MEAS_REPORT_INTERVAL = "l2_meas_report_interval_ms";
 
+    private static final String ADMISSION_SUCCESS = "admission_success";
+
+    private static final String BEARER_SUCCESS = "bearer_success";
+
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     public Map<String, ECGI> activeCellSet() {
@@ -80,6 +84,16 @@
         return cells;
     }
 
+    public boolean admissionFlag() {
+        JsonNode flag = object.get(ADMISSION_SUCCESS);
+        return flag != null && flag.asBoolean();
+    }
+
+    public boolean bearerFlag() {
+        JsonNode flag = object.get(BEARER_SUCCESS);
+        return flag != null && flag.asBoolean();
+    }
+
     public int getXrancPort() {
         return object.get(XRANC_PORT).asInt();
     }
diff --git a/src/main/java/org.onosproject.xran/rest/CellWebResource.java b/src/main/java/org.onosproject.xran/rest/CellWebResource.java
index 336f67a..c62cd0e 100644
--- a/src/main/java/org.onosproject.xran/rest/CellWebResource.java
+++ b/src/main/java/org.onosproject.xran/rest/CellWebResource.java
@@ -21,8 +21,6 @@
 import org.onosproject.rest.AbstractWebResource;
 import org.onosproject.xran.XranStore;
 import org.onosproject.xran.annotations.Patch;
-import org.onosproject.xran.codecs.api.ECGI;
-import org.onosproject.xran.codecs.api.EUTRANCellIdentifier;
 import org.onosproject.xran.controller.XranController;
 import org.onosproject.xran.entities.RnibCell;
 import org.slf4j.Logger;
@@ -37,8 +35,8 @@
 import javax.ws.rs.core.Response;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Optional;
 import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.TimeUnit;
 
 /**
  * Cell web resource.
@@ -59,25 +57,24 @@
     @Path("{cellid}")
     @Produces(MediaType.APPLICATION_JSON)
     public Response getCell(@PathParam("cellid") String eciHex) {
-        log.debug("GET CELLID {}", eciHex);
-
         RnibCell cell = get(XranStore.class).getCell(eciHex);
 
-        ObjectNode rootNode = mapper().createObjectNode();
-
         if (cell != null) {
             try {
+                ObjectNode rootNode = mapper().createObjectNode();
+
                 JsonNode jsonNode = mapper().readTree(cell.toString());
                 rootNode.put("cell", jsonNode);
             } catch (IOException e) {
                 log.error(ExceptionUtils.getFullStackTrace(e));
                 e.printStackTrace();
+                return Response.serverError()
+                        .entity(ExceptionUtils.getFullStackTrace(e))
+                        .build();
             }
-        } else {
-            rootNode.put("error", "not found");
         }
 
-        return ok(rootNode.toString()).build();
+        return Response.serverError().entity("cell not found").build();
     }
 
     /**
@@ -91,31 +88,41 @@
     @Path("{cellid}")
     @Consumes(MediaType.APPLICATION_JSON)
     public Response patchCell(@PathParam("cellid") String eciHex, InputStream stream) {
-        log.debug("PATCH CELLID {}", eciHex);
-
-        boolean b;
-
         RnibCell cell = get(XranStore.class).getCell(eciHex);
-        // Check if a cell with that ECI exists. If it does, then modify its contents.
 
-        try {
-            ObjectNode jsonTree = (ObjectNode) mapper().readTree(stream);
+        if (cell != null) {
+            try {
+                ObjectNode jsonTree = (ObjectNode) mapper().readTree(stream);
 
-            JsonNode rrmConf = jsonTree.get("RRMConf");
-            if (rrmConf != null) {
-                final SynchronousQueue<String>[] queue = new SynchronousQueue[1];
-                b = get(XranStore.class).modifyCellRrmConf(cell, rrmConf);
-                if (b) {
-                    queue[0] = get(XranController.class).sendModifiedRRMConf(cell);
-                    return Response.ok().entity(queue[0].take()).build();
+                JsonNode rrmConf = jsonTree.get("RRMConf");
+                if (rrmConf != null) {
+                    final SynchronousQueue<String>[] queue = new SynchronousQueue[1];
+                    get(XranStore.class).modifyCellRrmConf(cell, rrmConf);
+
+                    queue[0] = get(XranController.class).sendModifiedRRMConf(cell.getRrmConfig(),
+                            cell.getVersion().equals("3"));
+                    String poll = queue[0].poll(5, TimeUnit.SECONDS);
+
+                    if (poll != null) {
+                        return Response.ok()
+                                .entity(poll)
+                                .build();
+                    } else {
+                        return Response.serverError()
+                                .entity("did not receive response in time")
+                                .build();
+                    }
                 }
+            } catch (Exception e) {
+                log.error(ExceptionUtils.getFullStackTrace(e));
+                e.printStackTrace();
+                return Response.serverError()
+                        .entity(ExceptionUtils.getFullStackTrace(e))
+                        .build();
             }
-        } catch (Exception e) {
-            log.error(ExceptionUtils.getFullStackTrace(e));
-            e.printStackTrace();
-            return Response.serverError().entity(ExceptionUtils.getFullStackTrace(e)).build();
         }
-        return Response.noContent().build();
+
+        return Response.serverError().entity("cell not found").build();
     }
 
 }
diff --git a/src/main/java/org.onosproject.xran/rest/LinkWebResource.java b/src/main/java/org.onosproject.xran/rest/LinkWebResource.java
index 370755f..3640a1d 100644
--- a/src/main/java/org.onosproject.xran/rest/LinkWebResource.java
+++ b/src/main/java/org.onosproject.xran/rest/LinkWebResource.java
@@ -43,6 +43,7 @@
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.TimeUnit;
 
 /**
  * Link web resource.
@@ -63,9 +64,7 @@
     @GET
     @Produces(MediaType.APPLICATION_JSON)
     public Response getLinksBetween(@DefaultValue("") @QueryParam("cell") String eciHex,
-                             @DefaultValue("-1") @QueryParam("ue") long ue) {
-        log.debug("GET LINKS CELL {} AND UE {}", eciHex, ue);
-
+                                    @DefaultValue("-1") @QueryParam("ue") long ue) {
         List<RnibLink> list = Lists.newArrayList();
         if (!eciHex.isEmpty() && ue != -1) {
             RnibLink link = get(XranStore.class).getLinkBetweenCellIdUeId(eciHex, ue);
@@ -80,17 +79,18 @@
             list.addAll(get(XranStore.class).getLinks());
         }
 
-        ObjectNode rootNode = mapper().createObjectNode();
-
         try {
+            ObjectNode rootNode = mapper().createObjectNode();
             JsonNode jsonNode = mapper().readTree(list.toString());
             rootNode.put("links", jsonNode);
+            return Response.ok(rootNode.toString()).build();
         } catch (IOException e) {
             log.error(ExceptionUtils.getFullStackTrace(e));
             e.printStackTrace();
+            return Response.serverError()
+                    .entity(ExceptionUtils.getFullStackTrace(e))
+                    .build();
         }
-
-        return ok(rootNode.toString()).build();
     }
 
     /**
@@ -105,12 +105,9 @@
     @Path("{src},{dst}")
     @Consumes(MediaType.APPLICATION_JSON)
     public Response patchLinks(@PathParam("src") String src, @PathParam("dst") long dst, InputStream stream) {
-        log.debug("Patch LINKS FROM {} to {}", src, dst);
-
-        try {
-            RnibLink link = get(XranStore.class).getLinkBetweenCellIdUeId(src, dst);
-            if (link != null) {
-
+        RnibLink link = get(XranStore.class).getLinkBetweenCellIdUeId(src, dst);
+        if (link != null) {
+            try {
                 ObjectNode jsonTree = (ObjectNode) mapper().readTree(stream);
 
                 JsonNode type = jsonTree.get("type");
@@ -124,7 +121,17 @@
                                 .findFirst();
                         if (primary.isPresent()) {
                             queue[0] = get(XranController.class).sendHORequest(link, primary.get());
-                            return Response.ok().entity(queue[0].take()).build();
+                            String poll = queue[0].poll(5, TimeUnit.SECONDS);
+
+                            if (poll != null) {
+                                return Response.ok()
+                                        .entity(poll)
+                                        .build();
+                            } else {
+                                return Response.serverError()
+                                        .entity("did not receive response in time")
+                                        .build();
+                            }
                         }
                     }
                 }
@@ -139,16 +146,35 @@
                     if (jsonNode != null) {
                         link.getTrafficPercent().setTrafficPercentUl(new BerInteger(jsonNode.asInt()));
                     }
-                    return Response.ok().build();
+                    return Response.ok("trafficpercent changed successfully").build();
                 }
-            }
-        } catch (Exception e) {
-            log.error(ExceptionUtils.getFullStackTrace(e));
-            e.printStackTrace();
-            return Response.serverError().entity(ExceptionUtils.getFullStackTrace(e)).build();
-        }
 
-        return Response.noContent().build();
+                JsonNode rrmConf = jsonTree.get("RRMConf");
+                if (rrmConf != null) {
+                    final SynchronousQueue<String>[] queue = new SynchronousQueue[1];
+                    get(XranStore.class).modifyLinkRrmConf(link, rrmConf);
+                    queue[0] = get(XranController.class).sendModifiedRRMConf(link.getRrmParameters(),
+                            link.getLinkId().getCell().getVersion().equals("3"));
+                    String poll = queue[0].poll(5, TimeUnit.SECONDS);
+
+                    if (poll != null) {
+                        return Response.ok()
+                                .entity(poll)
+                                .build();
+                    } else {
+                        return Response.serverError()
+                                .entity("did not receive response in time")
+                                .build();
+                    }
+                }
+
+            } catch (Exception e) {
+                log.error(ExceptionUtils.getFullStackTrace(e));
+                e.printStackTrace();
+                return Response.serverError().entity(ExceptionUtils.getFullStackTrace(e)).build();
+            }
+        }
+        return Response.serverError().entity("link not found").build();
     }
 
     /**
@@ -163,23 +189,25 @@
     @Path("{src},{dst}")
     @Consumes(MediaType.APPLICATION_JSON)
     public Response postLinks(@PathParam("src") String src, @PathParam("dst") long dst, InputStream stream) {
-        log.debug("POST LINKS FROM {} to {}", src, dst);
-
-        boolean b = false;
         try {
             ObjectNode jsonTree = (ObjectNode) mapper().readTree(stream);
 
             JsonNode type = jsonTree.get("type");
 
             if (type != null) {
+                boolean b;
                 b = get(XranStore.class).createLinkBetweenCellIdUeId(src, dst, type.asText());
+                return ok(b).build();
             }
         } catch (Exception e) {
             log.error(ExceptionUtils.getFullStackTrace(e));
             e.printStackTrace();
+            return Response.serverError()
+                    .entity(ExceptionUtils.getFullStackTrace(e))
+                    .build();
         }
 
-        return ok(b).build();
+        return Response.serverError().entity("unreachable code").build();
     }
 
 }
diff --git a/src/main/java/org.onosproject.xran/rest/NodeWebResource.java b/src/main/java/org.onosproject.xran/rest/NodeWebResource.java
index 1a70ccc..7b54177 100644
--- a/src/main/java/org.onosproject.xran/rest/NodeWebResource.java
+++ b/src/main/java/org.onosproject.xran/rest/NodeWebResource.java
@@ -55,8 +55,6 @@
     @GET
     @Produces(MediaType.APPLICATION_JSON)
     public Response getNodes(@DefaultValue("") @QueryParam("type") String type) {
-        log.debug("GET NODES " + type);
-
         ObjectNode rootNode = mapper().createObjectNode();
 
         try {
@@ -85,6 +83,9 @@
         } catch (IOException e) {
             log.error(ExceptionUtils.getFullStackTrace(e));
             e.printStackTrace();
+            return Response.serverError()
+                    .entity(ExceptionUtils.getFullStackTrace(e))
+                    .build();
         }
 
         return ok(rootNode.toString()).build();
@@ -100,25 +101,24 @@
     @Path("{nodeid}")
     @Produces(MediaType.APPLICATION_JSON)
     public Response getNodeid(@PathParam("nodeid") String nodeid) {
-        log.debug("GET NODEID {}", nodeid);
-
         Object node = get(XranStore.class).getByNodeId(nodeid);
 
-        ObjectNode rootNode = mapper().createObjectNode();
-
         if (node != null) {
             try {
+                ObjectNode rootNode = mapper().createObjectNode();
                 JsonNode jsonNode = mapper().readTree(node.toString());
                 rootNode.put("node", jsonNode);
+                return ok(rootNode.toString()).build();
             } catch (IOException e) {
                 log.error(ExceptionUtils.getFullStackTrace(e));
                 e.printStackTrace();
+                return Response.serverError()
+                        .entity(ExceptionUtils.getFullStackTrace(e))
+                        .build();
             }
-        } else {
-            rootNode.put("error", "not found");
         }
 
-        return ok(rootNode.toString()).build();
+        return Response.serverError().entity("node not found").build();
     }
 
 }
diff --git a/src/main/java/org.onosproject.xran/rest/SliceWebResource.java b/src/main/java/org.onosproject.xran/rest/SliceWebResource.java
index 2fe8385..e895d55 100644
--- a/src/main/java/org.onosproject.xran/rest/SliceWebResource.java
+++ b/src/main/java/org.onosproject.xran/rest/SliceWebResource.java
@@ -54,25 +54,24 @@
     @Path("{sliceid}")
     @Produces(MediaType.APPLICATION_JSON)
     public Response getSlice(@PathParam("sliceid") long sliceid) {
-        log.debug("GET SLICE {}", sliceid);
-
         RnibSlice slice = get(XranStore.class).getSlice(sliceid);
 
-        ObjectNode rootNode = mapper().createObjectNode();
-
         if (slice != null) {
             try {
+                ObjectNode rootNode = mapper().createObjectNode();
                 JsonNode jsonNode = mapper().readTree(slice.toString());
                 rootNode.put("slice", jsonNode);
+                return ok(rootNode.toString()).build();
             } catch (IOException e) {
                 log.error(ExceptionUtils.getFullStackTrace(e));
                 e.printStackTrace();
+                return Response.serverError()
+                        .entity(ExceptionUtils.getFullStackTrace(e))
+                        .build();
             }
-        } else {
-            rootNode.put("error", "not found");
         }
 
-        return ok(rootNode.toString()).build();
+        return Response.serverError().entity("slice not found").build();
     }
 
     /**
@@ -84,19 +83,19 @@
     @POST
     @Consumes(MediaType.APPLICATION_JSON)
     public Response postSlice(InputStream stream) {
-        log.debug("POST SLICE");
-
-        boolean b = false;
         try {
+            boolean b;
             ObjectNode jsonTree = (ObjectNode) mapper().readTree(stream);
 
             b = get(XranStore.class).createSlice(jsonTree);
+            return ok(b).build();
         } catch (Exception e) {
             log.error(ExceptionUtils.getFullStackTrace(e));
             e.printStackTrace();
+            return Response.serverError()
+                    .entity(ExceptionUtils.getFullStackTrace(e))
+                    .build();
         }
-
-        return ok(b).build();
     }
 
 }
diff --git a/src/main/java/org.onosproject.xran/samplemessages/BearerEncoderDecoder.java b/src/main/java/org.onosproject.xran/samplemessages/BearerEncoderDecoder.java
deleted file mode 100644
index 0252451..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/BearerEncoderDecoder.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.*;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class BearerEncoderDecoder {
-
-    public static XrancPdu constructPacket(ECGI ecgi, CRNTI crnti, ERABParams erabParams, BerInteger numParams) {
-        ERABResponse erabResponse = new ERABResponse();
-
-        for (int i = 0; i < numParams.intValue(); i++) {
-            ERABParamsItem erabParamsItem = erabParams.getERABParamsItem().get(i);
-
-            ERABResponseItem responseItem = new ERABResponseItem();
-            responseItem.setId(erabParamsItem.getId());
-
-            // FIXME: add logic
-            responseItem.setDecision(new ERABDecision(0));
-
-            erabResponse.setERABResponse(responseItem);
-        }
-
-
-        BearerAdmissionResponse bearerAdmissionResponse = new BearerAdmissionResponse();
-        bearerAdmissionResponse.setCrnti(crnti);
-        bearerAdmissionResponse.setEcgi(ecgi);
-        bearerAdmissionResponse.setErabResponse(erabResponse);
-        bearerAdmissionResponse.setNumErabList(numParams);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setBearerAdmissionResponse(bearerAdmissionResponse);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("2.0");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        XrancApiID apiID = new XrancApiID(9);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-    }
-
-    public XrancPdu setPacketProperties(XrancPdu mainDecoder) {
-        CRNTI crnti = mainDecoder.getBody().getBearerAdmissionRequest().getCrnti();
-        ECGI ecgi = mainDecoder.getBody().getBearerAdmissionRequest().getEcgi();
-
-        //TODO: Verify mainDecoder.getBody().getBearerAdmissionRequest().getNumErabs() or
-        BerInteger numErabs = new BerInteger(5);
-
-        ERABResponseItem responseItem = new ERABResponseItem();
-        responseItem.setId(new ERABID(1));
-        responseItem.setDecision(new ERABDecision(0));
-
-        ERABResponseItem responseItem1 = new ERABResponseItem();
-        responseItem1.setId(new ERABID(2));
-        responseItem1.setDecision(new ERABDecision(0));
-
-        ERABResponse erabResponse = new ERABResponse();
-        erabResponse.setERABResponse(responseItem);
-        erabResponse.setERABResponse(responseItem1);
-
-        BearerAdmissionResponse bearerAdmissionResponse = new BearerAdmissionResponse();
-        bearerAdmissionResponse.setCrnti(crnti);
-        bearerAdmissionResponse.setEcgi(ecgi);
-        bearerAdmissionResponse.setErabResponse(erabResponse);
-        bearerAdmissionResponse.setNumErabList(numErabs);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setBearerAdmissionResponse(bearerAdmissionResponse);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("2.0");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        XrancApiID apiID = new XrancApiID(9);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-    }
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/ConfigEncoderDecoder.java b/src/main/java/org.onosproject.xran/samplemessages/ConfigEncoderDecoder.java
deleted file mode 100644
index ad74aab..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/ConfigEncoderDecoder.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * 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.
- */
-
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.ECGI;
-import org.onosproject.xran.codecs.api.EUTRANCellIdentifier;
-import org.onosproject.xran.codecs.api.PLMNIdentity;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.UnsupportedEncodingException;
-
-/**
- * Created by dimitris on 7/25/17.
- */
-public class ConfigEncoderDecoder {
-    private static final Logger log =
-            LoggerFactory.getLogger(ConfigEncoderDecoder.class);
-
-    /*public String decode(String s) throws IOException {
-        byte[] bytearray = DatatypeConverter.parseHexBinary(s);
-        InputStream inputStream = new ByteArrayInputStream(bytearray);
-        XrancPdu pdu_decoded = new XrancPdu();
-        pdu_decoded.decode(inputStream);
-        return pdu_decoded.toString();
-    }*/
-/*
-    public String encodeConfigRequest()
-            throws IOException {
-        pdu = setPacketProperties();
-        pdu.encode(os);
-        return DatatypeConverter.printHexBinary(os.getArray());
-    }*/
-
-    public static XrancPdu constructPacket(ECGI ecgi) throws UnsupportedEncodingException {
-        CellConfigRequest cellConfigRequest = new CellConfigRequest();
-        cellConfigRequest.setEcgi(ecgi);
-
-        BerUTF8String ver = new BerUTF8String("2a");
-
-        XrancApiID apiID = new XrancApiID(0);
-        XrancPduBody body = new XrancPduBody();
-        body.setCellConfigRequest(cellConfigRequest);
-
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setBody(body);
-        pdu.setHdr(hdr);
-
-        return pdu;
-    }
-
-    public XrancPdu setPacketProperties() throws UnsupportedEncodingException {
-        PLMNIdentity plmnIdentity = new PLMNIdentity(new byte[]{(byte) 0x22, (byte) 0x08, (byte) 0x41});
-        EUTRANCellIdentifier eutranCellIdentifier = new EUTRANCellIdentifier(new byte[]{
-                (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xF0
-        }, 28);
-
-        ECGI ecgi = new ECGI();
-
-        ecgi.setPLMNIdentity(plmnIdentity);
-        ecgi.setEUTRANcellIdentifier(eutranCellIdentifier);
-
-        CellConfigRequest cellConfigRequest = new CellConfigRequest();
-        cellConfigRequest.setEcgi(ecgi);
-
-        BerUTF8String ver = new BerUTF8String("2a");
-
-        XrancApiID apiID = new XrancApiID(0);
-        XrancPduBody body = new XrancPduBody();
-        body.setCellConfigRequest(cellConfigRequest);
-
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setBody(body);
-        pdu.setHdr(hdr);
-
-        return pdu;
-    }
-
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/ConfigReport.java b/src/main/java/org.onosproject.xran/samplemessages/ConfigReport.java
deleted file mode 100644
index 5ab504e..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/ConfigReport.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.*;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.types.BerBoolean;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class ConfigReport {
-
-    BerByteArrayOutputStream os;
-
-    public ConfigReport() {
-        os = new BerByteArrayOutputStream(4096);
-    }
-
-    /*public String encodeResponse(XrancPdu decoder) {
-        pdu = setPacketProperties(decoder);
-        try {
-            pdu.encode(os);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        return DatatypeConverter.printHexBinary(os.getArray());
-    }*/
-
-    public XrancPdu setPacketProperties(XrancPdu decoder) throws UnsupportedEncodingException {
-
-        ECGI ecgi = decoder.getBody().getCellConfigRequest().getEcgi();
-
-        PhysCellId physCellId = new PhysCellId(420);
-
-        PhysCellId physCellId1 = new PhysCellId(500);
-        ARFCNValue earfcn_dl = new ARFCNValue(2100);
-        CandScell candScell = new CandScell();
-        candScell.setPci(physCellId1);
-        candScell.setEarfcnDl(earfcn_dl);
-
-        PhysCellId physCellId2 = new PhysCellId(400);
-        ARFCNValue earfcn_dl1 = new ARFCNValue(2300);
-        CandScell candScell1 = new CandScell();
-        candScell1.setPci(physCellId2);
-        candScell1.setEarfcnDl(earfcn_dl1);
-
-        CellConfigReport.CandScells candScells = new CellConfigReport.CandScells();
-        candScells.setCandScells(candScell);
-        candScells.setCandScells(candScell1);
-
-        ARFCNValue earfcn_dl2 = new ARFCNValue(2000);
-
-        ARFCNValue earfcn_ul = new ARFCNValue(1900);
-
-        BerInteger rbs_per_tti_dl = new BerInteger(40);
-
-        BerInteger rbs_per_tti_ul = new BerInteger(30);
-
-        BerInteger num_tx_antenna = new BerInteger(2);
-
-        DuplexMode duplexMode = new DuplexMode(1);
-
-        BerInteger max_num_connected_ues = new BerInteger(1000);
-
-        BerInteger max_num_connected_bearers = new BerInteger(2000);
-
-        BerInteger max_num_ues_sched_per_tti_dl = new BerInteger(10);
-
-        BerInteger max_num_ues_sched_per_tti_ul = new BerInteger(10);
-
-        BerBoolean dlfs_sched_enable = new BerBoolean(true);
-
-        CellConfigReport cellConfigReport = new CellConfigReport();
-        cellConfigReport.setEcgi(ecgi);
-        cellConfigReport.setPci(physCellId);
-        cellConfigReport.setCandScells(candScells);
-        cellConfigReport.setEarfcnDl(earfcn_dl2);
-        cellConfigReport.setEarfcnUl(earfcn_ul);
-        cellConfigReport.setRbsPerTtiDl(rbs_per_tti_dl);
-        cellConfigReport.setRbsPerTtiUl(rbs_per_tti_ul);
-        cellConfigReport.setNumTxAntenna(num_tx_antenna);
-        cellConfigReport.setDuplexMode(duplexMode);
-        cellConfigReport.setMaxNumConnectedUes(max_num_connected_ues);
-        cellConfigReport.setMaxNumConnectedBearers(max_num_connected_bearers);
-        cellConfigReport.setMaxNumUesSchedPerTtiDl(max_num_ues_sched_per_tti_dl);
-        cellConfigReport.setMaxNumUesSchedPerTtiUl(max_num_ues_sched_per_tti_ul);
-        cellConfigReport.setDlfsSchedEnable(dlfs_sched_enable);
-
-        BerUTF8String ver = new BerUTF8String("2a");
-
-        XrancApiID apiID = new XrancApiID(1);
-        XrancPduBody body = new XrancPduBody();
-        body.setCellConfigReport(cellConfigReport);
-
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setBody(body);
-        pdu.setHdr(hdr);
-
-        return pdu;
-    }
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/HandoffRequest.java b/src/main/java/org.onosproject.xran/samplemessages/HandoffRequest.java
deleted file mode 100644
index b8902aa..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/HandoffRequest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * 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.
- */
-
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.CRNTI;
-import org.onosproject.xran.codecs.api.ECGI;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class HandoffRequest {
-
-    public static XrancPdu constructPacket(CRNTI crnti, ECGI ecgis, ECGI ecgit) throws UnsupportedEncodingException {
-        HORequest hoRequest = new HORequest();
-
-        hoRequest.setCrnti(crnti);
-        hoRequest.setEcgiS(ecgis);
-        hoRequest.setEcgiT(ecgit);
-
-        BerUTF8String ver = new BerUTF8String("2a");
-
-        XrancApiID apiID = new XrancApiID(14);
-        XrancPduBody body = new XrancPduBody();
-        body.setHORequest(hoRequest);
-
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setBody(body);
-        pdu.setHdr(hdr);
-
-        return pdu;
-    }
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/L2MeasConf.java b/src/main/java/org.onosproject.xran/samplemessages/L2MeasConf.java
deleted file mode 100644
index 5fa3087..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/L2MeasConf.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.ECGI;
-import org.onosproject.xran.codecs.api.EUTRANCellIdentifier;
-import org.onosproject.xran.codecs.api.PLMNIdentity;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class L2MeasConf {
-
-
-    public static XrancPdu constructPacket(ECGI ecgi, int l2MeasInterval) {
-
-        BerInteger reportIntervalMS = new BerInteger(l2MeasInterval);
-        L2MeasConfig measConfig = new L2MeasConfig();
-        measConfig.setEcgi(ecgi);
-        measConfig.setReportIntervalMs(reportIntervalMS);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("2a");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        XrancApiID apiID = new XrancApiID(19);
-        XrancPduBody body = new XrancPduBody();
-        body.setL2MeasConfig(measConfig);
-
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setBody(body);
-        pdu.setHdr(hdr);
-
-        return pdu;
-
-    }
-
-    public XrancPdu setPacketProperties() {
-        PLMNIdentity plmnIdentity = new PLMNIdentity(new byte[]{(byte) 0x22, (byte) 0x08, (byte) 0x41});
-        EUTRANCellIdentifier eutranCellIdentifier = new EUTRANCellIdentifier(new byte[]{
-                (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xF0
-        }, 28);
-
-        ECGI ecgi = new ECGI();
-        ecgi.setPLMNIdentity(plmnIdentity);
-        ecgi.setEUTRANcellIdentifier(eutranCellIdentifier);
-
-        BerInteger reportIntervalMS = new BerInteger(10);
-        L2MeasConfig measConfig = new L2MeasConfig();
-        measConfig.setEcgi(ecgi);
-        measConfig.setReportIntervalMs(reportIntervalMS);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("2a");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        XrancApiID apiID = new XrancApiID(19);
-        XrancPduBody body = new XrancPduBody();
-        body.setL2MeasConfig(measConfig);
-
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setBody(body);
-        pdu.setHdr(hdr);
-
-        return pdu;
-    }
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/PDCPReportPerUE.java b/src/main/java/org.onosproject.xran/samplemessages/PDCPReportPerUE.java
deleted file mode 100644
index 2400cde..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/PDCPReportPerUE.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.CRNTI;
-import org.onosproject.xran.codecs.api.ECGI;
-import org.onosproject.xran.codecs.api.QCI;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class PDCPReportPerUE {
-
-    public XrancPdu setPacketProperties(XrancPdu recv_pdu) {
-        ECGI ecgi = recv_pdu.getBody().getL2MeasConfig().getEcgi();
-
-        //Need to get this from UE.
-        CRNTI crnti = new CRNTI(new byte[]{(byte) 0x44, (byte) 0x44}, 16);
-
-        PDCPMeasReportPerUe.QciVals qciVals = new PDCPMeasReportPerUe.QciVals();
-        qciVals.setQCI(new QCI(1));
-        qciVals.setQCI(new QCI(2));
-
-        PDCPMeasReportPerUe.DataVolDl dataVolDl = new PDCPMeasReportPerUe.DataVolDl();
-        dataVolDl.setBerInteger(new BerInteger(500));
-        dataVolDl.setBerInteger(new BerInteger(500));
-
-        PDCPMeasReportPerUe.DataVolUl dataVolUl = new PDCPMeasReportPerUe.DataVolUl();
-        dataVolUl.setBerInteger(new BerInteger(500));
-        dataVolUl.setBerInteger(new BerInteger(500));
-
-        PDCPMeasReportPerUe.PktDelayDl pktDelayDl = new PDCPMeasReportPerUe.PktDelayDl();
-        pktDelayDl.setBerInteger(new BerInteger(314));
-        pktDelayDl.setBerInteger(new BerInteger(314));
-
-        PDCPMeasReportPerUe.PktDelayUl pktDelayUl = new PDCPMeasReportPerUe.PktDelayUl();
-        pktDelayUl.setBerInteger(new BerInteger(314));
-        pktDelayUl.setBerInteger(new BerInteger(314));
-
-        PDCPMeasReportPerUe.PktDiscardRateDl pktDiscardRateDl = new PDCPMeasReportPerUe.PktDiscardRateDl();
-        pktDiscardRateDl.setBerInteger(new BerInteger(10));
-        pktDiscardRateDl.setBerInteger(new BerInteger(5));
-
-        PDCPMeasReportPerUe.PktLossRateDl pktLossRateDl = new PDCPMeasReportPerUe.PktLossRateDl();
-        pktLossRateDl.setBerInteger(new BerInteger(5));
-        pktLossRateDl.setBerInteger(new BerInteger(10));
-
-        PDCPMeasReportPerUe.PktLossRateUl pktLossRateUl = new PDCPMeasReportPerUe.PktLossRateUl();
-        pktLossRateUl.setBerInteger(new BerInteger(8));
-        pktLossRateUl.setBerInteger(new BerInteger(2));
-
-        PDCPMeasReportPerUe.ThroughputDl throughputDl = new PDCPMeasReportPerUe.ThroughputDl();
-        throughputDl.setBerInteger(new BerInteger(500));
-        throughputDl.setBerInteger(new BerInteger(500));
-
-        PDCPMeasReportPerUe.ThroughputUl throughputUl = new PDCPMeasReportPerUe.ThroughputUl();
-        throughputUl.setBerInteger(new BerInteger(500));
-        throughputUl.setBerInteger(new BerInteger(500));
-
-        PDCPMeasReportPerUe pdcpMeasReportPerUe = new PDCPMeasReportPerUe();
-        pdcpMeasReportPerUe.setCrnti(crnti);
-        pdcpMeasReportPerUe.setEcgi(ecgi);
-        pdcpMeasReportPerUe.setQciVals(qciVals);
-        pdcpMeasReportPerUe.setDataVolDl(dataVolDl);
-        pdcpMeasReportPerUe.setDataVolUl(dataVolUl);
-        pdcpMeasReportPerUe.setPktDelayDl(pktDelayDl);
-        pdcpMeasReportPerUe.setPktDelayUl(pktDelayUl);
-        pdcpMeasReportPerUe.setPktDiscardRateDl(pktDiscardRateDl);
-        pdcpMeasReportPerUe.setPktLossRateDl(pktLossRateDl);
-        pdcpMeasReportPerUe.setPktLossRateUl(pktLossRateUl);
-        pdcpMeasReportPerUe.setThroughputDl(throughputDl);
-        pdcpMeasReportPerUe.setThroughputUl(throughputUl);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setPDCPMeasReportPerUe(pdcpMeasReportPerUe);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        XrancApiID apiID = new XrancApiID(24);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-
-    }
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/RRMConf.java b/src/main/java/org.onosproject.xran/samplemessages/RRMConf.java
deleted file mode 100644
index bf1e285..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/RRMConf.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.pdu.*;
-import org.onosproject.xran.entities.RnibCell;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class RRMConf {
-
-
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/RXSigMeasRep.java b/src/main/java/org.onosproject.xran/samplemessages/RXSigMeasRep.java
deleted file mode 100644
index e59b399..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/RXSigMeasRep.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.*;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class RXSigMeasRep {
-
-    public XrancPdu setPacketProperties(XrancPdu decoder) {
-        CRNTI crnti = decoder.getBody().getRXSigMeasConfig().getCrnti();
-        ECGI ecgi = decoder.getBody().getRXSigMeasConfig().getEcgi();
-
-        RXSigMeasReport.CellMeasReports cellMeasReports = new RXSigMeasReport.CellMeasReports();
-        RXSigReport rxSigReport = new RXSigReport();
-        PCIARFCN pciarfcn = new PCIARFCN();
-        pciarfcn.setPci(new PhysCellId(500));
-        pciarfcn.setEarfcnDl(new ARFCNValue(2100));
-        rxSigReport.setPciArfcn(pciarfcn);
-        rxSigReport.setRsrp(new RSRPRange(4));
-        rxSigReport.setRsrq(new RSRQRange(5));
-        cellMeasReports.setRXSigReport(rxSigReport);
-
-        RXSigReport rxSigReport1 = new RXSigReport();
-        PCIARFCN pciarfcn1 = new PCIARFCN();
-        pciarfcn1.setPci(new PhysCellId(500));
-        pciarfcn1.setEarfcnDl(new ARFCNValue(2100));
-        rxSigReport1.setPciArfcn(pciarfcn);
-        rxSigReport1.setRsrp(new RSRPRange(4));
-        rxSigReport1.setRsrq(new RSRQRange(5));
-        cellMeasReports.setRXSigReport(rxSigReport1);
-
-        RXSigMeasReport rxSigMeasReport = new RXSigMeasReport();
-        rxSigMeasReport.setCrnti(crnti);
-        rxSigMeasReport.setEcgi(ecgi);
-        rxSigMeasReport.setCellMeasReports(cellMeasReports);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setRXSigMeasReport(rxSigMeasReport);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        XrancApiID apiID = new XrancApiID(18);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-
-    }
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/RadioReportPerCell.java b/src/main/java/org.onosproject.xran/samplemessages/RadioReportPerCell.java
deleted file mode 100644
index 9f6218b..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/RadioReportPerCell.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.ECGI;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class RadioReportPerCell {
-    public XrancPdu setPacketProperties(XrancPdu recv_pdu) {
-
-        ECGI ecgi = recv_pdu.getBody().getL2MeasConfig().getEcgi();
-        RadioMeasReportPerCell.PuschIntfPowerHist puschIntfPowerHist = new RadioMeasReportPerCell.PuschIntfPowerHist();
-        puschIntfPowerHist.setBerInteger(new BerInteger(1));
-        puschIntfPowerHist.setBerInteger(new BerInteger(2));
-        puschIntfPowerHist.setBerInteger(new BerInteger(3));
-        puschIntfPowerHist.setBerInteger(new BerInteger(4));
-        puschIntfPowerHist.setBerInteger(new BerInteger(5));
-        puschIntfPowerHist.setBerInteger(new BerInteger(6));
-        puschIntfPowerHist.setBerInteger(new BerInteger(7));
-        puschIntfPowerHist.setBerInteger(new BerInteger(8));
-        puschIntfPowerHist.setBerInteger(new BerInteger(9));
-        puschIntfPowerHist.setBerInteger(new BerInteger(10));
-        puschIntfPowerHist.setBerInteger(new BerInteger(11));
-        puschIntfPowerHist.setBerInteger(new BerInteger(12));
-        puschIntfPowerHist.setBerInteger(new BerInteger(13));
-        puschIntfPowerHist.setBerInteger(new BerInteger(14));
-        puschIntfPowerHist.setBerInteger(new BerInteger(15));
-        puschIntfPowerHist.setBerInteger(new BerInteger(16));
-        puschIntfPowerHist.setBerInteger(new BerInteger(17));
-
-        RadioMeasReportPerCell.PucchIntfPowerHist pucchIntfPowerHist = new RadioMeasReportPerCell.PucchIntfPowerHist();
-        pucchIntfPowerHist.setBerInteger(new BerInteger(1));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(2));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(3));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(4));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(5));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(6));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(7));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(8));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(9));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(10));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(11));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(12));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(13));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(14));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(15));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(16));
-        pucchIntfPowerHist.setBerInteger(new BerInteger(17));
-
-        RadioMeasReportPerCell radioMeasReportPerCell = new RadioMeasReportPerCell();
-        radioMeasReportPerCell.setEcgi(ecgi);
-        radioMeasReportPerCell.setPuschIntfPowerHist(puschIntfPowerHist);
-        radioMeasReportPerCell.setPucchIntfPowerHist(pucchIntfPowerHist);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setRadioMeasReportPerCell(radioMeasReportPerCell);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        XrancApiID apiID = new XrancApiID(21);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-    }
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/RadioReportPerUE.java b/src/main/java/org.onosproject.xran/samplemessages/RadioReportPerUE.java
deleted file mode 100644
index 003d973..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/RadioReportPerUE.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.*;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class RadioReportPerUE {
-
-    public XrancPdu setPacketProperties(XrancPdu recv_pdu) {
-        ECGI ecgi = recv_pdu.getBody().getL2MeasConfig().getEcgi();
-
-        //Need to get this from UE.
-        CRNTI crnti = new CRNTI(new byte[]{(byte) 0x44, (byte) 0x44}, 16);
-        RadioRepPerServCell radioRepPerServCell = new RadioRepPerServCell();
-        PCIARFCN pciarfcn = new PCIARFCN();
-        pciarfcn.setPci(new PhysCellId(500));
-        pciarfcn.setEarfcnDl(new ARFCNValue(2100));
-        radioRepPerServCell.setPciArfcn(pciarfcn);
-
-        RadioRepPerServCell.CqiHist cqiHist = new RadioRepPerServCell.CqiHist();
-        cqiHist.setBerInteger(new BerInteger(1));
-        cqiHist.setBerInteger(new BerInteger(2));
-        cqiHist.setBerInteger(new BerInteger(3));
-        cqiHist.setBerInteger(new BerInteger(4));
-        cqiHist.setBerInteger(new BerInteger(5));
-        cqiHist.setBerInteger(new BerInteger(6));
-        cqiHist.setBerInteger(new BerInteger(7));
-        cqiHist.setBerInteger(new BerInteger(8));
-        cqiHist.setBerInteger(new BerInteger(9));
-        cqiHist.setBerInteger(new BerInteger(10));
-        cqiHist.setBerInteger(new BerInteger(11));
-        cqiHist.setBerInteger(new BerInteger(12));
-        cqiHist.setBerInteger(new BerInteger(13));
-        cqiHist.setBerInteger(new BerInteger(14));
-        cqiHist.setBerInteger(new BerInteger(15));
-        cqiHist.setBerInteger(new BerInteger(16));
-        radioRepPerServCell.setCqiHist(cqiHist);
-
-        RadioRepPerServCell.RiHist riHist = new RadioRepPerServCell.RiHist();
-        riHist.setBerInteger(new BerInteger(1));
-        riHist.setBerInteger(new BerInteger(1));
-        radioRepPerServCell.setRiHist(riHist);
-
-        RadioRepPerServCell.PuschSinrHist puschSinrHist = new RadioRepPerServCell.PuschSinrHist();
-        puschSinrHist.setBerInteger(new BerInteger(1));
-        puschSinrHist.setBerInteger(new BerInteger(2));
-        puschSinrHist.setBerInteger(new BerInteger(3));
-        puschSinrHist.setBerInteger(new BerInteger(4));
-        puschSinrHist.setBerInteger(new BerInteger(5));
-        puschSinrHist.setBerInteger(new BerInteger(6));
-        puschSinrHist.setBerInteger(new BerInteger(7));
-        puschSinrHist.setBerInteger(new BerInteger(8));
-        puschSinrHist.setBerInteger(new BerInteger(9));
-        puschSinrHist.setBerInteger(new BerInteger(10));
-        puschSinrHist.setBerInteger(new BerInteger(11));
-        puschSinrHist.setBerInteger(new BerInteger(12));
-        puschSinrHist.setBerInteger(new BerInteger(13));
-        puschSinrHist.setBerInteger(new BerInteger(14));
-        radioRepPerServCell.setPuschSinrHist(puschSinrHist);
-
-        RadioRepPerServCell.PucchSinrHist pucchSinrHist = new RadioRepPerServCell.PucchSinrHist();
-        pucchSinrHist.setBerInteger(new BerInteger(1));
-        pucchSinrHist.setBerInteger(new BerInteger(2));
-        pucchSinrHist.setBerInteger(new BerInteger(3));
-        pucchSinrHist.setBerInteger(new BerInteger(4));
-        pucchSinrHist.setBerInteger(new BerInteger(5));
-        pucchSinrHist.setBerInteger(new BerInteger(6));
-        pucchSinrHist.setBerInteger(new BerInteger(7));
-        pucchSinrHist.setBerInteger(new BerInteger(8));
-        pucchSinrHist.setBerInteger(new BerInteger(9));
-        pucchSinrHist.setBerInteger(new BerInteger(10));
-        pucchSinrHist.setBerInteger(new BerInteger(11));
-        pucchSinrHist.setBerInteger(new BerInteger(12));
-        pucchSinrHist.setBerInteger(new BerInteger(13));
-        pucchSinrHist.setBerInteger(new BerInteger(14));
-        radioRepPerServCell.setPucchSinrHist(pucchSinrHist);
-
-
-        RadioMeasReportPerUE.RadioReportServCells radioReportServCells = new RadioMeasReportPerUE.RadioReportServCells();
-        radioReportServCells.setRadioRepPerServCell(radioRepPerServCell);
-
-        RadioMeasReportPerUE radioMeasReportPerUE = new RadioMeasReportPerUE();
-        radioMeasReportPerUE.setRadioReportServCells(radioReportServCells);
-        radioMeasReportPerUE.setCrnti(crnti);
-        radioMeasReportPerUE.setEcgi(ecgi);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setRadioMeasReportPerUE(radioMeasReportPerUE);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        XrancApiID apiID = new XrancApiID(20);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-
-    }
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/SchedReportPerCell.java b/src/main/java/org.onosproject.xran/samplemessages/SchedReportPerCell.java
deleted file mode 100644
index 43ccecc..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/SchedReportPerCell.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.ECGI;
-import org.onosproject.xran.codecs.api.PRBUsage;
-import org.onosproject.xran.codecs.api.QCI;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class SchedReportPerCell {
-
-    public XrancPdu setPacketProperties(XrancPdu recv_pdu) {
-        ECGI ecgi = recv_pdu.getBody().getL2MeasConfig().getEcgi();
-
-        SchedMeasReportPerCell.QciVals qciVals = new SchedMeasReportPerCell.QciVals();
-        qciVals.setQCI(new QCI(1));
-        qciVals.setQCI(new QCI(2));
-
-        PRBUsage pcell = new PRBUsage();
-        PRBUsage.PrbUsageDl prbUsageDl = new PRBUsage.PrbUsageDl();
-        prbUsageDl.setBerInteger(new BerInteger(50));
-        prbUsageDl.setBerInteger(new BerInteger(100));
-        pcell.setPrbUsageDl(prbUsageDl);
-
-        PRBUsage.PrbUsageUl prbUsageUl = new PRBUsage.PrbUsageUl();
-        prbUsageUl.setBerInteger(new BerInteger(50));
-        prbUsageUl.setBerInteger(new BerInteger(100));
-        pcell.setPrbUsageUl(prbUsageUl);
-
-        PRBUsage scell = new PRBUsage();
-        prbUsageDl.setBerInteger(new BerInteger(50));
-        prbUsageDl.setBerInteger(new BerInteger(100));
-        scell.setPrbUsageDl(prbUsageDl);
-
-        prbUsageUl.setBerInteger(new BerInteger(50));
-        prbUsageUl.setBerInteger(new BerInteger(100));
-        scell.setPrbUsageUl(prbUsageUl);
-
-        SchedMeasReportPerCell schedMeasReportPerCell = new SchedMeasReportPerCell();
-        schedMeasReportPerCell.setEcgi(ecgi);
-        schedMeasReportPerCell.setQciVals(qciVals);
-        schedMeasReportPerCell.setPrbUsagePcell(pcell);
-        schedMeasReportPerCell.setPrbUsageScell(scell);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setSchedMeasReportPerCell(schedMeasReportPerCell);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        XrancApiID apiID = new XrancApiID(23);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-
-    }
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/SchedReportPerUE.java b/src/main/java/org.onosproject.xran/samplemessages/SchedReportPerUE.java
deleted file mode 100644
index 5e7676c..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/SchedReportPerUE.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.*;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class SchedReportPerUE {
-
-    public XrancPdu setPacketProperties(XrancPdu recv_pdu) {
-        ECGI ecgi = recv_pdu.getBody().getL2MeasConfig().getEcgi();
-
-        //Need to get this from UE.
-        CRNTI crnti = new CRNTI(new byte[]{(byte) 0x44, (byte) 0x44}, 16);
-
-        SchedMeasRepPerServCell schedMeasRepPerServCell = new SchedMeasRepPerServCell();
-        PCIARFCN pciarfcn = new PCIARFCN();
-        pciarfcn.setPci(new PhysCellId(500));
-        pciarfcn.setEarfcnDl(new ARFCNValue(2100));
-
-        SchedMeasRepPerServCell.QciVals qciVals = new SchedMeasRepPerServCell.QciVals();
-        qciVals.setQCI(new QCI(1));
-        qciVals.setQCI(new QCI(2));
-
-        PRBUsage prbUsage = new PRBUsage();
-        PRBUsage.PrbUsageDl prbUsageDl = new PRBUsage.PrbUsageDl();
-        prbUsageDl.setBerInteger(new BerInteger(50));
-        prbUsageDl.setBerInteger(new BerInteger(100));
-        prbUsage.setPrbUsageDl(prbUsageDl);
-
-        PRBUsage.PrbUsageUl prbUsageUl = new PRBUsage.PrbUsageUl();
-        prbUsageUl.setBerInteger(new BerInteger(50));
-        prbUsageUl.setBerInteger(new BerInteger(100));
-        prbUsage.setPrbUsageUl(prbUsageUl);
-
-        SchedMeasRepPerServCell.McsDl mcsDl = new SchedMeasRepPerServCell.McsDl();
-        mcsDl.setBerInteger(new BerInteger(1));
-        mcsDl.setBerInteger(new BerInteger(4));
-
-        SchedMeasRepPerServCell.McsUl mcsUl = new SchedMeasRepPerServCell.McsUl();
-        mcsUl.setBerInteger(new BerInteger(5));
-        mcsUl.setBerInteger(new BerInteger(6));
-
-        SchedMeasRepPerServCell.NumSchedTtisDl numSchedTtisDl = new SchedMeasRepPerServCell.NumSchedTtisDl();
-        numSchedTtisDl.setBerInteger(new BerInteger(1000));
-        numSchedTtisDl.setBerInteger(new BerInteger(1000));
-
-        SchedMeasRepPerServCell.NumSchedTtisUl numSchedTtisUl = new SchedMeasRepPerServCell.NumSchedTtisUl();
-        numSchedTtisUl.setBerInteger(new BerInteger(1000));
-        numSchedTtisUl.setBerInteger(new BerInteger(1000));
-
-        SchedMeasRepPerServCell.RankDl1 rankDl1 = new SchedMeasRepPerServCell.RankDl1();
-        rankDl1.setBerInteger(new BerInteger(1));
-        rankDl1.setBerInteger(new BerInteger(1));
-
-        SchedMeasRepPerServCell.RankDl2 rankDl2 = new SchedMeasRepPerServCell.RankDl2();
-        rankDl2.setBerInteger(new BerInteger(1));
-        rankDl2.setBerInteger(new BerInteger(1));
-
-        schedMeasRepPerServCell.setPciArfcn(pciarfcn);
-        schedMeasRepPerServCell.setQciVals(qciVals);
-        schedMeasRepPerServCell.setPrbUsage(prbUsage);
-        schedMeasRepPerServCell.setMcsDl(mcsDl);
-        schedMeasRepPerServCell.setMcsUl(mcsUl);
-        schedMeasRepPerServCell.setNumSchedTtisDl(numSchedTtisDl);
-        schedMeasRepPerServCell.setNumSchedTtisUl(numSchedTtisUl);
-        schedMeasRepPerServCell.setRankDl1(rankDl1);
-        schedMeasRepPerServCell.setRankDl2(rankDl2);
-
-        SchedMeasReportPerUE.SchedReportServCells schedReportServCells = new SchedMeasReportPerUE.SchedReportServCells();
-        schedReportServCells.setSchedMeasRepPerServCell(schedMeasRepPerServCell);
-
-        SchedMeasReportPerUE schedMeasReportPerUE = new SchedMeasReportPerUE();
-        schedMeasReportPerUE.setCrnti(crnti);
-        schedMeasReportPerUE.setEcgi(ecgi);
-        schedMeasReportPerUE.setSchedReportServCells(schedReportServCells);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setSchedMeasReportPerUE(schedMeasReportPerUE);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        XrancApiID apiID = new XrancApiID(22);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-
-
-    }
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/SignalMeasConfig.java b/src/main/java/org.onosproject.xran/samplemessages/SignalMeasConfig.java
deleted file mode 100644
index b7f5eaa..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/SignalMeasConfig.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.*;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class SignalMeasConfig {
-    public static XrancPdu constructPacket(ECGI ecgi, CRNTI crnti, RXSigMeasConfig.MeasCells measCells, int interval) {
-        RXSigRepQty rxSigRepQty = new RXSigRepQty(2);
-        RXSigMeasRepInterval repInterval = new RXSigMeasRepInterval(interval);
-
-        RXSigMeasConfig sigMeasConfig = new RXSigMeasConfig();
-        sigMeasConfig.setCrnti(crnti);
-        sigMeasConfig.setEcgi(ecgi);
-        sigMeasConfig.setReportQty(rxSigRepQty);
-        sigMeasConfig.setMeasCells(measCells);
-        sigMeasConfig.setReportInterval(repInterval);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setRXSigMeasConfig(sigMeasConfig);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        XrancApiID apiID = new XrancApiID(17);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-    }
-
-    public XrancPdu setPacketProperties() {
-        CRNTI crnti = new CRNTI(new byte[]{(byte) 0x44, (byte) 0x44});
-
-        PLMNIdentity plmnIdentity = new PLMNIdentity(new byte[]{(byte) 0xFC, (byte) 0xFF, (byte) 0x3F});
-        EUTRANCellIdentifier eutranCellIdentifier = new EUTRANCellIdentifier(new byte[]{
-                (byte) 0xCF, (byte) 0xFE, (byte) 0x7C, (byte) 0xF0
-        }, 28);
-
-        ECGI ecgi = new ECGI();
-        ecgi.setPLMNIdentity(plmnIdentity);
-        ecgi.setEUTRANcellIdentifier(eutranCellIdentifier);
-
-        RXSigRepQty rxSigRepQty = new RXSigRepQty(2);
-        PCIARFCN pciarfcn = new PCIARFCN();
-        pciarfcn.setPci(new PhysCellId(500));
-        pciarfcn.setEarfcnDl(new ARFCNValue(2100));
-        RXSigMeasConfig.MeasCells measCells = new RXSigMeasConfig.MeasCells();
-        measCells.setPCIARFCN(pciarfcn);
-        RXSigMeasRepInterval repInterval = new RXSigMeasRepInterval(1);
-
-
-        RXSigMeasConfig sigMeasConfig = new RXSigMeasConfig();
-        sigMeasConfig.setCrnti(crnti);
-        sigMeasConfig.setEcgi(ecgi);
-        sigMeasConfig.setReportQty(rxSigRepQty);
-        sigMeasConfig.setMeasCells(measCells);
-        sigMeasConfig.setReportInterval(repInterval);
-
-
-        XrancPduBody body = new XrancPduBody();
-        body.setRXSigMeasConfig(sigMeasConfig);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        XrancApiID apiID = new XrancApiID(17);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-    }
-
-
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/UEAdmEncoderDecoder.java b/src/main/java/org.onosproject.xran/samplemessages/UEAdmEncoderDecoder.java
deleted file mode 100644
index 7110b2c..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/UEAdmEncoderDecoder.java
+++ /dev/null
@@ -1,95 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.AdmEstResponse;
-import org.onosproject.xran.codecs.api.CRNTI;
-import org.onosproject.xran.codecs.api.ECGI;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class UEAdmEncoderDecoder {
-
-    private int flag;
-    private BerByteArrayOutputStream os;
-    private XrancPdu pdu;
-
-    public UEAdmEncoderDecoder() {
-        os = new BerByteArrayOutputStream(4096);
-    }
-
-    public static XrancPdu constructPacket(ECGI ecgi, CRNTI crnti) {
-        AdmEstResponse response = new AdmEstResponse(0);
-
-        UEAdmissionResponse ueAdmissionResponse = new UEAdmissionResponse();
-        ueAdmissionResponse.setCrnti(crnti);
-        ueAdmissionResponse.setEcgi(ecgi);
-        ueAdmissionResponse.setAdmEstResponse(response);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setUEAdmissionResponse(ueAdmissionResponse);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        XrancApiID apiID = new XrancApiID(3);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-        return pdu;
-    }
-
-    public XrancPdu setPacketProperties(UEAdmissionRequest pdu_decoded) {
-        /*XrancPdu pdu_decoded = new XrancPdu();
-        byte[] bytearray = DatatypeConverter.parseHexBinary(decodedString);
-        InputStream inputStream = new ByteArrayInputStream(bytearray);
-        try {
-            pdu_decoded.decode(inputStream);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }*/
-        CRNTI crnti = pdu_decoded.getCrnti();
-        ECGI ecgi = pdu_decoded.getEcgi();
-
-        AdmEstResponse response = new AdmEstResponse(1);
-        /*if (flag == 1) {
-            response = new AdmEstResponse(0);
-        } else {
-            response = new AdmEstResponse(1);
-        }*/
-
-        UEAdmissionResponse ueAdmissionResponse = new UEAdmissionResponse();
-        ueAdmissionResponse.setCrnti(crnti);
-        ueAdmissionResponse.setEcgi(ecgi);
-        ueAdmissionResponse.setAdmEstResponse(response);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setUEAdmissionResponse(ueAdmissionResponse);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        XrancApiID apiID = new XrancApiID(3);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-        return pdu;
-
-    }
-
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/UEAdmRequest.java b/src/main/java/org.onosproject.xran/samplemessages/UEAdmRequest.java
deleted file mode 100644
index e47f366..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/UEAdmRequest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.*;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class UEAdmRequest {
-
-    BerByteArrayOutputStream os;
-
-    public UEAdmRequest() {
-        os = new BerByteArrayOutputStream(4096);
-    }
-
-    /*public String encodeResponse() {
-        pdu = setPacketProperties();
-        try {
-            pdu.encode(os);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        return DatatypeConverter.printHexBinary(os.getArray());
-    }*/
-
-    public XrancPdu setPacketProperties() throws UnsupportedEncodingException {
-        CRNTI crnti = new CRNTI(new byte[]{(byte) 0x44, (byte) 0x44}, 16);
-
-        PLMNIdentity plmnIdentity = new PLMNIdentity(new byte[]{(byte) 0x22, (byte) 0x08, (byte) 0x41});
-        EUTRANCellIdentifier eutranCellIdentifier = new EUTRANCellIdentifier(new byte[]{
-                (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xF0
-        }, 28);
-
-        ECGI ecgi = new ECGI();
-        ecgi.setPLMNIdentity(plmnIdentity);
-        ecgi.setEUTRANcellIdentifier(eutranCellIdentifier);
-
-        AdmEstCause admEstCause = new AdmEstCause(4);
-
-        UEAdmissionRequest admissionRequest = new UEAdmissionRequest();
-
-        admissionRequest.setCrnti(crnti);
-        admissionRequest.setEcgi(ecgi);
-        admissionRequest.setAdmEstCause(admEstCause);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setUEAdmissionRequest(admissionRequest);
-
-        BerUTF8String ver = new BerUTF8String("4");
-
-        XrancApiID apiID = new XrancApiID(2);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-    }
-
-}
\ No newline at end of file
diff --git a/src/main/java/org.onosproject.xran/samplemessages/UECapabilityEnq.java b/src/main/java/org.onosproject.xran/samplemessages/UECapabilityEnq.java
deleted file mode 100644
index 1ea246f..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/UECapabilityEnq.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.onosproject.xran.samplemessages;
-
-import org.onosproject.xran.codecs.api.CRNTI;
-import org.onosproject.xran.codecs.api.ECGI;
-import org.onosproject.xran.codecs.pdu.*;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
-
-import java.io.UnsupportedEncodingException;
-
-public class UECapabilityEnq {
-
-    public static XrancPdu constructPacket(ECGI ecgi, CRNTI crnti) {
-        UECapabilityEnquiry capabilityEnquiry = new UECapabilityEnquiry();
-        capabilityEnquiry.setCrnti(crnti);
-        capabilityEnquiry.setEcgi(ecgi);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setUECapabilityEnquiry(capabilityEnquiry);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        XrancApiID apiID = new XrancApiID(12);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-    }
-
-    public XrancPdu setPacketProperties(XrancPdu mainDecoder) {
-        CRNTI crnti = mainDecoder.getBody().getUECapabilityEnquiry().getCrnti();
-
-        //TODO: ECGI Value has to be read as CELL ID.
-        ECGI ecgi = mainDecoder.getBody().getUECapabilityEnquiry().getEcgi();
-
-        UECapabilityEnquiry capabilityEnquiry = new UECapabilityEnquiry();
-        capabilityEnquiry.setCrnti(crnti);
-        capabilityEnquiry.setEcgi(ecgi);
-
-        XrancPduBody body = new XrancPduBody();
-        body.setUECapabilityEnquiry(capabilityEnquiry);
-
-        BerUTF8String ver = null;
-        try {
-            ver = new BerUTF8String("4");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        XrancApiID apiID = new XrancApiID(12);
-        XrancPduHdr hdr = new XrancPduHdr();
-        hdr.setVer(ver);
-        hdr.setApiId(apiID);
-
-        XrancPdu pdu = new XrancPdu();
-        pdu.setHdr(hdr);
-        pdu.setBody(body);
-
-        return pdu;
-    }
-}
diff --git a/src/main/java/org.onosproject.xran/samplemessages/package-info.java b/src/main/java/org.onosproject.xran/samplemessages/package-info.java
deleted file mode 100644
index 175bb66..0000000
--- a/src/main/java/org.onosproject.xran/samplemessages/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * 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.
- */
-
-package org.onosproject.xran.samplemessages;
\ No newline at end of file
diff --git a/src/main/java/org.onosproject.xran/wrapper/LinkMap.java b/src/main/java/org.onosproject.xran/wrapper/LinkMap.java
index 4acf0ae..862acf6 100644
--- a/src/main/java/org.onosproject.xran/wrapper/LinkMap.java
+++ b/src/main/java/org.onosproject.xran/wrapper/LinkMap.java
@@ -121,7 +121,7 @@
         Optional<RnibLink> primary = linksByUeId.stream().filter(l -> l.getType().equals(RnibLink.Type.SERVING_PRIMARY)).findFirst();
 
         if (primary.isPresent()) {
-            return primary.get().getLinkId().getSourceId();
+            return primary.get().getLinkId().getEcgi();
         }
         return null;
     }
diff --git a/xran-cfg.json b/xran-cfg.json
index 86f7ed2..c18a94c 100644
--- a/xran-cfg.json
+++ b/xran-cfg.json
@@ -27,7 +27,9 @@
         "l2_meas_report_interval_ms": 30000,
         "rx_signal_meas_report_interval_seconds": 7,
         "xranc_cellconfigrequest_interval_seconds": 10,
-        "xranc_port": 7891
+        "xranc_port": 7891,
+        "admission_success": false,
+        "bearer_success": false
       }
     }
   }
