diff --git a/apps/bgpmonitoring/api/src/main/java/org/onosproject/bgpmonitoring/StatsMessage.java b/apps/bgpmonitoring/api/src/main/java/org/onosproject/bgpmonitoring/StatsMessage.java
new file mode 100644
index 0000000..ee12381
--- /dev/null
+++ b/apps/bgpmonitoring/api/src/main/java/org/onosproject/bgpmonitoring/StatsMessage.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2024-present Open Networking Foundation
+ *
+ * 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.bgpmonitoring;
+
+import java.util.List;
+
+/**
+ * Abstraction of an BMP statistics report message.
+ */
+public abstract class StatsMessage extends BmpMessage {
+
+    public static final int STATS_REPORT_HEADER_MIN_LENGTH = 4;
+
+    /**
+     * Returns BMP Peer Header of BMP Message.
+     *
+     * @return BMP Peer Header of BMP Message
+     */
+    public abstract PerPeer getPerPeer();
+
+    /**
+     * Returns number of BMP statistics records.
+     *
+     * @return number of BMP statistics records
+     */
+    public abstract int getStatsCount();
+
+    /**
+     * Returns BGP statistics.
+     *
+     * @return BGP statistics
+     */
+    public abstract List<BmpStats> getStats();
+
+}
\ No newline at end of file
diff --git a/apps/bgpmonitoring/api/src/main/java/org/onosproject/bgpmonitoring/StatsType.java b/apps/bgpmonitoring/api/src/main/java/org/onosproject/bgpmonitoring/StatsType.java
new file mode 100644
index 0000000..780fd7d
--- /dev/null
+++ b/apps/bgpmonitoring/api/src/main/java/org/onosproject/bgpmonitoring/StatsType.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2024-present Open Networking Foundation
+ *
+ * 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.bgpmonitoring;
+
+import org.onlab.packet.DeserializationException;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Enum to Provide the Different types of BMP stats.
+ */
+public enum StatsType {
+
+    PREFIXES_REJECTED(0),
+
+    DUPLICATE_PREFIX(1),
+
+    DUPLICATE_WITHDRAW(2),
+
+    CLUSTER_LIST(3),
+
+    AS_PATH(4),
+
+    ORIGINATOR_ID(5),
+
+    AS_CONFED(6),
+
+    ADJ_RIB_IN(7),
+
+    LOC_RIB(8),
+
+    ADJ_RIB_IN_AFI_SAFI(9),
+
+    LOC_RIB_AFI_SAFI(10),
+
+    UPDATES_SUBJECTED_WITHDRAW(11),
+
+    PREFIXES_SUBJECTED_WITHDRAW(12),
+
+    DUPLICATE_UPDATE_MESSAGES(13),
+
+    JNX_ADJ_RIB_IN(17);
+
+
+    private final int value;
+
+    /**
+     * Assign value with the value val as the types of BMP stats.
+     *
+     * @param val type of BMP stats
+     */
+    StatsType(int val) {
+        value = val;
+    }
+
+    /**
+     * Returns value as type of BMP stats.
+     *
+     * @return value type of BMP stats
+     */
+    public int getType() {
+        return value;
+    }
+
+    private static Map<Integer, StatsType> parser = new ConcurrentHashMap<>();
+
+    static {
+        Arrays.stream(StatsType.values()).forEach(v -> parser.put(v.value, v));
+    }
+
+    public static StatsType getType(int type) throws DeserializationException {
+        if (type > 2) {
+            throw new DeserializationException("Invalid bmp stats message type");
+        }
+        return Optional.of(type)
+                .filter(id -> parser.containsKey(id))
+                .map(id -> parser.get(id))
+                .orElse(AS_PATH);
+    }
+}
diff --git a/apps/bgpmonitoring/api/src/main/java/org/onosproject/bgpmonitoring/TerminationType.java b/apps/bgpmonitoring/api/src/main/java/org/onosproject/bgpmonitoring/TerminationType.java
new file mode 100644
index 0000000..82fd340
--- /dev/null
+++ b/apps/bgpmonitoring/api/src/main/java/org/onosproject/bgpmonitoring/TerminationType.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2024-present Open Networking Foundation
+ *
+ * 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.bgpmonitoring;
+
+import org.onlab.packet.DeserializationException;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Enum to Provide the Different types of BMP termination message.
+ */
+public enum TerminationType {
+
+    UTF8_STRING(0),
+
+    REASON(1);
+
+    private final int value;
+
+    /**
+     * Assign value with the value val as the types of BMP termination message.
+     *
+     * @param val type of BMP termination message
+     */
+    TerminationType(int val) {
+        value = val;
+    }
+
+    /**
+     * Returns value as type of BMP termination message.
+     *
+     * @return value type of BMP termination message
+     */
+    public int getType() {
+        return value;
+    }
+
+
+    private static Map<Integer, TerminationType> parser = new ConcurrentHashMap<>();
+
+    static {
+        Arrays.stream(TerminationType.values()).forEach(v -> parser.put(v.value, v));
+    }
+
+    public static TerminationType getType(int type) throws DeserializationException {
+        if (type > 2) {
+            throw new DeserializationException("Invalid bmp termination message type");
+        }
+        return Optional.of(type)
+                .filter(id -> parser.containsKey(id))
+                .map(id -> parser.get(id))
+                .orElse(REASON);
+    }
+
+}
