diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/upf/UpfDevice.java b/core/api/src/main/java/org/onosproject/net/behaviour/upf/UpfDevice.java
index ebb9f68..dd7528e 100644
--- a/core/api/src/main/java/org/onosproject/net/behaviour/upf/UpfDevice.java
+++ b/core/api/src/main/java/org/onosproject/net/behaviour/upf/UpfDevice.java
@@ -17,7 +17,6 @@
 package org.onosproject.net.behaviour.upf;
 
 import com.google.common.annotations.Beta;
-import org.onlab.packet.Ip4Address;
 
 import java.nio.ByteBuffer;
 import java.util.Collection;
@@ -151,7 +150,7 @@
 
     /**
      * Read the counter contents for all cell indices that are valid on the hardware switch.
-     * @code maxCounterId} parameter is used to limit the number of counters
+     * {@code maxCounterId} parameter is used to limit the number of counters
      * retrieved from the UPF device. If the limit given is larger than the
      * physical limit, the physical limit will be used. A limit of -1 removes
      * limitations.
@@ -163,34 +162,6 @@
     Collection<PdrStats> readAllCounters(long maxCounterId) throws UpfProgrammableException;
 
     /**
-     * Set the source and destination of the GTPU tunnel used to send packets to a dbuf buffering
-     * device.
-     *
-     * @param switchAddr the address on the switch that sends and receives packets to and from dbuf
-     * @param dbufAddr   the dataplane address of dbuf
-     */
-    void setDbufTunnel(Ip4Address switchAddr, Ip4Address dbufAddr);
-
-    /**
-     * Removes the dbuf tunnel info if they were previously set using {@link
-     * #setDbufTunnel(Ip4Address, Ip4Address)}.
-     */
-    void unsetDbufTunnel();
-
-    /**
-     * Install a BufferDrainer reference that can be used to trigger the draining of a specific dbuf
-     * buffer back into the UPF device.
-     *
-     * @param drainer the BufferDrainer reference
-     */
-    void setBufferDrainer(UpfProgrammable.BufferDrainer drainer);
-
-    /**
-     * Removes the buffer drainer if one was set using {@link #setBufferDrainer(UpfProgrammable.BufferDrainer)}.
-     */
-    void unsetBufferDrainer();
-
-    /**
      * Instructs the UPF-programmable device to use GTP-U extension PDU Session Container (PSC) when
      * doing encap of downlink packets, with the given QoS Flow Identifier (QFI).
      *
@@ -213,7 +184,7 @@
     /**
      * Sends the given data as a data plane packet-out through this device. Data is expected to
      * contain an Ethernet frame.
-     *
+     * <p>
      * The device should process the packet through the pipeline tables to select an output port
      * and to apply eventual modifications (e.g., MAC rewrite for routing, pushing a VLAN tag,
      * etc.).
@@ -221,18 +192,4 @@
      * @param data Ethernet frame bytes
      */
     void sendPacketOut(ByteBuffer data);
-
-    /**
-     * Used by the UpfProgrammable to trigger buffer draining as needed. Install an instance using
-     * {@link UpfProgrammable#setBufferDrainer(UpfProgrammable.BufferDrainer)}
-     */
-    //TODO: remove from UpfDevice
-    interface BufferDrainer {
-        /**
-         * Drain the buffer that contains packets for the UE with the given address.
-         *
-         * @param ueAddr the address of the UE for which we should drain a buffer
-         */
-        void drain(Ip4Address ueAddr);
-    }
 }
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/upf/UpfProgrammable.java b/core/api/src/main/java/org/onosproject/net/behaviour/upf/UpfProgrammable.java
index 6dcce30..5c98f09 100644
--- a/core/api/src/main/java/org/onosproject/net/behaviour/upf/UpfProgrammable.java
+++ b/core/api/src/main/java/org/onosproject/net/behaviour/upf/UpfProgrammable.java
@@ -19,7 +19,6 @@
 import com.google.common.annotations.Beta;
 import org.onosproject.net.driver.HandlerBehaviour;
 
