diff --git a/src/main/java/org.onosproject.xran/entities/RnibCell.java b/src/main/java/org.onosproject.xran/entities/RnibCell.java
index dae002c..2e6a8c8 100644
--- a/src/main/java/org.onosproject.xran/entities/RnibCell.java
+++ b/src/main/java/org.onosproject.xran/entities/RnibCell.java
@@ -16,21 +16,19 @@
 
 package org.onosproject.xran.entities;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.*;
 import com.fasterxml.jackson.databind.JsonNode;
 import org.onosproject.net.DeviceId;
+import org.onosproject.store.Timestamp;
+import org.onosproject.store.service.WallClockTimestamp;
 import org.onosproject.xran.codecs.api.ECGI;
 import org.onosproject.xran.codecs.api.PRBUsage;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
 import org.onosproject.xran.codecs.pdu.CellConfigReport;
 import org.onosproject.xran.codecs.pdu.L2MeasConfig;
 import org.onosproject.xran.codecs.pdu.RRMConfig;
 import org.onosproject.xran.codecs.pdu.SchedMeasReportPerCell;
-import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
-import org.onosproject.xran.codecs.ber.types.BerBitString;
-import org.onosproject.xran.codecs.ber.types.BerInteger;
 
 import javax.xml.bind.DatatypeConverter;
 import java.io.ByteArrayInputStream;
@@ -76,7 +74,6 @@
     private String version;
 
     public RnibCell() {
-        prbUsage = new PrbUsageContainer();
         version = "3";
 
         rrmConfig = new RRMConfig();
@@ -152,10 +149,6 @@
         return conf;
     }
 
-    /*public RRMConfig getRrmConfig() {
-        return rrmConfig;
-    }*/
-
     @JsonProperty("Configuration")
     public void setConf(CellConfigReport conf) {
         this.conf = conf;
@@ -242,14 +235,6 @@
         this.qci = qci;
     }
 
