diff --git a/apps/tvue/src/main/java/org/onlab/onos/tvue/TopologyResource.java b/apps/tvue/src/main/java/org/onlab/onos/tvue/TopologyResource.java
index 145e94a..079ba54 100644
--- a/apps/tvue/src/main/java/org/onlab/onos/tvue/TopologyResource.java
+++ b/apps/tvue/src/main/java/org/onlab/onos/tvue/TopologyResource.java
@@ -11,6 +11,7 @@
 import org.onlab.onos.net.device.DeviceService;
 import org.onlab.onos.net.host.HostService;
 import org.onlab.onos.net.link.LinkService;
+import org.onlab.onos.net.path.PathService;
 import org.onlab.onos.net.topology.Topology;
 import org.onlab.onos.net.topology.TopologyGraph;
 import org.onlab.onos.net.topology.TopologyService;
@@ -28,6 +29,7 @@
 import java.util.Set;
 
 import static org.onlab.onos.net.DeviceId.deviceId;
+import static org.onlab.onos.net.HostId.hostId;
 import static org.onlab.onos.net.PortNumber.portNumber;
 
 /**
@@ -99,12 +101,11 @@
     @Produces("application/json")
     public Response paths(@PathParam("src") String src, @PathParam("dst") String dst) {
         ObjectMapper mapper = new ObjectMapper();
-
-        TopologyService topologyService = get(TopologyService.class);
-        Topology topology = topologyService.currentTopology();
+        PathService pathService = get(PathService.class);
+        Set<Path> paths = pathService.getPaths(elementId(src), elementId(dst));
 
         ArrayNode pathsNode = mapper.createArrayNode();
-        for (Path path : topologyService.getPaths(topology, deviceId(src), deviceId(dst))) {
+        for (Path path : paths) {
             pathsNode.add(json(mapper, path));
         }
 
@@ -114,6 +115,11 @@
         return Response.ok(rootNode.toString()).build();
     }
 
+    // Creates either device ID or host ID as appropriate.
+    private ElementId elementId(String id) {
+        return id.startsWith("nic:") ? hostId(id) : deviceId(id);
+    }
+
     // Scan all links and counts number of them between the same devices
     // using a normalized link key.
     private Map<String, AggLink> aggregateLinks() {
diff --git a/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java b/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java
index 41cd045..07a57e9e 100644
--- a/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java
+++ b/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java
@@ -23,8 +23,8 @@
      */
     public DefaultEdgeLink(ProviderId providerId, ConnectPoint hostPoint,
                            HostLocation hostLocation, boolean isIngress) {
-        super(providerId, isIngress ? hostLocation : hostPoint,
-              isIngress ? hostPoint : hostLocation, Type.EDGE);
+        super(providerId, isIngress ? hostPoint : hostLocation,
+              isIngress ? hostLocation : hostPoint, Type.EDGE);
         checkArgument(hostPoint.elementId() instanceof HostId,
                       "Host point does not refer to a host ID");
         this.hostId = (HostId) hostPoint.elementId();
diff --git a/core/api/src/main/java/org/onlab/onos/net/HostId.java b/core/api/src/main/java/org/onlab/onos/net/HostId.java
index 170e2a2..c6ba53f 100644
--- a/core/api/src/main/java/org/onlab/onos/net/HostId.java
+++ b/core/api/src/main/java/org/onlab/onos/net/HostId.java
@@ -44,7 +44,7 @@
      */
     public static HostId hostId(MACAddress mac, VLANID vlanId) {
         // FIXME: use more efficient means of encoding
-        return hostId("nic" + ":" + mac + "/" + vlanId);
+        return hostId("nic" + ":" + mac + "-" + vlanId);
     }
 
     /**
diff --git a/core/api/src/main/java/org/onlab/onos/net/path/PathService.java b/core/api/src/main/java/org/onlab/onos/net/path/PathService.java
index c1d664b..efbd484 100644
--- a/core/api/src/main/java/org/onlab/onos/net/path/PathService.java
+++ b/core/api/src/main/java/org/onlab/onos/net/path/PathService.java
@@ -1,7 +1,6 @@
 package org.onlab.onos.net.path;
 
-import org.onlab.onos.net.DeviceId;
-import org.onlab.onos.net.HostId;
+import org.onlab.onos.net.ElementId;
 import org.onlab.onos.net.Path;
 import org.onlab.onos.net.topology.LinkWeight;
 
@@ -15,44 +14,23 @@
 
     /**
      * Returns the set of all shortest paths, precomputed in terms of hop-count,
-     * between the specified source and destination devices.
+     * between the specified source and destination elements.
      *
-     * @param src source device
-     * @param dst destination device
-     * @return set of all shortest paths between the two devices
+     * @param src source element
+     * @param dst destination element
+     * @return set of all shortest paths between the two elements
      */
-    Set<Path> getPaths(DeviceId src, DeviceId dst);
+    Set<Path> getPaths(ElementId src, ElementId dst);
 
     /**
      * Returns the set of all shortest paths, computed using the supplied
-     * edge-weight entity, between the specified source and destination devices.
+     * edge-weight entity, between the specified source and destination
+     * network elements.
      *
-     * @param src source device
-     * @param dst destination device
-     * @return set of all shortest paths between the two devices
+     * @param src source element
+     * @param dst destination element
+     * @return set of all shortest paths between the two element
      */
-    Set<Path> getPaths(DeviceId src, DeviceId dst,
-                       LinkWeight weight);
-
-
-    /**
-     * Returns the set of all shortest paths, precomputed in terms of hop-count,
-     * between the specified source and destination end-stations.
-     *
-     * @param src source device
-     * @param dst destination device
-     * @return set of all shortest paths between the two end-stations hosts
-     */
-    Set<Path> getPaths(HostId src, HostId dst);
-
-    /**
-     * Returns the set of all shortest paths, computed using the supplied
-     * edge-weight entity, between the specified source and end-stations.
-     *
-     * @param src source host
-     * @param dst destination host
-     * @return set of all shortest paths between the two end-station hosts
-     */
-    Set<Path> getPaths(HostId src, HostId dst, LinkWeight weight);
+    Set<Path> getPaths(ElementId src, ElementId dst, LinkWeight weight);
 
 }
