diff --git a/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
index 049f49a..31148ab 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/DefaultTrafficTreatment.java
@@ -43,6 +43,7 @@
     private final List<Instruction> deferred;
     private final List<Instruction> all;
     private final Instructions.TableTypeTransition table;
+    private final Instructions.MetadataInstruction meta;
 
     private final boolean hasClear;
 
@@ -60,6 +61,7 @@
         this.all = this.immediate;
         this.hasClear = false;
         this.table = null;
+        this.meta = null;
     }
 
     /**
@@ -73,13 +75,14 @@
     private DefaultTrafficTreatment(List<Instruction> deferred,
                                    List<Instruction> immediate,
                                    Instructions.TableTypeTransition table,
-                                   boolean clear) {
+                                   boolean clear,
+                                   Instructions.MetadataInstruction meta) {
         this.immediate = ImmutableList.copyOf(checkNotNull(immediate));
         this.deferred = ImmutableList.copyOf(checkNotNull(deferred));
         this.all = ListUtils.union(this.immediate, this.deferred);
         this.table = table;
+        this.meta = meta;
         this.hasClear = clear;
-
     }
 
     @Override
@@ -107,6 +110,11 @@
         return hasClear;
     }
 
+    @Override
+    public Instructions.MetadataInstruction writeMetadata() {
+        return meta;
+    }
+
     /**
      * Returns a new traffic treatment builder.
      *
@@ -139,7 +147,7 @@
     //FIXME: Order of instructions may affect hashcode
     @Override
     public int hashCode() {
-        return Objects.hash(immediate, deferred, table);
+        return Objects.hash(immediate, deferred, table, meta);
     }
 
     @Override
@@ -151,7 +159,8 @@
             DefaultTrafficTreatment that = (DefaultTrafficTreatment) obj;
             return Objects.equals(immediate, that.immediate) &&
                     Objects.equals(deferred, that.deferred) &&
-                    Objects.equals(table, that.table);
+                    Objects.equals(table, that.table) &&
+                    Objects.equals(meta, that.meta);
 
         }
         return false;
@@ -164,6 +173,7 @@
                 .add("deferred", deferred)
                 .add("transition", table == null ? "None" : table.toString())
                 .add("cleared", hasClear)
+                .add("metadata", meta)
                 .toString();
     }
 
@@ -177,6 +187,8 @@
 
         Instructions.TableTypeTransition table;
 
+        Instructions.MetadataInstruction meta;
+
         List<Instruction> deferred = Lists.newLinkedList();
 
         List<Instruction> immediate = Lists.newLinkedList();
@@ -213,6 +225,9 @@
                 case TABLE:
                     table = (Instructions.TableTypeTransition) instruction;
                     break;
+                case METADATA:
+                    meta = (Instructions.MetadataInstruction) instruction;
+                    break;
                 default:
                     throw new IllegalArgumentException("Unknown instruction type: " +
                                                                instruction.type());
@@ -355,6 +370,11 @@
         }
 
         @Override
+        public Builder writeMetadata(long metadata, long metadataMask) {
+            return add(Instructions.writeMetadata(metadata, metadataMask));
+        }
+
+        @Override
         public TrafficTreatment build() {
             //Don't add DROP instruction by default when instruction
             //set is empty. This will be handled in DefaultSingleTablePipeline
@@ -364,7 +384,7 @@
             //        && table == null && !clear) {
             //    drop();
             //}
-            return new DefaultTrafficTreatment(deferred, immediate, table, clear);
+            return new DefaultTrafficTreatment(deferred, immediate, table, clear, meta);
         }
 
     }
diff --git a/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java b/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java
index 281e395..a82919f 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/TrafficTreatment.java
@@ -67,6 +67,13 @@
     boolean clearedDeferred();
 
     /**
+     * Returns the metadata instruction if there is one.
+     *
+     * @return a metadata instruction that may be null
+     */
+    Instructions.MetadataInstruction writeMetadata();
+
+    /**
      * Builder of traffic treatment entities.
      */
     interface Builder {
@@ -276,6 +283,20 @@
         Builder wipeDeferred();
 
         /**
+         * Writes metadata to associate with a packet.
+         * <pre>
+         * {@code
+         * new_metadata = (old_metadata &  ̃mask) | (value & mask)
+         * }
+         * </pre>
+         *
+         * @param value the metadata to write
+         * @param mask  the masked bits for the value
+         * @return a treatment builder
+         */
+        Builder writeMetadata(long value, long mask);
+
+        /**
          * Builds an immutable traffic treatment descriptor.
          * <p>
          * If the treatment is empty when build() is called, it will add a default
@@ -286,5 +307,7 @@
          * @return traffic treatment
          */
         TrafficTreatment build();
+
     }
