diff --git a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java
index f3bd96c..ab31aee 100644
--- a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java
+++ b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java
@@ -168,6 +168,8 @@
                 .withTreatment(down)
                 .add();
 
+
+
         flowObjectiveService.forward(fabricDeviceId, upCtrl);
         flowObjectiveService.forward(fabricDeviceId, downCtrl);
         flowObjectiveService.forward(fabricDeviceId, radiusToController);
@@ -181,6 +183,10 @@
 
         removeVlan(vlan.vlan());
 
+        if (vlan.iptv()) {
+            provisionIPTV();
+        }
+
         vlan.ports().forEach(cp -> {
             if (vlans.put(vlan.vlan(), cp)) {
                 addForwarding(vlan.vlan(), cp.deviceId(), cp.port(),
@@ -192,6 +198,46 @@
         });
     }
 
+    //FIXME: pass iptv vlan in here.
+    private void provisionIPTV() {
+        TrafficSelector ipTvUp = DefaultTrafficSelector.builder()
+                .matchVlanId(VlanId.vlanId((short) 7))
+                .matchInPort(PortNumber.portNumber(2))
+                .build();
+
+        TrafficTreatment ipTvActUp = DefaultTrafficTreatment.builder()
+                .setOutput(PortNumber.portNumber(7)).build();
+
+        TrafficSelector ipTvDown = DefaultTrafficSelector.builder()
+                .matchVlanId(VlanId.vlanId((short) 7))
+                .matchInPort(PortNumber.portNumber(7))
+                .build();
+
+        TrafficTreatment ipTvActDown = DefaultTrafficTreatment.builder()
+                .setOutput(PortNumber.portNumber(2)).build();
+
+        ForwardingObjective ipTvUpstream = DefaultForwardingObjective.builder()
+                .fromApp(appId)
+                .makePermanent()
+                .withFlag(ForwardingObjective.Flag.VERSATILE)
+                .withPriority(PRIORITY)
+                .withSelector(ipTvUp)
+                .withTreatment(ipTvActUp)
+                .add();
+
+        ForwardingObjective ipTvDownstream = DefaultForwardingObjective.builder()
+                .fromApp(appId)
+                .makePermanent()
+                .withFlag(ForwardingObjective.Flag.VERSATILE)
+                .withPriority(PRIORITY)
+                .withSelector(ipTvDown)
+                .withTreatment(ipTvActDown)
+                .add();
+
+        flowObjectiveService.forward(fabricDeviceId, ipTvUpstream);
+        flowObjectiveService.forward(fabricDeviceId, ipTvDownstream);
+    }
+
     @Override
     public void removeVlan(VlanId vlanId) {
         vlans.removeAll(vlanId)
@@ -202,7 +248,9 @@
     public List<FabricVlan> getVlans() {
         List<FabricVlan> fVlans = new ArrayList<>();
         vlans.keySet().forEach(vlan -> fVlans.add(
-                new FabricVlan(vlan, vlans.get(vlan))));
+                //FIXME: Very aweful but will fo for now
+                new FabricVlan(vlan, vlans.get(vlan),
+                               vlan.toShort() == 201 ? true : false)));
         return fVlans;
     }
 
@@ -217,6 +265,7 @@
 
     private void addForwarding(VlanId vlanId, DeviceId deviceId, PortNumber inPort,
                                List<PortNumber> outPorts) {
+
         TrafficSelector selector = DefaultTrafficSelector.builder()
                 .matchVlanId(vlanId)
                 .matchInPort(inPort)
diff --git a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/FabricVlan.java b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/FabricVlan.java
index d145928..a5cfc07 100644
--- a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/FabricVlan.java
+++ b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/FabricVlan.java
@@ -33,12 +33,14 @@
     private final VlanId vlan;
 
     private final List<ConnectPoint> ports;
+    private final boolean iptv;
 
-    public FabricVlan(VlanId vlan, Collection<ConnectPoint> ports) {
+    public FabricVlan(VlanId vlan, Collection<ConnectPoint> ports, boolean iptv) {
         checkNotNull(vlan);
         checkNotNull(ports);
         this.vlan = vlan;
         this.ports = ImmutableList.copyOf(ports);
+        this.iptv = iptv;
     }
 
     public VlanId vlan() {
@@ -48,4 +50,8 @@
     public List<ConnectPoint> ports() {
         return ports;
     }
+
+    public boolean iptv() {
+        return iptv;
+    }
 }
diff --git a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/FabricVlanCodec.java b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/FabricVlanCodec.java
index 0a097b2..00736bc 100644
--- a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/FabricVlanCodec.java
+++ b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/FabricVlanCodec.java
@@ -37,6 +37,7 @@
     // JSON field names
     private static final String VLAN = "vlan";
     private static final String PORTS = "ports";
+    private static final String IPTV = "iptv";
 
     @Override
     public ObjectNode encode(FabricVlan vlan, CodecContext context) {
@@ -54,6 +55,7 @@
     @Override
     public FabricVlan decode(ObjectNode json, CodecContext context) {
         short vlan =  json.path(VLAN).shortValue();
+        boolean iptv = json.path(IPTV).booleanValue();
         List<ConnectPoint> ports = new ArrayList<>();
 
         ArrayNode portArray = (ArrayNode) json.path(PORTS);
@@ -61,6 +63,6 @@
             ports.add(context.codec(ConnectPoint.class).decode((ObjectNode) o, context));
         }
 
-        return new FabricVlan(VlanId.vlanId(vlan), ports);
+        return new FabricVlan(VlanId.vlanId(vlan), ports, iptv);
     }
 }
diff --git a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/cli/FabricAddCommand.java b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/cli/FabricAddCommand.java
index cfa26be..e8cc641 100644
--- a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/cli/FabricAddCommand.java
+++ b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/cli/FabricAddCommand.java
@@ -59,6 +59,6 @@
             ports.add(ConnectPoint.deviceConnectPoint(portString));
         }
 