-
 /**
  * Provides means to update the device forwarding state to implement a 3GPP
  * User Plane Function. An implementation of this API should not write state
diff --git a/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/DistributedFabricUpfStore.java b/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/DistributedFabricUpfStore.java
index 1f40f3b..02923c2 100644
--- a/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/DistributedFabricUpfStore.java
+++ b/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/DistributedFabricUpfStore.java
@@ -19,13 +19,10 @@
 import com.google.common.collect.BiMap;
 import com.google.common.collect.ImmutableBiMap;
 import com.google.common.collect.Maps;
-import org.onlab.packet.Ip4Address;
 import org.onlab.util.ImmutableByteSequence;
 import org.onlab.util.KryoNamespace;
-import org.onosproject.net.behaviour.upf.PacketDetectionRule;
 import org.onosproject.store.serializers.KryoNamespaces;
 import org.onosproject.store.service.ConsistentMap;
-import org.onosproject.store.service.DistributedSet;
 import org.onosproject.store.service.MapEvent;
 import org.onosproject.store.service.MapEventListener;
 import org.onosproject.store.service.Serializer;
@@ -38,12 +35,8 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
-
-import static com.google.common.base.Preconditions.checkNotNull;
 
 /**
  * Distributed implementation of FabricUpfStore.
@@ -58,8 +51,6 @@
     protected StorageService storageService;
 
     protected static final String FAR_ID_MAP_NAME = "fabric-upf-far-id";
-    protected static final String BUFFER_FAR_ID_SET_NAME = "fabric-upf-buffer-far-id";
-    protected static final String FAR_ID_UE_MAP_NAME = "fabric-upf-far-id-ue";
     protected static final KryoNamespace.Builder SERIALIZER = KryoNamespace.newBuilder()
             .register(KryoNamespaces.API)
             .register(UpfRuleIdentifier.class);
@@ -83,9 +74,6 @@
     protected Map<Integer, UpfRuleIdentifier> reverseFarIdMap;
     private int nextGlobalFarId = 1;
 
-    protected DistributedSet<UpfRuleIdentifier> bufferFarIds;
-    protected ConsistentMap<UpfRuleIdentifier, Set<Ip4Address>> farIdToUeAddrs;
-
     @Activate
     protected void activate() {
         // Allow unit test to inject farIdMap here.
@@ -95,17 +83,6 @@
                     .withRelaxedReadConsistency()
                     .withSerializer(Serializer.using(SERIALIZER.build()))
                     .build();
-            this.bufferFarIds = storageService.<UpfRuleIdentifier>setBuilder()
-                    .withName(BUFFER_FAR_ID_SET_NAME)
-                    .withRelaxedReadConsistency()
-                    .withSerializer(Serializer.using(SERIALIZER.build()))
-                    .build().asDistributedSet();
-            this.farIdToUeAddrs = storageService.<UpfRuleIdentifier, Set<Ip4Address>>consistentMapBuilder()
-                    .withName(FAR_ID_UE_MAP_NAME)
-                    .withRelaxedReadConsistency()
-                    .withSerializer(Serializer.using(SERIALIZER.build()))
-                    .build();
-
         }
         farIdMapListener = new FarIdMapListener();
         farIdMap.addListener(farIdMapListener);
@@ -129,8 +106,6 @@
     public void reset() {
         farIdMap.clear();
         reverseFarIdMap.clear();
-        bufferFarIds.clear();
-        farIdToUeAddrs.clear();
         nextGlobalFarId = 0;
     }
 
@@ -171,59 +146,6 @@
         return reverseFarIdMap.get(globalFarId);
     }
 
-    public void learnFarIdToUeAddrs(PacketDetectionRule pdr) {
-        UpfRuleIdentifier ruleId = UpfRuleIdentifier.of(pdr.sessionId(), pdr.farId());
-        farIdToUeAddrs.compute(ruleId, (k, set) -> {
-            if (set == null) {
-                set = new HashSet<>();
-            }
-            set.add(pdr.ueAddress());
-            return set;
-        });
-    }
-
-    @Override
-    public boolean isFarIdBuffering(UpfRuleIdentifier farId) {
-        checkNotNull(farId);
-        return bufferFarIds.contains(farId);
-    }
-
-    @Override
-    public void learBufferingFarId(UpfRuleIdentifier farId) {
-        checkNotNull(farId);
-        bufferFarIds.add(farId);
-    }
-
-    @Override
-    public void forgetBufferingFarId(UpfRuleIdentifier farId) {
-        checkNotNull(farId);
-        bufferFarIds.remove(farId);
-    }
-
-    @Override
-    public void forgetUeAddr(Ip4Address ueAddr) {
-        farIdToUeAddrs.keySet().forEach(
-                farId -> farIdToUeAddrs.computeIfPresent(farId, (farIdz, ueAddrs) -> {
-                    ueAddrs.remove(ueAddr);
-                    return ueAddrs;
-                }));
-    }
-
-    @Override
-    public Set<Ip4Address> ueAddrsOfFarId(UpfRuleIdentifier farId) {
-        return farIdToUeAddrs.getOrDefault(farId, Set.of()).value();
-    }
-
-    @Override
-    public Set<UpfRuleIdentifier> getBufferFarIds() {
-        return Set.copyOf(bufferFarIds);
-    }
-
-    @Override
-    public Map<UpfRuleIdentifier, Set<Ip4Address>> getFarIdToUeAddrs() {
-        return Map.copyOf(farIdToUeAddrs.asJavaMap());
-    }
-
     // NOTE: FarIdMapListener is run on the same thread intentionally in order to ensure that
     //       reverseFarIdMap update always finishes right after farIdMap is updated
     private class FarIdMapListener implements MapEventListener<UpfRuleIdentifier, Integer> {
diff --git a/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/FabricUpfProgrammable.java b/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/FabricUpfProgrammable.java
index 77ad732..61345c4 100644
--- a/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/FabricUpfProgrammable.java
+++ b/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/FabricUpfProgrammable.java
@@ -18,14 +18,12 @@
 
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Maps;
-import org.onlab.packet.Ip4Address;
 import org.onlab.packet.Ip4Prefix;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
 import org.onosproject.drivers.p4runtime.AbstractP4RuntimeHandlerBehaviour;
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.behaviour.upf.ForwardingActionRule;
-import org.onosproject.net.behaviour.upf.GtpTunnel;
 import org.onosproject.net.behaviour.upf.PacketDetectionRule;
 import org.onosproject.net.behaviour.upf.PdrStats;
 import org.onosproject.net.behaviour.upf.UpfInterface;
@@ -99,15 +97,6 @@
 
     private ApplicationId appId;
 
-    // FIXME: remove, buffer drain should be triggered by Up4Service
-    private BufferDrainer bufferDrainer;
-
-    // FIXME: dbuf tunnel should be managed by Up4Service
-    //  Up4Service should be responsible of setting up such tunnel, then transforming FARs for this
-    //  device accordingly. When the tunnel endpoint change, it should be up to Up4Service to update
-    //  the FAR on the device.
-    private GtpTunnel dbufTunnel;
-
     @Override
     protected boolean setupBehaviour(String opName) {
         if (!super.setupBehaviour(opName)) {
@@ -201,22 +190,6 @@
     }
 
     @Override
-    public void setBufferDrainer(BufferDrainer drainer) {
-        if (!setupBehaviour("setBufferDrainer()")) {
-            return;
-        }
-        this.bufferDrainer = drainer;
-    }
-
-    @Override
-    public void unsetBufferDrainer() {
-        if (!setupBehaviour("unsetBufferDrainer()")) {
-            return;
-        }
-        this.bufferDrainer = null;
-    }
-
-    @Override
     public void enablePscEncap(int defaultQfi) throws UpfProgrammableException {
         throw new UpfProgrammableException("PSC encap is not supported in fabric-v1model",
                                            UNSUPPORTED_OPERATION);
@@ -244,46 +217,6 @@
     }
 
     @Override
-    public void setDbufTunnel(Ip4Address switchAddr, Ip4Address dbufAddr) {
-        if (!setupBehaviour("setDbufTunnel()")) {
-            return;
-        }
-        this.dbufTunnel = GtpTunnel.builder()
-                .setSrc(switchAddr)
-                .setDst(dbufAddr)
-                .setSrcPort((short) 2152)
-                .setTeid(0)
-                .build();
-    }
-
-    @Override
-    public void unsetDbufTunnel() {
-        if (!setupBehaviour("unsetDbufTunnel()")) {
-            return;
-        }
-        this.dbufTunnel = null;
-    }
-
-    /**
-     * Convert the given buffering FAR to a FAR that tunnels the packet to dbuf.
-     *
-     * @param far the FAR to convert
-     * @return the converted FAR
-     */
-    private ForwardingActionRule convertToDbufFar(ForwardingActionRule far) {
-        if (!far.buffers()) {
-            throw new IllegalArgumentException("Converting a non-buffering FAR to a dbuf FAR! This shouldn't happen.");
-        }
-        return ForwardingActionRule.builder()
-                .setFarId(far.farId())
-                .withSessionId(far.sessionId())
-                .setNotifyFlag(far.notifies())
-                .setBufferFlag(true)
-                .setTunnel(dbufTunnel)
-                .build();
-    }
-
-    @Override
     public void cleanUp() {
         if (!setupBehaviour("cleanUp()")) {
             return;
@@ -475,11 +408,6 @@
         log.info("Installing {}", pdr.toString());
         flowRuleService.applyFlowRules(fabricPdr);
         log.debug("PDR added with flowID {}", fabricPdr.id().value());
-
-        // If the flow rule was applied and the PDR is downlink, add the PDR to the farID->PDR mapping
-        if (pdr.matchesUnencapped()) {
-            fabricUpfStore.learnFarIdToUeAddrs(pdr);
-        }
     }
 
 
@@ -488,28 +416,10 @@
         if (!setupBehaviour("addFar()")) {
             return;
         }
-        UpfRuleIdentifier ruleId = UpfRuleIdentifier.of(far.sessionId(), far.farId());
-        if (far.buffers()) {
-            // If the far has the buffer flag, modify its tunnel so it directs to dbuf
-            far = convertToDbufFar(far);
-            fabricUpfStore.learBufferingFarId(ruleId);
-        }
         FlowRule fabricFar = upfTranslator.farToFabricEntry(far, deviceId, appId, DEFAULT_PRIORITY);
         log.info("Installing {}", far.toString());
         flowRuleService.applyFlowRules(fabricFar);
         log.debug("FAR added with flowID {}", fabricFar.id().value());
-        if (!far.buffers() && fabricUpfStore.isFarIdBuffering(ruleId)) {
-            // If this FAR does not buffer but used to, then drain the buffer for every UE address
-            // that hits this FAR.
-            fabricUpfStore.forgetBufferingFarId(ruleId);
-            for (var ueAddr : fabricUpfStore.ueAddrsOfFarId(ruleId)) {
-                if (bufferDrainer == null) {
-                    log.warn("Unable to drain downlink buffer for UE {}, bufferDrainer is null", ueAddr);
-                } else {
-                    bufferDrainer.drain(ueAddr);
-                }
-            }
-        }
     }
 
     @Override
