diff --git a/app.xml b/app.xml
index 586cbd8..b96cdac 100644
--- a/app.xml
+++ b/app.xml
@@ -24,5 +24,6 @@
     <artifact>mvn:${project.groupId}/dhcpl2relay-api/${dhcpl2relay.api.version}</artifact>
     <artifact>mvn:${project.groupId}/olt-api/${olt.api.version}</artifact>
     <artifact>mvn:${project.groupId}/sadis-api/${sadis.api.version}</artifact>
+    <artifact>mvn:${project.groupId}/bng-api/${bng.api.version}</artifact>
     <artifact>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.kafka-clients/1.1.1_1</artifact>
 </app>
diff --git a/features.xml b/features.xml
index 70492f0..0cc601f 100644
--- a/features.xml
+++ b/features.xml
@@ -23,6 +23,7 @@
         <bundle>mvn:${project.groupId}/dhcpl2relay-api/${dhcpl2relay.api.version}</bundle>
         <bundle>mvn:${project.groupId}/olt-api/${olt.api.version}</bundle>
         <bundle>mvn:${project.groupId}/sadis-api/${sadis.api.version}</bundle>
+        <bundle>mvn:${project.groupId}/bng-api/${bng.api.version}</bundle>
         <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.kafka-clients/1.1.1_1</bundle>
     </feature>
 </features>
diff --git a/pom.xml b/pom.xml
index 99798f7..6607425 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,6 +40,7 @@
         <aaa.api.version>2.0.0</aaa.api.version>
         <olt.api.version>4.0.0</olt.api.version>
         <dhcpl2relay.api.version>2.0.0</dhcpl2relay.api.version>
+        <bng.api.version>1.0-SNAPSHOT</bng.api.version>
         <sadis.api.version>4.0.1</sadis.api.version>
     </properties>
 
@@ -91,6 +92,13 @@
             <scope>provided</scope>
         </dependency>
 
