diff --git a/apps/ipflow-monitor/sflow/api/src/main/java/org/onosproject/sflow/InterfaceCounter.java b/apps/ipflow-monitor/sflow/api/src/main/java/org/onosproject/sflow/InterfaceCounter.java
new file mode 100644
index 0000000..c8a4651
--- /dev/null
+++ b/apps/ipflow-monitor/sflow/api/src/main/java/org/onosproject/sflow/InterfaceCounter.java
@@ -0,0 +1,546 @@
+/*
+ * 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;
+import static com.google.common.base.Preconditions.checkState;
+
+/**
+ * Represents interface counters for network interfaces.
+ */
+public final class InterfaceCounter {
+    private int ifIndex;
+    private int ifType;
+    private long ifSpeed;
+    private int ifDirection;
+    private int ifStatus;
+    private long ifInOctets;
+    private int ifInUcastPkts;
+    private int ifInMulticastPkts;
+    private int ifInBroadcastPkts;
+    private int ifInDiscards;
+    private int ifInErrors;
+    private int ifInUnknownProtos;
+    private long ifOutOctets;
+    private int ifOutUcastPkts;
+    private int ifOutMulticastPkts;
+    private int ifOutBroadcastPkts;
+    private int ifOutDiscards;
+    private int ifOutErrors;
+    private int ifPromiscuousMode;
+
+    private InterfaceCounter(Builder builder) {
+        this.ifIndex = builder.ifIndex;
+        this.ifType = builder.ifType;
+        this.ifSpeed = builder.ifSpeed;
+        this.ifDirection = builder.ifDirection;
+        this.ifStatus = builder.ifStatus;
+        this.ifInOctets = builder.ifInOctets;
+        this.ifInUcastPkts = builder.ifInUcastPkts;
+        this.ifInMulticastPkts = builder.ifInMulticastPkts;
+        this.ifInBroadcastPkts = builder.ifInBroadcastPkts;
+        this.ifInDiscards = builder.ifInDiscards;
+        this.ifInErrors = builder.ifInErrors;
+        this.ifInUnknownProtos = builder.ifInUnknownProtos;
+        this.ifOutOctets = builder.ifOutOctets;
+        this.ifOutUcastPkts = builder.ifOutUcastPkts;
+        this.ifOutMulticastPkts = builder.ifOutMulticastPkts;
+        this.ifOutBroadcastPkts = builder.ifOutBroadcastPkts;
+        this.ifOutDiscards = builder.ifOutDiscards;
+        this.ifOutErrors = builder.ifOutErrors;
+        this.ifPromiscuousMode = builder.ifPromiscuousMode;
+    }
+
+    /**
+     * Get interface index.
+     *
+     * @return interface index.
+     */
+    public long getIfIndex() {
+        return ifIndex;
+    }
+
+    /**
+     * Get interface type.
+     *
+     * @return interface type.
+     */
+    public int getIfType() {
+        return ifType;
+    }
+
+    /**
+     * Get interface speed.
+     *
+     * @return interface speed.
+     */
+    public long getIfSpeed() {
+        return ifSpeed;
+    }
+
+    /**
+     * Get interface flow direction.
+     *
+     * @return interface flow direction.
+     */
+    public int getIfDirection() {
+        return ifDirection;
+    }
+
+    /**
+     * Get interface status.
+     *
+     * @return interface status.
+     */
+    public int getIfStatus() {
+        return ifStatus;
+    }
+
+    /**
+     * Get interface ingress octets.
+     *
+     * @return interface ingress octets.
+     */
+    public long getIfInOctets() {
+        return ifInOctets;
+    }
+
+    /**
+     * Get interface ingress packets.
+     *
+     * @return interface ingress unicast packets.
+     */
+    public int getIfInUcastPkts() {
+        return ifInUcastPkts;
+    }
+
+    /**
+     * Get interface ingress multicast packets.
+     *
+     * @return interface ingress multicast packets.
+     */
+    public int getIfInMulticastPkts() {
+        return ifInMulticastPkts;
+    }
+
+    /**
+     * Get interface ingress broadcast packets.
+     *
+     * @return interface ingress broadcast packets.
+     */
+    public int getIfInBroadcastPkts() {
+        return ifInBroadcastPkts;
+    }
+
+    /**
+     * Get interface ingress discard packets.
+     *
+     * @return interface ingress discard packets.
+     */
+    public int getIfInDiscards() {
+        return ifInDiscards;
+    }
+
+    /**
+     * Get interface ingress error packets.
+     *
+     * @return interface ingress error packets.
+     */
+    public int getIfInErrors() {
+        return ifInErrors;
+    }
+
+    /**
+     * Get interface ingress unknow protocols.
+     *
+     * @return interface ingress unknow protocols.
+     */
+    public int getIfInUnknownProtos() {
+        return ifInUnknownProtos;
+    }
+
+    /**
+     * Get interface egress octets.
+     *
+     * @return interface egress octets.
+     */
+    public long getIfOutOctets() {
+        return ifOutOctets;
+    }
+
+    /**
+     * Get interface egress unicast packets.
+     *
+     * @return interface egress unicast packets.
+     */
+    public int getIfOutUcastPkts() {
+        return ifOutUcastPkts;
+    }
+
+    /**
+     * Get interface egress multicast packets.
+     *
+     * @return interface egress multicast packets.
+     */
+    public int getIfOutMulticastPkts() {
+        return ifOutMulticastPkts;
+    }
+
+    /**
+     * Get interface egress broadcast packets.
+     *
+     * @return interface egress broadcast packets.
+     */
+    public int getIfOutBroadcastPkts() {
+        return ifOutBroadcastPkts;
+    }
+
+    /**
+     * Get interface egress discard packets.
+     *
+     * @return interface egress discard packets.
+     */
+    public int getIfOutDiscards() {
+        return ifOutDiscards;
+    }
+
+    /**
+     * Get interface egress error packets.
+     *
+     * @return interface egress error packets.
+     */
+    public int getIfOutErrors() {
+        return ifOutErrors;
+    }
+
+    /**
+     * Get interface promiscuous mode.
+     *
+     * @return interface promiscuous mode.
+     */
+    public int getIfPromiscuousMode() {
+        return ifPromiscuousMode;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 3;
+        hash = 59 * hash + this.ifIndex;
+        hash = 59 * hash + this.ifType;
+        return hash;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final InterfaceCounter other = (InterfaceCounter) obj;
+        if (this.ifIndex != other.ifIndex) {
+            return false;
+        }
+        if (this.ifType != other.ifType) {
+            return false;
+        }
+        return this.ifSpeed != other.ifSpeed;
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+                .add("ifIndex", ifIndex)
+                .add("ifType", ifType)
+                .add("ifSpeed", ifSpeed)
+                .add("ifDirection", ifDirection)
+                .add("ifStatus", ifStatus)
+                .add("ifInOctets", ifInOctets)
+                .add("ifInUcastPkts", ifInUcastPkts)
+                .add("ifInMulticastPkts", ifInMulticastPkts)
+                .add("ifInBroadcastPkts", ifInBroadcastPkts)
+                .add("ifInDiscards", ifInDiscards)
+                .add("ifInErrors", ifInErrors)
+                .add("ifInUnknownProtos", ifInUnknownProtos)
+                .add("ifOutOctets", ifOutOctets)
+                .add("ifOutUcastPkts", ifOutUcastPkts)
+                .add("ifOutMulticastPkts", ifOutMulticastPkts)
+                .add("ifOutBroadcastPkts", ifOutBroadcastPkts)
+                .add("ifOutDiscards", ifOutDiscards)
+                .add("ifOutErrors", ifOutErrors)
+                .add("ifPromiscuousMode", ifPromiscuousMode)
+                .toString();
+    }
+
+    /**
+     * Builder pattern to create an instance of InterfaceCounter.
+     */
+    private static class Builder {
+
+        private int ifIndex;
+        private int ifType;
+        private long ifSpeed;
+        private int ifDirection;
+        private int ifStatus;
+        private long ifInOctets;
+        private int ifInUcastPkts;
+        private int ifInMulticastPkts;
+        private int ifInBroadcastPkts;
+        private int ifInDiscards;
+        private int ifInErrors;
+        private int ifInUnknownProtos;
+        private long ifOutOctets;
+        private int ifOutUcastPkts;
+        private int ifOutMulticastPkts;
+        private int ifOutBroadcastPkts;
+        private int ifOutDiscards;
+        private int ifOutErrors;
+        private int ifPromiscuousMode;
+
+
+        /**
+         * Sets the interface index.
+         *
+         * @param ifIndex the interface index.
+         * @return this builder instance.
+         */
+        public Builder ifIndex(int ifIndex) {
+            this.ifIndex = ifIndex;
+            return this;
+        }
+
+        /**
+         * Sets the interface type.
+         *
+         * @param ifType the interface type.
+         * @return this builder instance.
+         */
+        public Builder ifType(int ifType) {
+            this.ifType = ifType;
+            return this;
+        }
+
+        /**
+         * Sets the interface speed.
+         *
+         * @param ifSpeed the interface speed.
+         * @return this builder instance.
+         */
+        public Builder ifSpeed(long ifSpeed) {
+            this.ifSpeed = ifSpeed;
+            return this;
+        }
+
+        /**
+         * Sets interface flow direction.
+         *
+         * @param ifDirection interface flow direction.
+         * @return this builder instance.
+         */
+        public Builder ifDirection(int ifDirection) {
+            this.ifDirection = ifDirection;
+            return this;
+        }
+
+        /**
+         * Sets interface status.
+         *
+         * @param ifStatus interface status.
+         * @return this builder instance.
+         */
+        public Builder ifStatus(int ifStatus) {
+            this.ifStatus = ifStatus;
+            return this;
+        }
+
+        /**
+         * Sets the count of ingress octets.
+         *
+         * @param ifInOctets the count of ingress octets.
+         * @return this builder instance.
+         */
+        public Builder ifInOctets(long ifInOctets) {
+            this.ifInOctets = ifInOctets;
+            return this;
+        }
+
+        /**
+         * Sets the count of ingress unicast packets.
+         *
+         * @param ifInUcastPkts the count of ingress packets.
+         * @return this builder instance.
+         */
+        public Builder ifInUcastPkts(int ifInUcastPkts) {
+            this.ifInUcastPkts = ifInUcastPkts;
+            return this;
+        }
+
+        /**
+         * Sets the count of ingress multicast packets.
+         *
+         * @param ifInMulticastPkts the count of ingress multicast packets.
+         * @return this builder instance.
+         */
+        public Builder ifInMulticastPkts(int ifInMulticastPkts) {
+            this.ifInMulticastPkts = ifInMulticastPkts;
+            return this;
+        }
+
+        /**
+         * Sets the count of ingress broadcast packets.
+         *
+         * @param ifInBroadcastPkts the count of ingress broadcast packets.
+         * @return this builder instance.
+         */
+        public Builder ifInBroadcastPkts(int ifInBroadcastPkts) {
+            this.ifInBroadcastPkts = ifInBroadcastPkts;
+            return this;
+        }
+
+        /**
+         * Sets the count of ingress discards.
+         *
+         * @param ifInDiscards the count of ingress discards.
+         * @return this builder instance.
+         */
+        public Builder ifInDiscards(int ifInDiscards) {
+            this.ifInDiscards = ifInDiscards;
+            return this;
+        }
+
+        /**
+         * Sets the count of ingress errors.
+         *
+         * @param ifInErrors the count of ingress errors.
+         * @return this builder instance.
+         */
+        public Builder ifInErrors(int ifInErrors) {
+            this.ifInErrors = ifInErrors;
+            return this;
+        }
+
+        /**
+         * Sets the count of unknown protocol.
+         *
+         * @param ifInUnknownProtos the count of unknown protocol.
+         * @return this builder instance.
+         */
+        public Builder ifInUnknownProtos(int ifInUnknownProtos) {
+            this.ifInUnknownProtos = ifInUnknownProtos;
+            return this;
+        }
+
+        /**
+         * Sets the count of egress octets.
+         *
+         * @param ifOutOctets the count of egress octets.
+         * @return this builder instance.
+         */
+        public Builder ifOutOctets(long ifOutOctets) {
+            this.ifOutOctets = ifOutOctets;
+            return this;
+        }
+
+        /**
+         * Sets the count of egress unicast packets.
+         *
+         * @param ifOutUcastPkts the count of egress packets.
+         * @return this builder instance.
+         */
+        public Builder ifOutUcastPkts(int ifOutUcastPkts) {
+            this.ifOutUcastPkts = ifOutUcastPkts;
+            return this;
+        }
+
+        /**
+         * Sets the count of egress multicast packets.
+         *
+         * @param ifOutMulticastPkts the count of egress multicast packets.
+         * @return this builder instance.
+         */
+        public Builder ifOutMulticastPkts(int ifOutMulticastPkts) {
+            this.ifOutMulticastPkts = ifOutMulticastPkts;
+            return this;
+        }
+
+        /**
+         * Sets the count of egress broadcast packets.
+         *
+         * @param ifOutBroadcastPkts the count of egress broadcast packets.
+         * @return this builder instance.
+         */
+        public Builder ifOutBroadcastPkts(int ifOutBroadcastPkts) {
+            this.ifOutBroadcastPkts = ifOutBroadcastPkts;
+            return this;
+        }
+
+        /**
+         * Sets the count of egress discards.
+         *
+         * @param ifOutDiscards the count of egress discards.
+         * @return this builder instance.
+         */
+        public Builder ifOutDiscards(int ifOutDiscards) {
+            this.ifOutDiscards = ifOutDiscards;
+            return this;
+        }
+
+        /**
+         * Sets the count of egress errors.
+         *
+         * @param ifOutErrors the count of egress errors.
+         * @return this builder instance.
+         */
+        public Builder ifOutErrors(int ifOutErrors) {
+            this.ifOutErrors = ifOutErrors;
+            return this;
+        }
+
+        /**
+         * Sets the interface promiscuous mode.
+         *
+         * @param ifPromiscuousMode the interface promiscuous mode.
+         * @return this builder instance.
+         */
+        public Builder ifPromiscuousMode(int ifPromiscuousMode) {
+            this.ifPromiscuousMode = ifPromiscuousMode;
+            return this;
+        }
+
+        /**
+         * Checks arguments for sFlow sample flow.
+         */
+        private void checkArguments() {
+            checkState(ifIndex != 0, "Invalid interface index.");
+            checkState(ifType != 0, "Invalid interface type.");
+            checkState(ifSpeed != 0, "Invalid interface speed.");
+        }
+
+        /**
+         * Builds an instance of InterfaceCounter based on the configured parameters.
+         *
+         * @return an instance of InterfaceCounter.
+         */
+        public InterfaceCounter build() {
+            checkArguments();
+            return new InterfaceCounter(this);
+        }
+    }
+}