+
 }
diff --git a/core/api/src/main/java/org/onosproject/net/flow/instructions/Instruction.java b/core/api/src/main/java/org/onosproject/net/flow/instructions/Instruction.java
index e3fe3f3..16a9464 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/instructions/Instruction.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/instructions/Instruction.java
@@ -35,7 +35,7 @@
         OUTPUT,
 
         /**
-         * Signifies that.... (do we need this?)
+         * Signifies that traffic should be sent out of a group.
          */
         GROUP,
 
@@ -57,7 +57,12 @@
         /**
          * Signifies that the traffic should be modified in L3 way.
          */
-        L3MODIFICATION
+        L3MODIFICATION,
+
+        /**
+         * Signifies that metadata be attached to traffic.
+         */
+        METADATA
     }
 
     /**
diff --git a/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java b/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
index c673ae0..53d0528 100644
--- a/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
+++ b/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java
@@ -323,6 +323,17 @@
     }
 
     /**
+     * Writes metadata to associate with a packet.
+     *
+     * @param metadata the metadata value to write
+     * @param metadataMask the bits to mask for the metadata value
+     * @return metadata instruction
+     */
+    public static Instruction writeMetadata(long metadata, long metadataMask) {
+        return new MetadataInstruction(metadata, metadataMask);
+    }
+
+    /**
      *  Drop instruction.
      */
     public static final class DropInstruction implements Instruction {
@@ -443,7 +454,9 @@
         }
     }
 
-
+    /**
+     *  Transition instruction.
+     */
     public static class TableTypeTransition implements Instruction {
         private final Integer tableId;
 
@@ -483,7 +496,59 @@
             }
             return false;
         }
+    }
 
+    /**
+     *  Metadata instruction.
+     */
+    public static class MetadataInstruction implements Instruction {
+        private final long metadata;
+        private final long metadataMask;
+
+        MetadataInstruction(long metadata, long metadataMask) {
+            this.metadata = metadata;
+            this.metadataMask = metadataMask;
+        }
+
+        @Override
+        public Type type() {
+            return Type.METADATA;
+        }
+
+        public long metadata() {
+            return this.metadata;
+        }
+
+        public long metadataMask() {
+            return this.metadataMask;
+        }
+
+        @Override
+        public String toString() {
+            return toStringHelper(type().toString())
+                    .add("metadata", Long.toHexString(this.metadata))
+                    .add("metadata mask", Long.toHexString(this.metadataMask))
+                    .toString();
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(type(), metadata, metadataMask);
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj instanceof MetadataInstruction) {
+                MetadataInstruction that = (MetadataInstruction) obj;
+                return Objects.equals(metadata, that.metadata) &&
+                        Objects.equals(metadataMask, that.metadataMask);
+
+            }
+            return false;
+        }
     }
 }
 
diff --git a/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java b/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
index 6c7fe13..e47d1aa 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
@@ -36,6 +36,7 @@
 import org.onosproject.net.flow.criteria.Criterion.Type;
 import org.onosproject.net.flow.instructions.Instruction;
 import org.onosproject.net.flow.instructions.Instructions;
+import org.onosproject.net.flow.instructions.Instructions.MetadataInstruction;
 import org.onosproject.net.resource.link.BandwidthResource;
 import org.onosproject.net.resource.link.BandwidthResourceRequest;
 import org.onosproject.net.resource.link.LambdaResource;
@@ -118,6 +119,11 @@
         public boolean clearedDeferred() {
             return false;
         }