@@ -620,13 +530,6 @@
         }
         log.info("Removing {}", pdr.toString());
         removeEntry(match, tableId, false);
-
-        // Remove the PDR from the farID->PDR mapping
-        // This is an inefficient hotfix FIXME: remove UE addrs from the mapping in sublinear time
-        if (pdr.matchesUnencapped()) {
-            // Should we remove just from the map entry with key == far ID?
-            fabricUpfStore.forgetUeAddr(pdr.ueAddress());
-        }
     }
 
     @Override
diff --git a/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/FabricUpfStore.java b/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/FabricUpfStore.java
index 786ef3c..9b5d853 100644
--- a/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/FabricUpfStore.java
+++ b/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/FabricUpfStore.java
@@ -16,12 +16,9 @@
 
 package org.onosproject.pipelines.fabric.impl.behaviour.upf;
 
-import org.onlab.packet.Ip4Address;
 import org.onlab.util.ImmutableByteSequence;
-import org.onosproject.net.behaviour.upf.PacketDetectionRule;
 
 import java.util.Map;
-import java.util.Set;
 
 /**
  * Stores state required for translation of UPF entities to pipeline-specific ones.
@@ -80,62 +77,6 @@
      *
      * @param queueId Tofino queue Id
      * @return the corresponding scheduling priroity
-    */
+     */
     String schedulingPriorityOf(int queueId);