-    public void setPrimaryPrbUsage(PRBUsage primary) {
-        this.prbUsage.primary = primary;
-    }
-
-    public void setSecondaryPrbUsage(PRBUsage secondary) {
-        this.prbUsage.secondary = secondary;
-    }
-
     @JsonProperty("MeasurementConfiguration")
     public L2MeasConfig getMeasConfig() {
         return measConfig;
@@ -290,12 +275,21 @@
 
     @JsonPropertyOrder({
             "primary",
-            "secondary"
+            "secondary",
+            "timesincelastupdate"
     })
     @JsonIgnoreProperties(ignoreUnknown = true)
-    class PrbUsageContainer {
+    public static class PrbUsageContainer {
         PRBUsage primary;
         PRBUsage secondary;
+        WallClockTimestamp timesincelastupdate;
+
+        @JsonCreator
+        public PrbUsageContainer(@JsonProperty("primary") PRBUsage primary, @JsonProperty("secondary") PRBUsage secondary) {
+            this.primary = primary;
+            this.secondary = secondary;
+            this.timesincelastupdate = new WallClockTimestamp();
+        }
 
         public PRBUsage getPrimary() {
             return primary;
@@ -313,11 +307,19 @@
             this.secondary = secondary;
         }
 
+        public long getTimesincelastupdate() {
+            return timesincelastupdate.unixTimestamp();
+        }
+        public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
+            this.timesincelastupdate = timesincelastupdate;
+        }
+
         @Override
         public String toString() {
             return "PrbUsageContainer{" +
                     "primary=" + primary +
                     ", secondary=" + secondary +
+                    ", timesincelastupdate=" + timesincelastupdate +
                     '}';
         }
     }
diff --git a/src/main/java/org.onosproject.xran/entities/RnibLink.java b/src/main/java/org.onosproject.xran/entities/RnibLink.java
index ade8f58..70ffe4f 100644
--- a/src/main/java/org.onosproject.xran/entities/RnibLink.java
+++ b/src/main/java/org.onosproject.xran/entities/RnibLink.java
@@ -16,17 +16,15 @@
 
 package org.onosproject.xran.entities;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.*;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.google.common.collect.Lists;
+import org.onosproject.store.service.WallClockTimestamp;
 import org.onosproject.xran.codecs.api.*;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
 import org.onosproject.xran.codecs.pdu.PDCPMeasReportPerUe;
 import org.onosproject.xran.codecs.pdu.RRMConfig;
 import org.onosproject.xran.identifiers.LinkId;
-import org.onosproject.xran.codecs.ber.types.BerInteger;
 
 import java.util.Arrays;
 import java.util.List;
@@ -76,16 +74,14 @@
         trafficPercent.setTrafficPercentDl(new BerInteger(100));
         trafficPercent.setTrafficPercentUl(new BerInteger(100));
 
-        pdcpThroughput = new PDCPThroughput();
-        quality = new LinkQuality();
-        pdcpPackDelay = new PDCPPacketDelay();
-        resourceUsage = new ResourceUsage();
         timer = new Timer();
 
         type = Type.NON_SERVING;
 
         linkId = LinkId.valueOf(cell, ue);
 
+        quality = new LinkQuality();
+
         rrmParameters = new RRMConfig();
         RRMConfig.Crnti crnti = new RRMConfig.Crnti();
         crnti.addCRNTI(linkId.getUe().getRanId());
@@ -326,14 +322,227 @@
     }
 
     @JsonPropertyOrder({
+            "RX",
+            "CQI",
+            "MCS"
+    })
+    @JsonIgnoreProperties(ignoreUnknown = true)
+    public static class LinkQuality {
+        RX RX = null;
+        CQI CQI = null;
+        MCS MCS = null;
+
+        public LinkQuality.RX getRX() {
+            return RX;
+        }
+
+        public void setRX(LinkQuality.RX RX) {
+            this.RX = RX;
+        }
+
+        public LinkQuality.CQI getCQI() {
+            return CQI;
+        }
+
+        public void setCQI(LinkQuality.CQI CQI) {
+            this.CQI = CQI;
+        }
+
+        public LinkQuality.MCS getMCS() {
+            return MCS;
+        }
+
+        public void setMCS(LinkQuality.MCS MCS) {
+            this.MCS = MCS;
+        }
+
+        @JsonPropertyOrder({
+                "RSRP",
+                "RSRQ",
+                "timesincelastupdate"
+        })
+        @JsonIgnoreProperties(ignoreUnknown = true)
+        public static class RX {
+            double RSRP;
+            double RSRQ;
+            WallClockTimestamp timesincelastupdate;
+
+            @JsonCreator
+            public RX(@JsonProperty("RSRP") double RSRP, @JsonProperty("RSRQ") double RSRQ) {
+                this.RSRP = RSRP;
+                this.RSRQ = RSRQ;
+                this.timesincelastupdate = new WallClockTimestamp();
+            }
+
+            public double getRSRP() {
+                return RSRP;
+            }
+
+            public void setRSRP(double RSRP) {
+                this.RSRP = RSRP;
+            }
+
+            public double getRSRQ() {
+                return RSRQ;
+            }
+
+            public void setRSRQ(double RSRQ) {
+                this.RSRQ = RSRQ;
+            }
+
+            public long getTimesincelastupdate() {
+                return timesincelastupdate.unixTimestamp();
+            }
+
+            public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
+                this.timesincelastupdate = timesincelastupdate;
+            }
+
+            @Override
+            public String toString() {
+                return "RX{" +
+                        "RSRP=" + RSRP +
+                        ", RSRQ=" + RSRQ +
+                        ", timesincelastupdate=" + timesincelastupdate +
+                        '}';
+            }
+        }
+
+        @JsonPropertyOrder({
+                "Hist",
+                "Mode",
+                "Mean",
+                "timesincelastupdate"
+        })
+        @JsonIgnoreProperties(ignoreUnknown = true)
+        public static class CQI {
+            RadioRepPerServCell.CqiHist Hist;
+            double Mode;
+            double Mean;
+            WallClockTimestamp timesincelastupdate;
+
+            @JsonCreator
+            public CQI(@JsonProperty("Hist") RadioRepPerServCell.CqiHist hist, @JsonProperty("Mode") double mode, @JsonProperty("Mean") double mean) {
+                Hist = hist;
+                Mode = mode;
+                Mean = mean;
+                this.timesincelastupdate = new WallClockTimestamp();
+            }
+
+            public RadioRepPerServCell.CqiHist getHist() {
+                return Hist;
+            }
+
+            public void setHist(RadioRepPerServCell.CqiHist hist) {
+                Hist = hist;
+            }
+
+            public double getMode() {
+                return Mode;
+            }
+
+            public void setMode(double mode) {
+                Mode = mode;
+            }
+
+            public double getMean() {
+                return Mean;
+            }
+
+            public void setMean(double mean) {
+                Mean = mean;
+            }
+
+            public long getTimesincelastupdate() {
+                return timesincelastupdate.unixTimestamp();
+            }
+
+            public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
+                this.timesincelastupdate = timesincelastupdate;
+            }
+
+            @Override
+            public String toString() {
+                return "CQI{" +
+                        "Hist=" + Hist +
+                        ", Mode=" + Mode +
+                        ", Mean=" + Mean +
+                        ", timesincelastupdate=" + timesincelastupdate +
+                        '}';
+            }
+        }
+
+        @JsonPropertyOrder({
+                "dl",
+                "ul",
+                "timesincelastupdate"
+        })
+        @JsonIgnoreProperties(ignoreUnknown = true)
+        public static class MCS {
+            SchedMeasRepPerServCell.McsDl dl;
+            SchedMeasRepPerServCell.McsUl ul;
+            WallClockTimestamp timesincelastupdate;
+
+            @JsonCreator
+            public MCS(@JsonProperty("dl") SchedMeasRepPerServCell.McsDl dl, @JsonProperty("ul") SchedMeasRepPerServCell.McsUl ul) {
+                this.dl = dl;
+                this.ul = ul;
+                this.timesincelastupdate = new WallClockTimestamp();
+            }
+
+            public SchedMeasRepPerServCell.McsDl getDl() {
+                return dl;
+            }
+
+            public void setDl(SchedMeasRepPerServCell.McsDl dl) {
+                this.dl = dl;
+            }
+
+            public SchedMeasRepPerServCell.McsUl getUl() {
+                return ul;
+            }
+
+            public void setUl(SchedMeasRepPerServCell.McsUl ul) {
+                this.ul = ul;
+            }
+
+            public long getTimesincelastupdate() {
+                return timesincelastupdate.unixTimestamp();
+            }
+
+            public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
+                this.timesincelastupdate = timesincelastupdate;
+            }
+
+            @Override
+            public String toString() {
+                return "MCS{" +
+                        "dl=" + dl +
+                        ", ul=" + ul +
+                        ", timesincelastupdate=" + timesincelastupdate +
+                        '}';
+            }
+        }
+
+    }
+
+    @JsonPropertyOrder({
             "dl",
             "ul"
     })
     @JsonIgnoreProperties(ignoreUnknown = true)
