diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java
index 19062d5..10f3e02 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/ResourceAllocator.java
@@ -455,6 +455,8 @@
         rr.rangeMaxOverride = Integer.parseInt(rangeMaxOverrideStr);
         String rangeForceNewNumbersStr = getParam(ctx, "range-force-new-numbers", false, "false");
         rr.rangeForceNewNumbers = Boolean.parseBoolean(rangeForceNewNumbersStr);
+        String rangeNextInSequenceStr = getParam(ctx, "range-next-in-sequence", false, "false");
+        rr.rangeNextInSequence = Boolean.parseBoolean(rangeNextInSequenceStr);
         String replaceStr = getParam(ctx, "replace", false, "true");
         rr.replace = Boolean.parseBoolean(replaceStr);
         rr.applicationId = getParam(ctx, "application-id", false, "SDNC");
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/DbAllocationRule.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/DbAllocationRule.java
index 12c02c8..d15b150 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/DbAllocationRule.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/alloc/DbAllocationRule.java
@@ -242,6 +242,7 @@
 
         }
         ar.forceNewNumbers = resourceRequest.rangeForceNewNumbers;
+        ar.nextInSequence = resourceRequest.rangeNextInSequence;
         return ar;
     }
 
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceRequest.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceRequest.java
index bc05af6..2ebad4c 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceRequest.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/ra/comp/ResourceRequest.java
@@ -35,6 +35,7 @@
     public int rangeMinOverride;
     public int rangeMaxOverride;
     public boolean rangeForceNewNumbers;