-
-    /**
-     * Stores the mapping between FAR ID and UE address as defined by the given PDR.
-     *
-     * @param pdr PDR
-     */
-    void learnFarIdToUeAddrs(PacketDetectionRule pdr);
-
-    /**
-     * Returns true if the given FAR IDs is known to be a buffering one.
-     *
-     * @param farId FAR ID
-     * @return boolean
-     */
-    boolean isFarIdBuffering(UpfRuleIdentifier farId);
-
-    /**
-     * Learns the given FAR ID as being a buffering one.
-     *
-     * @param farId FAR ID
-     */
-    void learBufferingFarId(UpfRuleIdentifier farId);
-
-    /**
-     * Forgets the given FAR ID as being a buffering one.
-     *
-     * @param farId FAR ID
-     */
-    void forgetBufferingFarId(UpfRuleIdentifier farId);
-
-    /**
-     * Returns the set of UE addresses associated with the given FAR ID.
-     *
-     * @param farId FAR ID
-     * @return Set of Ip4Address
-     */
-    Set<Ip4Address> ueAddrsOfFarId(UpfRuleIdentifier farId);
-
-    /**
-     * Removes the given UE address from the FAR ID to UE address map.
-     * @param ueAddr UE address
-     */
-    void forgetUeAddr(Ip4Address ueAddr);
-
-    /**
-     * Returns the set of known buffering FAR IDs.
-     * @return set
-     */
-    Set<UpfRuleIdentifier> getBufferFarIds();
-
-    /**
-     * Returns the FAR ID to UE addresses map.
-     *
-     * @return map
-     */
-    Map<UpfRuleIdentifier, Set<Ip4Address>> getFarIdToUeAddrs();
 }
