diff --git a/core/net/src/main/java/org/onosproject/net/host/impl/BasicHostOperator.java b/core/net/src/main/java/org/onosproject/net/host/impl/BasicHostOperator.java
new file mode 100644
index 0000000..9d0c1bd
--- /dev/null
+++ b/core/net/src/main/java/org/onosproject/net/host/impl/BasicHostOperator.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * 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.onosproject.net.host.impl;
+
+import static org.slf4j.LoggerFactory.getLogger;
+
+import org.slf4j.Logger;
+import org.onosproject.incubator.net.config.ConfigOperator;
+import org.onosproject.incubator.net.config.basics.BasicHostConfig;
+import org.onosproject.net.AnnotationKeys;
+import org.onosproject.net.DefaultAnnotations;
+import org.onosproject.net.SparseAnnotations;
+import org.onosproject.net.host.DefaultHostDescription;
+import org.onosproject.net.host.HostDescription;
+
+/**
+ * Implementations of merge policies for various sources of host configuration
+ * information. This includes applications, provides, and network configurations.
+ */
+public final class BasicHostOperator implements ConfigOperator {
+
+    protected static final double DEFAULT_COORD = -1.0;
+    private static final Logger log = getLogger(BasicHostOperator.class);
+
+    private BasicHostOperator() {
+    }
+
+    /**
+     * Generates a HostDescription containing fields from a HostDescription and
+     * a HostConfig.
+     *
+     * @param cfg the host config entity from network config
+     * @param descr a HostDescription
+     * @return HostDescription based on both sources
+     */
+    public static HostDescription combine(BasicHostConfig cfg, HostDescription descr) {
+        if (cfg == null) {
+            return descr;
+        }
+        SparseAnnotations sa = combine(cfg, descr.annotations());
+        return new DefaultHostDescription(descr.hwAddress(), descr.vlan(), descr.location(),
+                descr.ipAddress(), sa);
+    }
+
+    /**
+     * Generates an annotation from an existing annotation and HostConfig.
+     *
+     * @param cfg the device config entity from network config
+     * @param an the annotation
+     * @return annotation combining both sources
+     */
+    public static SparseAnnotations combine(BasicHostConfig cfg, SparseAnnotations an) {
+        DefaultAnnotations.Builder newBuilder = DefaultAnnotations.builder();
+        if (cfg.name() != null) {
+            newBuilder.set(AnnotationKeys.NAME, cfg.name());
+        }
+        if (cfg.latitude() != DEFAULT_COORD) {
+            newBuilder.set(AnnotationKeys.LATITUDE, Double.toString(cfg.latitude()));
+        }
+        if (cfg.longitude() != DEFAULT_COORD) {
+            newBuilder.set(AnnotationKeys.LONGITUDE, Double.toString(cfg.longitude()));
+        }
+        if (cfg.rackAddress() != null) {
+            newBuilder.set(AnnotationKeys.RACK_ADDRESS, cfg.rackAddress());
+        }
+        if (cfg.owner() != null) {
+            newBuilder.set(AnnotationKeys.OWNER, cfg.owner());
+        }
+        return DefaultAnnotations.union(an, newBuilder.build());
+    }
+}
diff --git a/core/net/src/test/java/org/onosproject/net/host/impl/BasicHostOperatorTest.java b/core/net/src/test/java/org/onosproject/net/host/impl/BasicHostOperatorTest.java
new file mode 100644
index 0000000..e74ef96
--- /dev/null
+++ b/core/net/src/test/java/org/onosproject/net/host/impl/BasicHostOperatorTest.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2014-2015 Open Networking Laboratory
+ *
+ * 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.onosproject.net.host.impl;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.VlanId;
+import org.onosproject.incubator.net.config.Config;
+import org.onosproject.incubator.net.config.ConfigApplyDelegate;
+import org.onosproject.incubator.net.config.basics.BasicHostConfig;
+import org.onosproject.net.AnnotationKeys;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.HostId;
+import org.onosproject.net.HostLocation;
+import org.onosproject.net.PortNumber;
+import org.onosproject.net.host.DefaultHostDescription;
+import org.onosproject.net.host.HostDescription;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+
+public class BasicHostOperatorTest {
+    private static final MacAddress MAC = MacAddress.valueOf("00:00:11:00:00:01");
+    private static final VlanId VLAN = VlanId.vlanId((short) 10);
+    private static final IpAddress IP = IpAddress.valueOf("10.0.0.1");
+
+    private static final HostId ID = HostId.hostId(MAC);
+    private static final HostLocation LOC = new HostLocation(
+            DeviceId.deviceId("of:foo"),
+            PortNumber.portNumber(100),
+            123L
+    );
+    private static final HostDescription HOST = new DefaultHostDescription(MAC, VLAN, LOC, IP);
+
+    private final ConfigApplyDelegate delegate = new ConfigApplyDelegate() {
+        @Override
+        public void onApply(Config config) {
+        }
+    };
+    private final ObjectMapper mapper = new ObjectMapper();
+
+    private static final BasicHostConfig BHC = new BasicHostConfig();
+    private static final String NAME = "testhost";
+    private static final double LAT = 40.96;
+
+    @Before
+    public void setUp() {
+        BHC.init(ID, "test", JsonNodeFactory.instance.objectNode(), mapper, delegate);
+        BHC.name(NAME).latitude(40.96);
+    }
+
+    @Test
+    public void testDescOps() {
+        HostDescription desc = BasicHostOperator.combine(BHC, HOST);
+        assertEquals(NAME, desc.annotations().value(AnnotationKeys.NAME));
+        assertEquals(null, desc.annotations().value(AnnotationKeys.LONGITUDE));
+        assertEquals(String.valueOf(LAT), desc.annotations().value(AnnotationKeys.LATITUDE));
+    }
+}