+    public boolean rangeNextInSequence;
     public boolean replace;
     public String requestType;
     public String serviceModel;
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java
index 0f53354..5ec7c26 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/comp/AllocationFunction.java
@@ -108,7 +108,7 @@
     public void _exec() throws ResourceLockedException {
         outcome = allocate(request);
 
-        if ((outcome!=null) && (outcome.status == AllocationStatus.Success)) {
+        if (outcome!=null && outcome.status == AllocationStatus.Success) {
             for (Resource r : updateList) {
                 resourceDao.saveResource(r);
             }
@@ -334,7 +334,56 @@
                     }
                 }
 
-                if (req.rangeList != null) {
+                if (req.rangeList != null && !req.rangeList.isEmpty()) {
+                    if (req.nextInSequence) {
+                        // This means we allocate numbers in ascending sequence, not trying from the beginning
+                        // of the range (leaving possible holes in the sequence of allocated numbers)
+                        // To do that, we go through the ranges from the last towards the first (assuming
+                        // ranges are ordered from smallest to the largest numbers), and within each range, from
+                        // the max towards the min and find the first allocated number. Then we take the next numbers
+                        // in the range (that we already checked are available).
+
+                        int rangeIndex;
+                        Range range = null;
+                        int n = 0;
+                        boolean foundAllocated = false;
+                        for (rangeIndex = req.rangeList.size() - 1; !foundAllocated && rangeIndex >= 0; rangeIndex--) {
+                            range = req.rangeList.get(rangeIndex);
+                            for (n = range.max; n >= range.min; n--) {
+                                if (!RangeUtil.checkRange(rr, req, n)) {
+                                    foundAllocated = true;
+                                    break;
+                                }
+                            }
+                            if (foundAllocated) {
+                                break;
+                            }
+                        }
+                        if (foundAllocated) {
+                            n++;
+                        }
+                        for (; foundCount < req.requestedCount && n <= range.max; n++) {
+                            foundNumbers.add(n);
+                            foundCount++;
+                        }
+                        if (foundCount < req.requestedCount) {
+                            rangeIndex++;
+                            for (; rangeIndex < req.rangeList.size(); rangeIndex++) {
+                                range = req.rangeList.get(rangeIndex);
+                                for (n = range.min; foundCount < req.requestedCount && n <= range.max; n++) {
+                                    foundNumbers.add(n);
+                                    foundCount++;
+                                }
+                            }
+                        }
+                        // If we could not find enough numbers by going up in sequence,
+                        // reset foundNumbers and foundCount, and go back to the holes
+                        if (foundCount < req.requestedCount) {
+                            foundNumbers = new TreeSet<>();
+                            foundCount = 0;
+                        }
+                    }
+
                     if (req.reverseOrder) {
                         for (int i = req.rangeList.size() - 1; i >= 0; i--) {
                             Range range = req.rangeList.get(i);
diff --git a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/RangeAllocationRequest.java b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/RangeAllocationRequest.java
index 7b60d36..a7948b0 100644
--- a/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/RangeAllocationRequest.java
+++ b/resource-assignment/provider/src/main/java/org/onap/ccsdk/sli/adaptors/rm/data/RangeAllocationRequest.java
@@ -36,4 +36,5 @@
     public boolean sequential = false;
     public boolean reverseOrder = false;
     public boolean forceNewNumbers = false;
+    public boolean nextInSequence = false;
 }
diff --git a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
index b159127..af9508a 100644
--- a/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
+++ b/resource-assignment/provider/src/test/java/jtest/org/onap/ccsdk/sli/adaptors/ra/TestReserve.java
@@ -1,5 +1,6 @@
 package jtest.org.onap.ccsdk.sli.adaptors.ra;
 
+import static org.junit.Assert.assertNotNull;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -28,7 +29,6 @@
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 import jtest.util.org.onap.ccsdk.sli.adaptors.ra.TestTable;
-import static org.junit.Assert.assertNotNull;
 
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration(locations = { "classpath:test-context.xml" })
@@ -804,4 +804,118 @@
         allocationItem.print();
 
     }
+
+    @Test
+    public void test011() throws Exception {
+        String t = "011";
+        log.info("============== reserve " + t + " ================================");
+        log.info("=== Test range-next-in-sequence = true");
+
+        String entityId = "reserve" + t;
+        String targetId = "port-id-1";
+        String resourceName = "vlan-id-filter";
+
+        String assetId = "Site::" + targetId;
+        String resourceUnion = "SI::" + entityId;
+        String resourceSet = resourceUnion + "::1";
+
+        dataSetup.cleanup();
+        dataSetup.setupRangeItem(resourceName, assetId, resourceSet, resourceUnion, "1002,1004,1006,1008");
+
+        SvcLogicContext ctx = new SvcLogicContext();
+        ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL");
+        ctx.setAttribute("ra-input.endpoint-position", "VPE-Core2");
+        ctx.setAttribute("ra-input.check-only", "false");
+
+        ctx.setAttribute("ra-input.resource-name", resourceName);
+        ctx.setAttribute("ra-input.range-next-in-sequence", "true");
+
+        ctx.setAttribute("ra-input.reservation-entity-type", "SI");
+        ctx.setAttribute("ra-input.reservation-entity-id", entityId + "_test");
+        ctx.setAttribute("ra-input.reservation-entity-version", "1");
+
+        ctx.setAttribute("ra-input.reservation-target-id", targetId);
+        ctx.setAttribute("ra-input.reservation-target-type", "Site");
+
+        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
+
+        Assert.assertTrue(st == QueryStatus.SUCCESS);
+        Assert.assertTrue(dataSetup.checkRangeItem(resourceName, assetId, "SI::" + entityId + "_test::VPE-Core2::1", "1009"));
+    }
+
+    @Test
+    public void test012() throws Exception {
+        String t = "012";
+        log.info("============== reserve " + t + " ================================");
+        log.info("=== Test range-next-in-sequence = false");
+
+        String entityId = "reserve" + t;
+        String targetId = "port-id-1";
+        String resourceName = "vlan-id-filter";
+
+        String assetId = "Site::" + targetId;
+        String resourceUnion = "SI::" + entityId;
+        String resourceSet = resourceUnion + "::1";
+
+        dataSetup.cleanup();
+        dataSetup.setupRangeItem(resourceName, assetId, resourceSet, resourceUnion, "1002,1004,1006,1008");
+
+        SvcLogicContext ctx = new SvcLogicContext();
+        ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL");
+        ctx.setAttribute("ra-input.endpoint-position", "VPE-Core2");
+        ctx.setAttribute("ra-input.check-only", "false");
+
+        ctx.setAttribute("ra-input.resource-name", resourceName);
+        ctx.setAttribute("ra-input.range-next-in-sequence", "false");
+
+        ctx.setAttribute("ra-input.reservation-entity-type", "SI");
+        ctx.setAttribute("ra-input.reservation-entity-id", entityId + "_test");
+        ctx.setAttribute("ra-input.reservation-entity-version", "1");
+
+        ctx.setAttribute("ra-input.reservation-target-id", targetId);
+        ctx.setAttribute("ra-input.reservation-target-type", "Site");
+
+        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
+
+        Assert.assertTrue(st == QueryStatus.SUCCESS);
+        Assert.assertTrue(dataSetup.checkRangeItem(resourceName, assetId, "SI::" + entityId + "_test::VPE-Core2::1", "1003"));
+    }
+
+    @Test
+    public void test013() throws Exception {
+        String t = "013";
+        log.info("============== reserve " + t + " ================================");
+        log.info("=== Test range-next-in-sequence = true - multiple ranges");
+
+        String entityId = "reserve" + t;
+        String targetId = "port-id-1";
+        String resourceName = "vlan-id-filter";
+
+        String assetId = "Site::" + targetId;
+        String resourceUnion = "SI::" + entityId;
+        String resourceSet = resourceUnion + "::1";
+
+        dataSetup.cleanup();
+        dataSetup.setupRangeItem(resourceName, assetId, resourceSet, resourceUnion, "1002,1004,1006,1008,2205-2221");
+
+        SvcLogicContext ctx = new SvcLogicContext();
+        ctx.setAttribute("ra-input.service-model", "MY-SERV-MODEL");
+        ctx.setAttribute("ra-input.endpoint-position", "VPE-Core2");
+        ctx.setAttribute("ra-input.check-only", "false");
+
+        ctx.setAttribute("ra-input.resource-name", resourceName);
+        ctx.setAttribute("ra-input.range-next-in-sequence", "true");
+
+        ctx.setAttribute("ra-input.reservation-entity-type", "SI");
+        ctx.setAttribute("ra-input.reservation-entity-id", entityId + "_test");
+        ctx.setAttribute("ra-input.reservation-entity-version", "1");
+
+        ctx.setAttribute("ra-input.reservation-target-id", targetId);
+        ctx.setAttribute("ra-input.reservation-target-type", "Site");
+
+        QueryStatus st = resourceAllocator.reserve("NetworkCapacity", null, null, null, ctx);
+
+        Assert.assertTrue(st == QueryStatus.SUCCESS);
+        Assert.assertTrue(dataSetup.checkRangeItem(resourceName, assetId, "SI::" + entityId + "_test::VPE-Core2::1", "2222"));
+    }
 }