-    public class PDCPThroughput {
+    public static class PDCPThroughput {
+        WallClockTimestamp timesincelastupdate;
         private PDCPMeasReportPerUe.ThroughputDl dl;
         private PDCPMeasReportPerUe.ThroughputUl ul;
 
+        @JsonCreator
+        public PDCPThroughput(@JsonProperty("dl") PDCPMeasReportPerUe.ThroughputDl dl, @JsonProperty("ul") PDCPMeasReportPerUe.ThroughputUl ul) {
+            this.dl = dl;
+            this.ul = ul;
+            this.timesincelastupdate = new WallClockTimestamp();
+        }
+
         public PDCPMeasReportPerUe.ThroughputDl getDl() {
             return dl;
         }
@@ -350,11 +559,21 @@
             this.ul = ul;
         }
 
+        public long getTimesincelastupdate() {
+            return timesincelastupdate.unixTimestamp();
+        }
+
+        public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
+            this.timesincelastupdate = timesincelastupdate;
+        }
+
         @Override
-        public String toString() {
+        public String
+        toString() {
             return "PDCPThroughput{" +
                     "dl=" + dl +
                     ", ul=" + ul +
+                    ", timesincelastupdate=" + timesincelastupdate +
                     '}';
         }
     }
@@ -364,9 +583,17 @@
             "ul"
     })
     @JsonIgnoreProperties(ignoreUnknown = true)
-    public class PDCPPacketDelay {
+    public static class PDCPPacketDelay {
         PDCPMeasReportPerUe.PktDelayDl dl;
         PDCPMeasReportPerUe.PktDelayUl ul;
+        WallClockTimestamp timesincelastupdate;
+
+        @JsonCreator
+        public PDCPPacketDelay(@JsonProperty("dl") PDCPMeasReportPerUe.PktDelayDl dl, @JsonProperty("ul") PDCPMeasReportPerUe.PktDelayUl ul) {
+            this.dl = dl;
+            this.ul = ul;
+            this.timesincelastupdate = new WallClockTimestamp();
+        }
 
         public PDCPMeasReportPerUe.PktDelayDl getDl() {
             return dl;
@@ -384,11 +611,20 @@
             this.ul = ul;
         }
 
+        public long getTimesincelastupdate() {
+            return timesincelastupdate.unixTimestamp();
+        }
+
+        public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
+            this.timesincelastupdate = timesincelastupdate;
+        }
+
         @Override
         public String toString() {
             return "PDCPPacketDelay{" +
                     "dl=" + dl +
                     ", ul=" + ul +
+                    ", timesincelastupdate=" + timesincelastupdate +
                     '}';
         }
     }