+        <dependency>
+            <groupId>org.opencord</groupId>
+            <artifactId>bng-api</artifactId>
+            <version>${bng.api.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
     </dependencies>
 
     <build>
diff --git a/src/main/java/org/opencord/kafka/integrations/BngPppoeKafkaIntegration.java b/src/main/java/org/opencord/kafka/integrations/BngPppoeKafkaIntegration.java
new file mode 100644
index 0000000..ea91c8d
--- /dev/null
+++ b/src/main/java/org/opencord/kafka/integrations/BngPppoeKafkaIntegration.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2019-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.opencord.kafka.integrations;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.opencord.bng.PppoeBngControlHandler;
+import org.opencord.bng.PppoeEvent;
+import org.opencord.bng.PppoeEventListener;
+import org.opencord.kafka.EventBusService;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
+
+import java.time.Instant;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * Listens for PPPoE handler events from the BNG app and pushes them on a Kafka
+ * bus.
+ */
+@Component(immediate = true)
+public class BngPppoeKafkaIntegration extends AbstractKafkaIntegration {
+
+    private static final String TOPIC_PPPOE = "bng.pppoe";
+    private static final String TIMESTAMP = "timestamp";
+    private static final String EVENT_TYPE = "eventType";
+    private static final String OLT_DEVICE_ID = "deviceId";
+    private static final String OLT_PORT_NUMBER = "portNumber";
+    private static final String MAC_ADDRESS = "macAddress";
+    private static final String IP_ADDRESS = "ipAddress";
+    private static final String SERIAL_NUMBER = "serialNumber";
+    private static final String SESSION_ID = "sessionId";
+
+    private final PppoeEventListener pppoeEventListener = new InternalPppoeListener();
+
+    private final AtomicReference<PppoeBngControlHandler> pppoeBngControlRef = new AtomicReference<>();
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY)
+    protected EventBusService eventBusService;
+
+    @Reference(cardinality = ReferenceCardinality.OPTIONAL,
+            policy = ReferencePolicy.DYNAMIC,
+            bind = "bindPppoeBngControl",
+            unbind = "unbindPppoeBngControl")
+    protected volatile PppoeBngControlHandler pppoeBngControlHandler;
+
+    protected void bindPppoeBngControl(PppoeBngControlHandler incomingService) {
+        bindAndAddListener(incomingService, pppoeBngControlRef, pppoeEventListener);
+    }
+
+    protected void unbindPppoeBngControl(PppoeBngControlHandler outgoingService) {
+        unbindAndRemoveListener(outgoingService, pppoeBngControlRef, pppoeEventListener);
+    }
+
+    @Activate
+    public void activate() {
+        log.info("Started PppoeKafkaIntegration");
+    }
+
+    @Deactivate
+    public void deactivate() {
+        unbindPppoeBngControl(pppoeBngControlRef.get());
+        log.info("Stopped PppoeKafkaIntegration");
+    }
+
+    private JsonNode serializePppoeEvent(PppoeEvent event) {
+        // Serialize PPPoE event in a JSON node
+        ObjectMapper mapper = new ObjectMapper();
+        ObjectNode pppoeEvent = mapper.createObjectNode();
+        pppoeEvent.put(TIMESTAMP, Instant.now().toString());
+        pppoeEvent.put(EVENT_TYPE, event.type().toString());
+        pppoeEvent.put(OLT_DEVICE_ID, event.subject().getOltConnectPoint().deviceId().toString());
+        pppoeEvent.put(OLT_PORT_NUMBER, event.subject().getOltConnectPoint().port().toString());
+        pppoeEvent.put(MAC_ADDRESS, event.subject().getMacAddress().toString());
+        pppoeEvent.put(IP_ADDRESS, event.subject().getIpAddress().toString());
+        pppoeEvent.put(SERIAL_NUMBER, event.subject().getOnuSerialNumber());
+        pppoeEvent.put(SESSION_ID, event.subject().getSessionId() == 0 ?
+                "" : String.valueOf(event.subject().getSessionId()));
+        return pppoeEvent;
+    }
+
+    private class InternalPppoeListener implements PppoeEventListener {
+
+        @Override
+        public void event(PppoeEvent event) {
+            eventBusService.send(TOPIC_PPPOE, serializePppoeEvent(event));
+        }
+    }
+}
diff --git a/src/main/java/org/opencord/kafka/integrations/BngStatsKafkaIntegration.java b/src/main/java/org/opencord/kafka/integrations/BngStatsKafkaIntegration.java
new file mode 100644
index 0000000..e7cffd8
--- /dev/null
+++ b/src/main/java/org/opencord/kafka/integrations/BngStatsKafkaIntegration.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2019-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.opencord.kafka.integrations;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.collect.ImmutableMap;
+import org.apache.commons.lang3.tuple.Pair;
+import org.onosproject.net.behaviour.BngProgrammable;
+import org.onosproject.net.pi.runtime.PiCounterCellData;
+import org.opencord.bng.BngStatsEvent;
+import org.opencord.bng.BngStatsEventListener;
+import org.opencord.bng.BngStatsEventSubject;
+import org.opencord.bng.BngStatsService;
+import org.opencord.kafka.EventBusService;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
+
+import java.time.Instant;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
+
+/**
+ * Listens for statistic events from the BNG app and pushes them on a Kafka
+ * bus.
+ */
+@Component(immediate = true)
+public class BngStatsKafkaIntegration extends AbstractKafkaIntegration {
+
+    private static final String TOPIC_STATS = "bng.stats";
+    private static final String SUBSCRIBER_S_TAG = "sTag";
+    private static final String SUBSCRIBER_C_TAG = "cTag";
+
+    private static final String UP_TX_BYTES = "upTermBytes";
+    private static final String UP_TX_PACKETS = "upTermPackets";
+
+    private static final String UP_RX_BYTES = "upRxBytes";
+    private static final String UP_RX_PACKETS = "upRxPackets";
+
+    private static final String UP_DROP_BYTES = "upDropBytes";
+    private static final String UP_DROP_PACKETS = "upDropPackets";
+
+    private static final String DOWN_RX_BYTES = "downRxBytes";
+    private static final String DOWN_RX_PACKETS = "downRxPackets";
+
+    private static final String DOWN_TX_BYTES = "downTxBytes";
+    private static final String DOWN_TX_PACKETS = "downTxPackets";
+
+    private static final String DOWN_DROP_BYTES = "downDropBytes";
+    private static final String DOWN_DROP_PACKETS = "downDropPackets";
+
+    private static final String CONTROL_PACKETS = "controlPackets";
+
+    private static final ImmutableMap<BngProgrammable.BngCounterType, Pair<String, String>> MAP_COUNTERS =
+            ImmutableMap.<BngProgrammable.BngCounterType, Pair<String, String>>builder()
+                    .put(BngProgrammable.BngCounterType.UPSTREAM_RX, Pair.of(UP_RX_BYTES, UP_RX_PACKETS))
+                    .put(BngProgrammable.BngCounterType.UPSTREAM_TX, Pair.of(UP_TX_BYTES, UP_TX_PACKETS))
+                    .put(BngProgrammable.BngCounterType.UPSTREAM_DROPPED, Pair.of(UP_DROP_BYTES, UP_DROP_PACKETS))
+
+                    .put(BngProgrammable.BngCounterType.DOWNSTREAM_RX, Pair.of(DOWN_RX_BYTES, DOWN_RX_PACKETS))
+                    .put(BngProgrammable.BngCounterType.DOWNSTREAM_TX, Pair.of(DOWN_TX_BYTES, DOWN_TX_PACKETS))
+                    .put(BngProgrammable.BngCounterType.DOWNSTREAM_DROPPED, Pair.of(DOWN_DROP_BYTES, DOWN_DROP_PACKETS))
+                    .build();
+
+    private static final String TIMESTAMP = "timestamp";
+    private static final String ATTACHMENT_TYPE = "attachmentType";
+    private static final String DEVICE_ID = "deviceId";
+    private static final String PORT_NUMBER = "portNumber";
+    private static final String MAC_ADDRESS = "macAddress";
+    private static final String IP_ADDRESS = "ipAddress";
+    private static final String ONU_SERIAL_NUMBER = "onuSerialNumber";
+    private static final String PPPOE_SESSION_ID = "pppoeSessionId";
+
+    private final BngStatsEventListener statsListener = new InternalStatsListener();
+
+    private final AtomicReference<BngStatsService> bngStatsServiceRef = new AtomicReference<>();
+
+    @Reference(cardinality = ReferenceCardinality.OPTIONAL,
+            policy = ReferencePolicy.DYNAMIC,
+            bind = "bindBngStatsService",
+            unbind = "unbindBngStatsService")
+    protected volatile BngStatsService bngStatsService;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY)
+    protected EventBusService eventBusService;
+
+
+    protected void bindBngStatsService(BngStatsService incomingService) {
+        bindAndAddListener(incomingService, bngStatsServiceRef, statsListener);
+    }
+
+    protected void unbindBngStatsService(BngStatsService outgoingService) {
+        unbindAndRemoveListener(outgoingService, bngStatsServiceRef, statsListener);
+    }
+
+    @Activate
+    public void activate() {
+        log.info("Started BngKafkaIntegration");
+    }
+
+    @Deactivate
+    public void deactivate() {
+        unbindBngStatsService(bngStatsServiceRef.get());
+        log.info("Stopped BngKafkaIntegration");
+    }
+
+    private JsonNode serializeBngStatsEvent(BngStatsEventSubject eventSubject) {
+        // Serialize stats in a JSON node
+        ObjectMapper mapper = new ObjectMapper();
+        ObjectNode attStatsNode = mapper.createObjectNode();
+
+        // Exposing statistics only for PPPoE attachment
+        var attachmentStats = eventSubject.getAttachmentStats();
+        var attachment = eventSubject.getBngAttachment();
+
+        attStatsNode.put(MAC_ADDRESS, attachment.macAddress().toString());
+        attStatsNode.put(IP_ADDRESS, attachment.ipAddress().toString());
+        attStatsNode.put(PPPOE_SESSION_ID, attachment.pppoeSessionId());
+
+        attStatsNode.put(SUBSCRIBER_S_TAG, attachment.sTag().toShort());
+        attStatsNode.put(SUBSCRIBER_C_TAG, attachment.cTag().toShort());
+
+        attStatsNode.put(ONU_SERIAL_NUMBER, attachment.onuSerial());
+        attStatsNode.put(ATTACHMENT_TYPE, attachment.type().toString());
+
+        attStatsNode.put(DEVICE_ID, attachment.oltConnectPoint().deviceId().toString());
+        attStatsNode.put(PORT_NUMBER, attachment.oltConnectPoint().port().toString());
+
+        // Add the statistics to the JSON
+        attStatsNode = createNodesStats(attachmentStats, attStatsNode);
+
+        // Control stats are different, only packets statistics
+        attStatsNode.put(CONTROL_PACKETS,
+                attachmentStats.get(BngProgrammable.BngCounterType.CONTROL_PLANE).packets());
+
+        attStatsNode.put(TIMESTAMP, Instant.now().toString());
+        return attStatsNode;
+    }
+
+    private ObjectNode createNodesStats(Map<BngProgrammable.BngCounterType,
+            PiCounterCellData> attStats, ObjectNode node) {
+        MAP_COUNTERS.forEach((counterType, pairStats) -> {
+            if (attStats.containsKey(counterType)) {
+                node.put(pairStats.getLeft(),
+                        attStats.get(counterType).bytes());
+                node.put(pairStats.getRight(),
+                        attStats.get(counterType).packets());
+            }
+        });
+        return node;
+    }
+
+    private class InternalStatsListener implements BngStatsEventListener {
+
+        @Override
+        public void event(BngStatsEvent event) {
+            eventBusService.send(TOPIC_STATS, serializeBngStatsEvent(event.subject()));
+        }
+    }
+}
