diff --git a/core/api/src/main/java/org/onosproject/net/AnnotationKeys.java b/core/api/src/main/java/org/onosproject/net/AnnotationKeys.java
index 4f81e92..38b599d 100644
--- a/core/api/src/main/java/org/onosproject/net/AnnotationKeys.java
+++ b/core/api/src/main/java/org/onosproject/net/AnnotationKeys.java
@@ -113,6 +113,11 @@
     public static final String PORT_NAME = "portName";
 
     /**
+     * Annotation key for the port mac.
+     */
+    public static final String PORT_MAC = "portMac";
+
+    /**
      * Annotation key for the router ID.
      */
     public static final String ROUTER_ID = "routerId";
diff --git a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
index a7e334f..4ceb425 100644
--- a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
+++ b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
@@ -516,7 +516,7 @@
             PortNumber portNo = PortNumber.portNumber(port.getPortNo().getPortNumber());
             boolean enabled = !port.getState().contains(OFPortState.LINK_DOWN)
                     && !port.getConfig().contains(OFPortConfig.PORT_DOWN);
-            SparseAnnotations annotations = makePortNameAnnotation(port.getName());
+            SparseAnnotations annotations = makePortAnnotation(port.getName(), port.getHwAddr().toString());
 
             OFExpPortDescPropOpticalTransport firstProp = port.getProperties().get(0);
             OFPortOpticalTransportSignalType sigType = firstProp.getPortSignalType();
@@ -560,16 +560,19 @@
         /**
          * Creates an annotation for the port name if one is available.
          *
-         * @param port description of the port
+         * @param portName the port name
+         * @param portMac the port mac
          * @return annotation containing the port name if one is found,
          *         null otherwise
          */
-        private SparseAnnotations makePortNameAnnotation(String port) {
+        private SparseAnnotations makePortAnnotation(String portName, String portMac) {
             SparseAnnotations annotations = null;
-            String portName = Strings.emptyToNull(port);
+            String pName = Strings.emptyToNull(portName);
+            String pMac = Strings.emptyToNull(portMac);
             if (portName != null) {
                 annotations = DefaultAnnotations.builder()
-                        .set(AnnotationKeys.PORT_NAME, portName).build();
+                        .set(AnnotationKeys.PORT_NAME, pName)
+                        .set(AnnotationKeys.PORT_MAC, pMac).build();
             }
             return annotations;
         }
@@ -586,7 +589,7 @@
                     !port.getState().contains(OFPortState.LINK_DOWN) &&
                             !port.getConfig().contains(OFPortConfig.PORT_DOWN);
             Port.Type type = port.getCurr().contains(OFPortFeatures.PF_FIBER) ? FIBER : COPPER;
-            SparseAnnotations annotations = makePortNameAnnotation(port.getName());
+            SparseAnnotations annotations = makePortAnnotation(port.getName(), port.getHwAddr().toString());
             return new DefaultPortDescription(portNo, enabled, type,
                                               portSpeed(port), annotations);
         }
@@ -607,7 +610,7 @@
 
             boolean enabled = !port.getState().contains(OFPortState.LINK_DOWN)
                     && !port.getConfig().contains(OFPortConfig.PORT_DOWN);
-            SparseAnnotations annotations = makePortNameAnnotation(port.getName());
+            SparseAnnotations annotations = makePortAnnotation(port.getName(), port.getHwAddr().toString());
 
             if (port.getVersion() == OFVersion.OF_13
                     && ptype == PortDescPropertyType.OPTICAL_TRANSPORT) {
@@ -649,7 +652,7 @@
 
             // FIXME when Calient OF agent reports port status
             boolean enabled = true;
-            SparseAnnotations annotations = makePortNameAnnotation(port.getName());
+            SparseAnnotations annotations = makePortAnnotation(port.getName(), port.getHwAddr().toString());
 
             // S160 data sheet
             // Wavelength range: 1260 - 1630 nm, grid is irrelevant for this type of switch
@@ -664,7 +667,7 @@
             } else {
                 PortNumber portNo = PortNumber.portNumber(port.getPortNo().getPortNumber());
                 Port.Type type = port.getCurr().contains(OFPortFeatures.PF_FIBER) ? FIBER : COPPER;
-                SparseAnnotations annotations = makePortNameAnnotation(port.getName());
+                SparseAnnotations annotations = makePortAnnotation(port.getName(), port.getHwAddr().toString());
                 return new DefaultPortDescription(portNo, false, type,
                                                   portSpeed(port), annotations);
             }
