diff --git a/apps/ipflow-monitor/sflow/api/src/main/java/org/onosproject/sflow/VlanCounter.java b/apps/ipflow-monitor/sflow/api/src/main/java/org/onosproject/sflow/VlanCounter.java
new file mode 100644
index 0000000..798a260
--- /dev/null
+++ b/apps/ipflow-monitor/sflow/api/src/main/java/org/onosproject/sflow/VlanCounter.java
@@ -0,0 +1,194 @@
+/*
+ * 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.sflow;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Represents VLAN counters for network interfaces.
+ */
+public final class VlanCounter {
+    private int vlanId;
+    private long octets;
+    private int ucastPkts;
+    private int multicastPkts;
+    private int broadcastPkts;
+    private int discards;
+
+    private VlanCounter(Builder builder) {
+        this.vlanId = builder.vlanId;
+        this.octets = builder.octets;
+        this.ucastPkts = builder.ucastPkts;
+        this.multicastPkts = builder.multicastPkts;
+        this.broadcastPkts = builder.broadcastPkts;
+        this.discards = builder.discards;
+    }
+
+
+    /**
+     * Gets the VLAN ID.
+     *
+     * @return the VLAN ID
+     */
+    public int getVlanId() {
+        return vlanId;
+    }
+
+    /**
+     * Gets the count of octets.
+     *
+     * @return the count of octets
+     */
+    public long getOctets() {
+        return octets;
+    }
+
+    /**
+     * Gets the count of unicast packets.
+     *
+     * @return the count of unicast packets
+     */
+    public int getUcastPkts() {
+        return ucastPkts;
+    }
+
+    /**
+     * Gets the count of multicast packets.
+     *
+     * @return the count of multicast packets
+     */
+    public int getMulticastPkts() {
+        return multicastPkts;
+    }
+
+    /**
+     * Gets the count of broadcast packets.
+     *
+     * @return the count of broadcast packets
+     */
+    public int getBroadcastPkts() {
+        return broadcastPkts;
+    }
+
+    /**
+     * Gets the count of discards.
+     *
+     * @return the count of discards
+     */
+    public int getDiscards() {
+        return discards;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+                .add("vlanId", vlanId)
+                .add("octets", octets)
+                .add("ucastPkts", ucastPkts)
+                .add("multicastPkts", multicastPkts)
+                .add("broadcastPkts", broadcastPkts)
+                .add("discards", discards)
+                .toString();
+    }
+
+    /**
+     * Builder pattern to create an instance of VlanCounter.
+     */
+    public static class Builder {
+        private int vlanId;
+        private long octets;
+        private int ucastPkts;
+        private int multicastPkts;
+        private int broadcastPkts;
+        private int discards;
+
+
+        /**
+         * Sets the VLAN ID.
+         *
+         * @param vlanId the VLAN ID to set
+         * @return this builder instance
+         */
+        public Builder vlanId(int vlanId) {
+            this.vlanId = vlanId;
+            return this;
+        }
+
+        /**
+         * Sets the count of octets.
+         *
+         * @param octets the count of octets to set
+         * @return this builder instance
+         */
+        public Builder octets(long octets) {
+            this.octets = octets;
+            return this;
+        }
+
+        /**
+         * Sets the count of unicast packets.
+         *
+         * @param ucastPkts the count of unicast packets
+         * @return this builder instance
+         */
+        public Builder ucastPkts(int ucastPkts) {
+            this.ucastPkts = ucastPkts;
+            return this;
+        }
+
+        /**
+         * Sets the count of multicast packets.
+         *
+         * @param multicastPkts the count of multicast packets
+         * @return this builder instance
+         */
+        public Builder multicastPkts(int multicastPkts) {
+            this.multicastPkts = multicastPkts;
+            return this;
+        }
+
+        /**
+         * Sets the count of broadcast packets.
+         *
+         * @param broadcastPkts the count of broadcast packets
+         * @return this builder instance
+         */
+        public Builder broadcastPkts(int broadcastPkts) {
+            this.broadcastPkts = broadcastPkts;
+            return this;
+        }
+
+        /**
+         * Sets the count of discards.
+         *
+         * @param discards the count of discards
+         * @return this builder instance
+         */
+        public Builder discards(int discards) {
+            this.discards = discards;
+            return this;
+        }
+
+        /**
+         * Builds an instance of VlanCounter based on the configured parameters.
+         *
+         * @return an instance of VlanCounter
+         */
+        public VlanCounter build() {
+            return new VlanCounter(this);
+        }
+    }
+}