diff --git a/pipelines/fabric/impl/src/test/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/TestDistributedFabricUpfStore.java b/pipelines/fabric/impl/src/test/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/TestDistributedFabricUpfStore.java
index 8500b9a..cf09c02 100644
--- a/pipelines/fabric/impl/src/test/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/TestDistributedFabricUpfStore.java
+++ b/pipelines/fabric/impl/src/test/java/org/onosproject/pipelines/fabric/impl/behaviour/upf/TestDistributedFabricUpfStore.java
@@ -16,16 +16,10 @@
 
 package org.onosproject.pipelines.fabric.impl.behaviour.upf;
 
-import org.onlab.packet.Ip4Address;
 import org.onosproject.store.service.Serializer;
 import org.onosproject.store.service.TestConsistentMap;
-import org.onosproject.store.service.TestDistributedSet;
 
-import java.util.Set;
-
-import static org.onosproject.pipelines.fabric.impl.behaviour.upf.DistributedFabricUpfStore.BUFFER_FAR_ID_SET_NAME;
 import static org.onosproject.pipelines.fabric.impl.behaviour.upf.DistributedFabricUpfStore.FAR_ID_MAP_NAME;
-import static org.onosproject.pipelines.fabric.impl.behaviour.upf.DistributedFabricUpfStore.FAR_ID_UE_MAP_NAME;
 import static org.onosproject.pipelines.fabric.impl.behaviour.upf.DistributedFabricUpfStore.SERIALIZER;
 
 
@@ -43,22 +37,6 @@
                 .withSerializer(Serializer.using(SERIALIZER.build()));
         store.farIdMap = farIdMapBuilder.build();
 
-        TestDistributedSet.Builder<UpfRuleIdentifier> bufferFarIdsBuilder =
-                TestDistributedSet.builder();
-        bufferFarIdsBuilder
-                .withName(BUFFER_FAR_ID_SET_NAME)
-                .withRelaxedReadConsistency()
-                .withSerializer(Serializer.using(SERIALIZER.build()));
-        store.bufferFarIds = bufferFarIdsBuilder.build().asDistributedSet();
-
-        TestConsistentMap.Builder<UpfRuleIdentifier, Set<Ip4Address>> farIdToUeAddrsBuilder =
-                TestConsistentMap.builder();
-        farIdToUeAddrsBuilder
-                .withName(FAR_ID_UE_MAP_NAME)
-                .withRelaxedReadConsistency()
-                .withSerializer(Serializer.using(SERIALIZER.build()));
-        store.farIdToUeAddrs = farIdToUeAddrsBuilder.build();
-
         store.activate();
 
         // Init with some translation state.