-        service.addVlan(new FabricVlan(vlan, ports));
+        service.addVlan(new FabricVlan(vlan, ports, false));
     }
 }
diff --git a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/OnosXOSIntegrationManager.java b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/OnosXOSIntegrationManager.java
index c9f7502..8ff1186 100644
--- a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/OnosXOSIntegrationManager.java
+++ b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/OnosXOSIntegrationManager.java
@@ -415,8 +415,16 @@
         //        + FABRIC_VCPE_CONNECT_POINT.toString() + "\"}";
         //json += "]}";
 
+        long vlan = portToVlan.get(fromPoint.port().toLong());
+
+
         JsonObject node = new JsonObject();
-        node.add("vlan", portToVlan.get(fromPoint.port().toLong()));
+        node.add("vlan", vlan);
+        if (vlan == 201) {
+            node.add("iptv", true);
+        } else {
+            node.add("iptv", false);
+        }
         JsonArray array = new JsonArray();
         JsonObject cp1 = new JsonObject();
         JsonObject cp2 = new JsonObject();
diff --git a/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java b/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java
index 79d2b0a..3b0195c 100644
--- a/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java
+++ b/drivers/src/main/java/org/onosproject/driver/pipeline/OLTPipeline.java
@@ -16,15 +16,12 @@
 package org.onosproject.driver.pipeline;
 
 import org.onlab.osgi.ServiceDirectory;
-import org.onlab.packet.Ethernet;
-import org.onosproject.core.ApplicationId;
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.behaviour.Pipeliner;
 import org.onosproject.net.behaviour.PipelinerContext;
 import org.onosproject.net.driver.AbstractHandlerBehaviour;
 import org.onosproject.net.flow.DefaultFlowRule;
-import org.onosproject.net.flow.DefaultTrafficSelector;
 import org.onosproject.net.flow.DefaultTrafficTreatment;
 import org.onosproject.net.flow.FlowRule;
 import org.onosproject.net.flow.FlowRuleOperations;
@@ -52,7 +49,6 @@
     private FlowRuleService flowRuleService;
     private DeviceId deviceId;
 
-    private boolean done = false;
 
     @Override
     public void init(DeviceId deviceId, PipelinerContext context) {
@@ -63,34 +59,7 @@
 
     }
 
-    private boolean installIGMPRule(ApplicationId appId, boolean done) {
-        if (done) {
-            return done;
-        }
-        TrafficSelector selector = DefaultTrafficSelector.builder()
-                .matchInPort(PortNumber.portNumber(1))
-                .matchEthType(Ethernet.TYPE_IPV4)
-                .matchIPProtocol((byte) 2).build();
 
-        TrafficTreatment treatment = DefaultTrafficTreatment.builder()
-                .punt().build();
-
-        FlowRule rule = DefaultFlowRule.builder()
-                .forDevice(deviceId)
-                .fromApp(appId)
-                .withTreatment(treatment)
-                .withSelector(selector)
-                .makePermanent()
-                .withPriority(0)
-                .build();
-
-        FlowRuleOperations.Builder flowBuilder = FlowRuleOperations.builder();
-
-        flowRuleService.apply(flowBuilder.add(rule).build());
-
-        return true;
-
-    }
 
     @Override
     public void filter(FilteringObjective filter) {
@@ -99,7 +68,6 @@
 
     @Override
     public void forward(ForwardingObjective fwd) {
-        done = installIGMPRule(fwd.appId(), done);
         FlowRuleOperations.Builder flowBuilder = FlowRuleOperations.builder();
 
         if (fwd.flag() != ForwardingObjective.Flag.VERSATILE) {