diff --git a/core/api/src/test/java/org/onlab/onos/net/DefaultEdgeLinkTest.java b/core/api/src/test/java/org/onlab/onos/net/DefaultEdgeLinkTest.java
index 368ff16..a19f969 100644
--- a/core/api/src/test/java/org/onlab/onos/net/DefaultEdgeLinkTest.java
+++ b/core/api/src/test/java/org/onlab/onos/net/DefaultEdgeLinkTest.java
@@ -47,8 +47,8 @@
     public void basics() {
         HostLocation hostLocation = new HostLocation(DID1, P1, 123L);
         EdgeLink link = new DefaultEdgeLink(PID, cp(HID1, P0), hostLocation, false);
-        assertEquals("incorrect src", cp(HID1, P0), link.src());
-        assertEquals("incorrect dst", hostLocation, link.dst());
+        assertEquals("incorrect src", cp(HID1, P0), link.dst());
+        assertEquals("incorrect dst", hostLocation, link.src());
         assertEquals("incorrect type", Link.Type.EDGE, link.type());
         assertEquals("incorrect hostId", HID1, link.hostId());
         assertEquals("incorrect connect point", hostLocation, link.hostLocation());
diff --git a/core/api/src/test/java/org/onlab/onos/net/HostIdTest.java b/core/api/src/test/java/org/onlab/onos/net/HostIdTest.java
index fefc499..d79f616 100644
--- a/core/api/src/test/java/org/onlab/onos/net/HostIdTest.java
+++ b/core/api/src/test/java/org/onlab/onos/net/HostIdTest.java
@@ -22,7 +22,7 @@
     @Test
     public void basics() {
         new EqualsTester()
-                .addEqualityGroup(hostId("nic:00:11:00:00:00:01/11"),
+                .addEqualityGroup(hostId("nic:00:11:00:00:00:01-11"),
                                   hostId(MAC1, VLAN1))
                 .addEqualityGroup(hostId(MAC2, VLAN2))
                 .testEquals();
diff --git a/core/trivial/src/main/java/org/onlab/onos/net/trivial/path/PathManager.java b/core/trivial/src/main/java/org/onlab/onos/net/trivial/path/SimplePathManager.java
similarity index 61%
rename from core/trivial/src/main/java/org/onlab/onos/net/trivial/path/PathManager.java
rename to core/trivial/src/main/java/org/onlab/onos/net/trivial/path/SimplePathManager.java
index 6f763ac..a0ab2e7 100644
--- a/core/trivial/src/main/java/org/onlab/onos/net/trivial/path/PathManager.java
+++ b/core/trivial/src/main/java/org/onlab/onos/net/trivial/path/SimplePathManager.java
@@ -13,8 +13,10 @@
 import org.onlab.onos.net.DefaultPath;
 import org.onlab.onos.net.DeviceId;
 import org.onlab.onos.net.EdgeLink;
+import org.onlab.onos.net.ElementId;
 import org.onlab.onos.net.Host;
 import org.onlab.onos.net.HostId;
+import org.onlab.onos.net.HostLocation;
 import org.onlab.onos.net.Link;
 import org.onlab.onos.net.Path;
 import org.onlab.onos.net.PortNumber;
@@ -30,6 +32,7 @@
 import java.util.Set;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+import static org.onlab.onos.net.DeviceId.deviceId;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
@@ -38,14 +41,15 @@
  */
 @Component(immediate = true)
 @Service
-public class PathManager implements PathService {
+public class SimplePathManager implements PathService {
 
-    private static final String DEVICE_ID_NULL = "Device ID cannot be null";
-    private static final String HOST_ID_NULL = "Host ID cannot be null";
+    private static final String ELEMENT_ID_NULL = "Element ID cannot be null";
 
     private static final ProviderId PID = new ProviderId("org.onlab.onos.core");
     private static final PortNumber P0 = PortNumber.portNumber(0);
 
+    private static final EdgeLink NOT_HOST = new NotHost();
+
     private final Logger log = getLogger(getClass());
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
@@ -65,52 +69,25 @@
     }
 
     @Override
-    public Set<Path> getPaths(DeviceId src, DeviceId dst) {
-        checkNotNull(src, DEVICE_ID_NULL);
-        checkNotNull(dst, DEVICE_ID_NULL);
-        Topology topology = topologyService.currentTopology();
-        return topologyService.getPaths(topology, src, dst);
-    }
-
-    @Override
-    public Set<Path> getPaths(DeviceId src, DeviceId dst, LinkWeight weight) {
-        checkNotNull(src, DEVICE_ID_NULL);
-        checkNotNull(dst, DEVICE_ID_NULL);
-        Topology topology = topologyService.currentTopology();
-        return topologyService.getPaths(topology, src, dst, weight);
-    }
-
-    @Override
-    public Set<Path> getPaths(HostId src, HostId dst) {
+    public Set<Path> getPaths(ElementId src, ElementId dst) {
         return getPaths(src, dst, null);
     }
 
     @Override
-    public Set<Path> getPaths(HostId src, HostId dst, LinkWeight weight) {
-        checkNotNull(src, HOST_ID_NULL);
-        checkNotNull(dst, HOST_ID_NULL);
-
-        // Resolve the source host, bail if unable.
-        Host srcHost = hostService.getHost(src);
-        if (srcHost == null) {
-            return Sets.newHashSet();
-        }
-
-        // Resolve the destination host, bail if unable.
-        Host dstHost = hostService.getHost(dst);
-        if (dstHost == null) {
-            return Sets.newHashSet();
-        }
+    public Set<Path> getPaths(ElementId src, ElementId dst, LinkWeight weight) {
+        checkNotNull(src, ELEMENT_ID_NULL);
+        checkNotNull(dst, ELEMENT_ID_NULL);
 
         // Get the source and destination edge locations
-        EdgeLink srcEdge = new DefaultEdgeLink(PID, new ConnectPoint(src, P0),
-                                               srcHost.location(), true);
-        EdgeLink dstEdge = new DefaultEdgeLink(PID, new ConnectPoint(dst, P0),
-                                               dstHost.location(), false);
+        EdgeLink srcEdge = getEdgeLink(src, true);
+        EdgeLink dstEdge = getEdgeLink(dst, false);
+
+        DeviceId srcDevice = srcEdge != NOT_HOST ? srcEdge.dst().deviceId() : (DeviceId) src;
+        DeviceId dstDevice = dstEdge != NOT_HOST ? dstEdge.src().deviceId() : (DeviceId) dst;
 
         // If the source and destination are on the same edge device, there
         // is just one path, so build it and return it.
-        if (srcEdge.dst().deviceId().equals(dstEdge.src().deviceId())) {
+        if (srcDevice.equals(dstDevice)) {
             return edgeToEdgePaths(srcEdge, dstEdge);
         }
 
@@ -118,26 +95,47 @@
         // devices.
         Topology topology = topologyService.currentTopology();
         Set<Path> paths = weight == null ?
-                topologyService.getPaths(topology, srcEdge.dst().deviceId(),
-                                         dstEdge.src().deviceId()) :
-                topologyService.getPaths(topology, srcEdge.dst().deviceId(),
-                                         dstEdge.src().deviceId(), weight);
+                topologyService.getPaths(topology, srcDevice, dstDevice) :
+                topologyService.getPaths(topology, srcDevice, dstDevice, weight);
 
         return edgeToEdgePaths(srcEdge, dstEdge, paths);
     }
 
+    // Finds the host edge link if the element ID is a host id of an existing
+    // host. Otherwise, if the host does not exist, it returns null and if
+    // the element ID is not a host ID, returns NOT_HOST edge link.
+    private EdgeLink getEdgeLink(ElementId elementId, boolean isIngress) {
+        if (elementId instanceof HostId) {
+            // Resolve the host, return null.
+            Host host = hostService.getHost((HostId) elementId);
+            if (host == null) {
+                return null;
+            }
+            return new DefaultEdgeLink(PID, new ConnectPoint(elementId, P0),
+                                       host.location(), isIngress);
+        }
+        return NOT_HOST;
+    }
+
     // Produces a set of direct edge-to-edge paths.
     private Set<Path> edgeToEdgePaths(EdgeLink srcLink, EdgeLink dstLink) {
         Set<Path> endToEndPaths = Sets.newHashSetWithExpectedSize(1);
-        endToEndPaths.add(edgeToEdgePath(srcLink, dstLink));
+        if (srcLink != NOT_HOST || dstLink != NOT_HOST) {
+            endToEndPaths.add(edgeToEdgePath(srcLink, dstLink));
+        }
         return endToEndPaths;
     }
 
     // Produces a direct edge-to-edge path.
     private Path edgeToEdgePath(EdgeLink srcLink, EdgeLink dstLink) {
         List<Link> links = Lists.newArrayListWithCapacity(2);
-        links.add(srcLink);
-        links.add(dstLink);
+        // Add source and destination edge links only if they are real.
+        if (srcLink != NOT_HOST) {
+            links.add(srcLink);
+        }
+        if (dstLink != NOT_HOST) {
+            links.add(dstLink);
+        }
         return new DefaultPath(PID, links, 2);
     }
 
@@ -161,4 +159,12 @@
         return new DefaultPath(path.providerId(), links, path.cost() + 2);
     }
 
+    // Special value for edge link to represent that this is really not an
+    // edge link since the src or dst are really an infrastructure device.
+    private static class NotHost extends DefaultEdgeLink implements EdgeLink {
+        NotHost() {
+            super(PID, new ConnectPoint(HostId.hostId("nic:none"), P0),
+                  new HostLocation(deviceId("none:none"), P0, 0L), false);
+        }
+    }
 }