@@ -398,9 +634,17 @@
             "ul"
     })
     @JsonIgnoreProperties(ignoreUnknown = true)
-    public class ResourceUsage {
+    public static class ResourceUsage {
         PRBUsage.PrbUsageDl dl;
         PRBUsage.PrbUsageUl ul;
+        WallClockTimestamp timesincelastupdate;
+
+        @JsonCreator
+        public ResourceUsage(@JsonProperty("dl") PRBUsage.PrbUsageDl dl, @JsonProperty("ul") PRBUsage.PrbUsageUl ul) {
+            this.dl = dl;
+            this.ul = ul;
+            this.timesincelastupdate = new WallClockTimestamp();
+        }
 
         public PRBUsage.PrbUsageDl getDl() {
             return dl;
@@ -418,100 +662,20 @@
             this.ul = ul;
         }
 
+        public long getTimesincelastupdate() {
+            return timesincelastupdate.unixTimestamp();
+        }
+
+        public void setTimesincelastupdate(WallClockTimestamp timesincelastupdate) {
+            this.timesincelastupdate = timesincelastupdate;
+        }
+
         @Override
         public String toString() {
             return "ResourceUsage{" +
                     "dl=" + dl +
                     ", ul=" + ul +
-                    '}';
-        }
-    }
-
-    @JsonPropertyOrder({
-            "rsrp",
-            "rsrq",
-            "cqiHist",
-            "cqiMode",
-            "cqiMean",
-            "mcsDl",
-            "mcsUl"
-    })
-    @JsonIgnoreProperties(ignoreUnknown = true)
-    public class LinkQuality {
-        double rsrp;
-        double rsrq;
-        RadioRepPerServCell.CqiHist cqiHist;
-        double cqiMode;
-        double cqiMean;
-        SchedMeasRepPerServCell.McsDl mcsDl;
-        SchedMeasRepPerServCell.McsUl mcsUl;
-
-        public double getRsrp() {
-            return rsrp;
-        }
-
-        public void setRsrp(double rsrp) {
-            this.rsrp = rsrp;
-        }
-
-        public double getRsrq() {
-            return rsrq;
-        }
-
-        public void setRsrq(double rsrq) {
-            this.rsrq = rsrq;
-        }
-
-        public RadioRepPerServCell.CqiHist getCqiHist() {
-            return cqiHist;
-        }
-
-        public void setCqiHist(RadioRepPerServCell.CqiHist cqiHist) {
-            this.cqiHist = cqiHist;
-        }
-
-        public double getCqiMode() {
-            return cqiMode;
-        }
-
-        public void setCqiMode(double cqiMode) {
-            this.cqiMode = cqiMode;
-        }
-
-        public double getCqiMean() {
-            return cqiMean;
-        }
-
-        public void setCqiMean(double cqiMean) {
-            this.cqiMean = cqiMean;
-        }
-
-        public SchedMeasRepPerServCell.McsDl getMcsDl() {
-            return mcsDl;
-        }
-
-        public void setMcsDl(SchedMeasRepPerServCell.McsDl mcsDl) {
-            this.mcsDl = mcsDl;
-        }
-
-        public SchedMeasRepPerServCell.McsUl getMcsUl() {
-            return mcsUl;
-        }
-
-        public void setMcsUl(SchedMeasRepPerServCell.McsUl mcsUl) {
-            this.mcsUl = mcsUl;
-        }
-
-        @Override
-        public String toString() {
-            return "LinkQuality{" +
-                    "rsrp=" + rsrp +
-                    ", rsrq=" + rsrq +
-                    ", cqiHist=" + cqiHist +
-                    ", cqiMode=" + cqiMode +
-                    ", cqiMean=" + cqiMean +
-                    ", mcsDl=" + mcsDl +
-                    ", mcsUl=" + mcsUl +
+                    ", timesincelastupdate=" + timesincelastupdate +
                     '}';
         }
     }