+
+        @Override
+        public MetadataInstruction writeMetadata() {
+            return null;
+        }
     }
 
     /**
diff --git a/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java b/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java
index 1113b2b..5097bb8 100644
--- a/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java
@@ -21,6 +21,7 @@
 import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
+
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -58,6 +59,7 @@
 import org.onosproject.net.flow.criteria.Criterion;
 import org.onosproject.net.flow.instructions.Instruction;
 import org.onosproject.net.flow.instructions.Instructions;
+import org.onosproject.net.flow.instructions.Instructions.MetadataInstruction;
 import org.onosproject.net.provider.AbstractProvider;
 import org.onosproject.net.provider.ProviderId;
 import org.onosproject.store.trivial.impl.SimpleFlowRuleStore;
@@ -595,6 +597,11 @@
             return false;
         }
 
+        @Override
+        public MetadataInstruction writeMetadata() {
+            return null;
+        }
+
     }
 
     public class TestApplicationId extends DefaultApplicationId {
diff --git a/drivers/src/main/java/org/onosproject/driver/pipeline/CentecV350Pipeline.java b/drivers/src/main/java/org/onosproject/driver/pipeline/CentecV350Pipeline.java
index 4c9700f..7c29773 100644
--- a/drivers/src/main/java/org/onosproject/driver/pipeline/CentecV350Pipeline.java
+++ b/drivers/src/main/java/org/onosproject/driver/pipeline/CentecV350Pipeline.java
@@ -78,6 +78,7 @@
     protected static final int ROUTE_TABLE = 3;
 
     private static final long DEFAULT_METADATA = 100;
+    private static final long DEFAULT_METADATA_MASK = 0xff;
 
     // Priority used in PORT_VLAN Table, the only priority accepted is PORT_VLAN_TABLE_PRIORITY.
     // The packet passed PORT+VLAN check will goto FILTER Table.
@@ -408,10 +409,10 @@
                 selector.matchInPort(p.port());
                 // Although the accepted packets will be sent to filter table, we must
                 // explicitly set goto_table instruction here.
+                treatment.writeMetadata(DEFAULT_METADATA, DEFAULT_METADATA_MASK);
+                // set default metadata written by PORT_VLAN Table.
                 treatment.transition(FILTER_TABLE);
                 // We do not support strip vlan here, treatment.deferred().popVlan();
-                // XXX: write_metadata seems not supported by ONOS now, use the switch CLI to
-                // set default metadata written by PORT_VLAN Table.
                 // PORT_VLAN table only accept 0xffff priority since it does exact match only.
                 FlowRule rule = DefaultFlowRule.builder()
                         .forDevice(deviceId)
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowEntryBuilder.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowEntryBuilder.java
index 61bda98..61f669c 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowEntryBuilder.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowEntryBuilder.java
@@ -16,6 +16,7 @@
 package org.onosproject.provider.of.flow.impl;
 
 import com.google.common.collect.Lists;
+
 import org.onlab.packet.Ip4Address;
 import org.onlab.packet.Ip4Prefix;
 import org.onlab.packet.Ip6Address;
@@ -56,6 +57,7 @@
 import org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyActions;
 import org.projectfloodlight.openflow.protocol.instruction.OFInstructionGotoTable;
 import org.projectfloodlight.openflow.protocol.instruction.OFInstructionWriteActions;
+import org.projectfloodlight.openflow.protocol.instruction.OFInstructionWriteMetadata;
 import org.projectfloodlight.openflow.protocol.match.Match;
 import org.projectfloodlight.openflow.protocol.match.MatchField;
 import org.projectfloodlight.openflow.protocol.oxm.OFOxm;
@@ -219,6 +221,9 @@
                             .getTableId().getValue()));
                     break;
                 case WRITE_METADATA:
+                    OFInstructionWriteMetadata m = (OFInstructionWriteMetadata) in;
+                    builder.writeMetadata(m.getMetadata().getValue(),
+                                          m.getMetadataMask().getValue());
                     break;
                 case WRITE_ACTIONS:
                     builder.deferred();
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer10.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer10.java
index 6d7e2e1..c9de450 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer10.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer10.java
@@ -167,6 +167,8 @@
                 break;
             case L0MODIFICATION:
             case GROUP:
+            case TABLE:
+            case METADATA:
                 log.warn("Instruction type {} not supported with protocol version {}",
                         i.type(), factory().getVersion());
                 break;
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
index a636a76..67c16fa 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowModBuilderVer13.java
@@ -117,6 +117,9 @@
         if (treatment.tableTransition() != null) {
             instructions.add(buildTableGoto(treatment.tableTransition()));
         }
+        if (treatment.writeMetadata() != null) {
+            instructions.add(buildMetadata(treatment.writeMetadata()));
+        }
 
         long cookie = flowRule().id().value();
 
@@ -154,6 +157,9 @@
         if (treatment.tableTransition() != null) {
             instructions.add(buildTableGoto(treatment.tableTransition()));
         }
+        if (treatment.writeMetadata() != null) {
+            instructions.add(buildMetadata(treatment.writeMetadata()));
+        }
 
         long cookie = flowRule().id().value();
 
@@ -247,6 +253,12 @@
         return instruction;
     }
 
+    private OFInstruction buildMetadata(Instructions.MetadataInstruction m) {
+        OFInstruction instruction = factory().instructions().writeMetadata(
+                U64.of(m.metadata()), U64.of(m.metadataMask()));
+        return instruction;
+    }
+
     private OFAction buildL0Modification(Instruction i) {
         L0ModificationInstruction l0m = (L0ModificationInstruction) i;
         switch (l0m.subtype()) {
