diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/NullFlowRuleProvider.java b/providers/null/src/main/java/org/onosproject/provider/nil/NullFlowRuleProvider.java
index 2cbb4d0..beaeb6a 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/NullFlowRuleProvider.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/NullFlowRuleProvider.java
@@ -74,12 +74,12 @@
 
     @Override
     public void applyFlowRule(FlowRule... flowRules) {
-        // FIXME: invoke executeBatch
+        throw new UnsupportedOperationException("Cannot apply individual flow rules");
     }
 
     @Override
     public void removeFlowRule(FlowRule... flowRules) {
-        // FIXME: invoke executeBatch
+        throw new UnsupportedOperationException("Cannot remove individual flow rules");
     }
 
     @Override
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullEntity.java b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullEntity.java
index ed68dfc..a9efa78 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullEntity.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullEntity.java
@@ -17,6 +17,7 @@
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.primitives.Longs;
+import org.onlab.util.Tools;
 import org.onosproject.cli.AbstractShellCommand;
 import org.onosproject.net.ConnectPoint;
 import org.onosproject.net.DeviceId;
@@ -33,9 +34,12 @@
  * Base command for adding simulated entities to the custom topology simulation.
  */
 public abstract class CreateNullEntity extends AbstractShellCommand {
+
     protected static final String GEO = "geo";
     protected static final String GRID = "grid";
 
+    protected static final int MAX_EDGE_PORT_TRIES = 5;
+
     /**
      * Validates that the simulator is custom.
      *
@@ -93,14 +97,32 @@
      * @return connect point available for link or host attachment
      */
     protected ConnectPoint findAvailablePort(DeviceId deviceId, ConnectPoint otherPoint) {
-        EdgePortService eps = get(EdgePortService.class);
         HostService hs = get(HostService.class);
-
-        List<ConnectPoint> points = ImmutableList
-                .sortedCopyOf((l, r) -> Longs.compare(l.port().toLong(), r.port().toLong()),
-                              eps.getEdgePoints(deviceId));
-        return points.stream()
+        return findAvailablePorts(deviceId).stream()
                 .filter(p -> !Objects.equals(p, otherPoint) && hs.getConnectedHosts(p).isEmpty())
                 .findFirst().orElse(null);
     }
+
+    /**
+     * Finds an available connect points among edge ports of the specified device.
+     *
+     * @param deviceId device identifier
+     * @return list of connect points available for link or host attachments
+     */
+    protected List<ConnectPoint> findAvailablePorts(DeviceId deviceId) {
+        EdgePortService eps = get(EdgePortService.class);
+
+        // As there may be a slight delay in edge service getting updated, retry a few times
+        for (int i = 0; i < MAX_EDGE_PORT_TRIES; i++) {
+            List<ConnectPoint> points = ImmutableList
+                    .sortedCopyOf((l, r) -> Longs.compare(l.port().toLong(), r.port().toLong()),
+                                  eps.getEdgePoints(deviceId));
+            if (!points.isEmpty()) {
+                return points;
+            }
+            Tools.delay(100);
+        }
+        return ImmutableList.of();
+    }
+
 }
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullHosts.java b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullHosts.java
new file mode 100644
index 0000000..0495038
--- /dev/null
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullHosts.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * 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.provider.nil.cli;
+
+import org.apache.karaf.shell.commands.Argument;
+import org.apache.karaf.shell.commands.Command;
+import org.onlab.packet.IpAddress;
+import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.HostId;
+import org.onosproject.net.HostLocation;
+import org.onosproject.provider.nil.CustomTopologySimulator;
+import org.onosproject.provider.nil.NullProviders;
+import org.onosproject.provider.nil.TopologySimulator;
+
+import java.util.List;
+
+/**
+ * Adds a simulated end-station host to the custom topology simulation.
+ */
+@Command(scope = "onos", name = "null-create-hosts",
+        description = "Adds a simulated end-station host to the custom topology simulation")
+public class CreateNullHosts extends CreateNullEntity {
+
+    @Argument(index = 0, name = "deviceName", description = "Name of device where hosts are attached",
+            required = true)
+    String deviceName = null;
+
+    @Argument(index = 1, name = "hostIpPattern", description = "Host IP pattern",
+            required = true)
+    String hostIpPattern = null;
+
+    @Argument(index = 2, name = "hostCount", description = "Number of hosts to create",
+            required = true)
+    int hostCount = 0;
+
+    @Override
+    protected void execute() {
+        NullProviders service = get(NullProviders.class);
+
+        TopologySimulator simulator = service.currentSimulator();
+        if (!validateSimulator(simulator)) {
+            return;
+        }
+
+        CustomTopologySimulator sim = (CustomTopologySimulator) simulator;
+
+        List<ConnectPoint> points = findAvailablePorts(sim.deviceId(deviceName));
+        String pattern = hostIpPattern.replace("*", "%d");
+        for (int h = 0; h < hostCount; h++) {
+            HostLocation location = new HostLocation(points.get(h), System.currentTimeMillis());
+            IpAddress ip = IpAddress.valueOf(String.format(pattern, h));
+            HostId id = sim.nextHostId();
+            sim.createHost(id, location, ip);
+        }
+    }
+
+}
diff --git a/providers/null/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/providers/null/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index e1abc40..7be09e8 100644
--- a/providers/null/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/providers/null/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -50,6 +50,9 @@
         <command>
             <action class="org.onosproject.provider.nil.cli.CreateNullHost"/>
         </command>
+        <command>
+            <action class="org.onosproject.provider.nil.cli.CreateNullHosts"/>
+        </command>
     </command-bundle>
 
     <bean id="startStopCompleter" class="org.onosproject.cli.StartStopCompleter"/>
