blob: 979744275e8acd5893db813872a0502e5fd3cda7 [file] [log] [blame]
Charles Chana7903c82018-03-15 20:14:16 -07001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.net.flowobjective.impl;
18
19import com.google.common.collect.Lists;
20import com.google.common.collect.Sets;
21import org.junit.Before;
22import org.junit.Ignore;
23import org.junit.Test;
24import org.onlab.packet.Ethernet;
25import org.onlab.packet.IpPrefix;
26import org.onlab.packet.MacAddress;
27import org.onlab.packet.MplsLabel;
28import org.onlab.packet.VlanId;
Charles Chan45c19d72018-04-19 21:38:40 -070029import org.onosproject.cfg.ComponentConfigService;
Charles Chana7903c82018-03-15 20:14:16 -070030import org.onosproject.core.ApplicationId;
31import org.onosproject.core.DefaultApplicationId;
32import org.onosproject.net.DeviceId;
33import org.onosproject.net.PortNumber;
34import org.onosproject.net.behaviour.NextGroup;
35import org.onosproject.net.behaviour.Pipeliner;
36import org.onosproject.net.behaviour.PipelinerAdapter;
Charles Chan45c19d72018-04-19 21:38:40 -070037import org.onosproject.net.device.DeviceService;
38import org.onosproject.net.driver.DriverService;
Charles Chana7903c82018-03-15 20:14:16 -070039import org.onosproject.net.flow.DefaultTrafficSelector;
40import org.onosproject.net.flow.DefaultTrafficTreatment;
41import org.onosproject.net.flow.TrafficSelector;
42import org.onosproject.net.flow.TrafficTreatment;
43import org.onosproject.net.flow.criteria.Criteria;
44import org.onosproject.net.flowobjective.DefaultFilteringObjective;
45import org.onosproject.net.flowobjective.DefaultForwardingObjective;
46import org.onosproject.net.flowobjective.DefaultNextObjective;
47import org.onosproject.net.flowobjective.FilteringObjective;
48import org.onosproject.net.flowobjective.FlowObjectiveStore;
49import org.onosproject.net.flowobjective.ForwardingObjective;
50import org.onosproject.net.flowobjective.NextObjective;
51import org.onosproject.net.flowobjective.Objective;
Charles Chan45c19d72018-04-19 21:38:40 -070052import org.onosproject.net.flowobjective.ObjectiveContext;
Charles Chana7903c82018-03-15 20:14:16 -070053import org.onosproject.net.flowobjective.ObjectiveError;
54import org.onosproject.net.flowobjective.ObjectiveEvent;
55
56import static java.util.concurrent.Executors.newFixedThreadPool;
57import static org.easymock.EasyMock.createMock;
58import static org.easymock.EasyMock.expect;
59import static org.easymock.EasyMock.replay;
Charles Chan45c19d72018-04-19 21:38:40 -070060import static org.easymock.EasyMock.reset;
Charles Chana7903c82018-03-15 20:14:16 -070061import static org.easymock.EasyMock.verify;
62import static org.junit.Assert.assertTrue;
63import static org.junit.Assert.assertEquals;
64import static org.onlab.junit.TestTools.assertAfter;
65import static org.onlab.util.Tools.groupedThreads;
66
67import java.util.Collection;
68import java.util.List;
69import java.util.Random;
70
71public class InOrderFlowObjectiveManagerTest {
72 private InOrderFlowObjectiveManager mgr;
73
74 private static final int PRIORITY = 1000;
75 private static final ApplicationId APP_ID = new DefaultApplicationId(1, "org.onosproject.test");
76 private static final DeviceId DEV1 = DeviceId.deviceId("of:1");
77 private static final PortNumber P1 = PortNumber.portNumber(1);
78 private static final PortNumber P2 = PortNumber.portNumber(2);
79 private static final PortNumber P3 = PortNumber.portNumber(3);
80 private static final PortNumber P4 = PortNumber.portNumber(4);
81 private static final MacAddress M1 = MacAddress.valueOf("00:00:00:00:00:01");
82 private static final MacAddress M2 = MacAddress.valueOf("00:00:00:00:00:02");
83 private static final MacAddress M3 = MacAddress.valueOf("00:00:00:00:00:03");
84 private static final VlanId V1 = VlanId.vlanId((short) 10);
85 private static final VlanId V2 = VlanId.vlanId((short) 20);
86 private static final VlanId V3 = VlanId.vlanId((short) 30);
87 private static final TrafficSelector S1 = DefaultTrafficSelector.builder()
88 .matchEthType(Ethernet.TYPE_IPV4).matchIPDst(IpPrefix.valueOf("10.0.0.1/32")).build();
89 private static final TrafficSelector S2 = DefaultTrafficSelector.builder()
90 .matchEthType(Ethernet.TYPE_IPV4).matchIPDst(IpPrefix.valueOf("10.0.0.2/32")).build();
91 private static final int NID1 = 1;
92 private static final int NID2 = 2;
93 private static final NextGroup NGRP1 = () -> new byte[] {0x00, 0x01};
94 private static final NextGroup NGRP2 = () -> new byte[] {0x02, 0x03};
95
96 // Delay flow objectives OFFSET + rand(0, BOUND) millis
Charles Chan45c19d72018-04-19 21:38:40 -070097 private static final int DEFAULT_OFFSET = 10; // ms
98 private static final int DEFAULT_BOUND = 40; // ms
99 private static int offset = DEFAULT_OFFSET;
100 private static int bound = DEFAULT_BOUND;
Charles Chana7903c82018-03-15 20:14:16 -0700101
102 private static final FilteringObjective FILT1 = buildFilteringObjective(P2, V3, M3, 1).add();
103 private static final FilteringObjective FILT2 = buildFilteringObjective(P2, V2, M2, 2).add();
104 private static final FilteringObjective FILT3 = buildFilteringObjective(P2, V3, M3, 3).remove();
105 private static final FilteringObjective FILT4 = buildFilteringObjective(P1, V1, M1, 4).add();
106 private static final FilteringObjective FILT5 = buildFilteringObjective(P2, V2, M2, 5).remove();
107 private static final FilteringObjective FILT6 = buildFilteringObjective(P1, V1, M1, 6).remove();
108 private static final FilteringObjective FILT7 = buildFilteringObjective(P2, V3, M3, 7).add();
109 private List<FilteringObjective> expectFiltObjs = Lists.newCopyOnWriteArrayList(
110 Lists.newArrayList(FILT1, FILT2, FILT3, FILT4, FILT5, FILT6, FILT7));
111
112 private static final NextObjective NEXT1 = buildNextObjective(NID1, V1, Sets.newHashSet(P1)).add();
113 private static final NextObjective NEXT2 = buildNextObjective(NID2, V2, Sets.newHashSet(P3)).add();
114 private static final NextObjective NEXT3 = buildNextObjective(NID1, V1, Sets.newHashSet(P1, P2)).addToExisting();
115 private static final NextObjective NEXT4 = buildNextObjective(NID2, V2, Sets.newHashSet(P3, P4)).addToExisting();
116 private static final NextObjective NEXT5 = buildNextObjective(NID1, V1, Sets.newHashSet(P1)).removeFromExisting();
117 private static final NextObjective NEXT6 = buildNextObjective(NID2, V2, Sets.newHashSet(P3)).removeFromExisting();
118 private static final NextObjective NEXT7 = buildNextObjective(NID1, V1, Sets.newHashSet()).remove();
119 private static final NextObjective NEXT8 = buildNextObjective(NID2, V2, Sets.newHashSet()).remove();
120 private List<NextObjective> expectNextObjs = Lists.newCopyOnWriteArrayList(
121 Lists.newArrayList(NEXT1, NEXT2, NEXT3, NEXT4, NEXT5, NEXT6, NEXT7, NEXT8));
122 private List<NextObjective> expectNextObjsPending = Lists.newCopyOnWriteArrayList(
123 Lists.newArrayList(NEXT5, NEXT6, NEXT1, NEXT2, NEXT3, NEXT4, NEXT7, NEXT8));
124
125 private static final ForwardingObjective FWD1 = buildFwdObjective(S1, NID1).add();
126 private static final ForwardingObjective FWD2 = buildFwdObjective(S2, NID2).add();
127 private static final ForwardingObjective FWD3 = buildFwdObjective(S1, NID2).add();
128 private static final ForwardingObjective FWD4 = buildFwdObjective(S2, NID1).add();
129 private static final ForwardingObjective FWD5 = buildFwdObjective(S1, NID2).remove();
130 private static final ForwardingObjective FWD6 = buildFwdObjective(S2, NID1).remove();
131 private List<ForwardingObjective> expectFwdObjs = Lists.newCopyOnWriteArrayList(
132 Lists.newArrayList(FWD1, FWD2, FWD3, FWD4, FWD5, FWD6));
133
Charles Chan45c19d72018-04-19 21:38:40 -0700134 private static boolean timeout = false;
135 private static final ForwardingObjective FWD11 = buildFwdObjective(S1, NID2).add(new ObjectiveContext() {
136 @Override
137 public void onError(Objective objective, ObjectiveError error) {
138 timeout = error.equals(ObjectiveError.INSTALLATIONTIMEOUT);
139 }
140 });
141 private List<ForwardingObjective> expectFwdObjsTimeout = Lists.newCopyOnWriteArrayList(
142 Lists.newArrayList(FWD11, FWD1, FWD2));
143
Charles Chana7903c82018-03-15 20:14:16 -0700144 private List<Objective> actualObjs = Lists.newCopyOnWriteArrayList();
145
146 private Pipeliner pipeliner = new PipelinerAdapter() {
147 @Override
148 public void filter(FilteringObjective filterObjective) {
149 recordObjective(filterObjective);
150 }
151
152 @Override
153 public void forward(ForwardingObjective forwardObjective) {
154 recordObjective(forwardObjective);
155 }
156
157 @Override
158 public void next(NextObjective nextObjective) {
159 recordObjective(nextObjective);
160
161 // Notify delegate when the next obj is completed
162 ObjectiveEvent.Type type;
163 if (nextObjective.op() == Objective.Operation.ADD ||
164 nextObjective.op() == Objective.Operation.ADD_TO_EXISTING) {
165 type = ObjectiveEvent.Type.ADD;
166 } else if (nextObjective.op() == Objective.Operation.REMOVE ||
167 nextObjective.op() == Objective.Operation.REMOVE_FROM_EXISTING) {
168 type = ObjectiveEvent.Type.REMOVE;
169 } else {
170 return;
171 }
172 mgr.delegate.notify(new ObjectiveEvent(type, nextObjective.id()));
173 }
174
175 /**
176 * Record the objectives.
177 * The random delay is introduced in order to mimic pipeline and flow operation behavior.
178 *
179 * @param obj Flow objective
180 */
181 private void recordObjective(Objective obj) {
182 try {
Charles Chan45c19d72018-04-19 21:38:40 -0700183 Thread.sleep(new Random().nextInt(bound) + offset);
Ray Milkey95c9e0f2018-05-30 14:16:37 -0700184 if (!actualObjs.contains(obj)) {
185 actualObjs.add(obj);
186 }
Charles Chana7903c82018-03-15 20:14:16 -0700187 obj.context().ifPresent(c -> c.onSuccess(obj));
188 } catch (Exception e) {
189 obj.context().ifPresent(c -> c.onError(obj, ObjectiveError.UNKNOWN));
190 }
191 }
192 };
193
194 @Before
195 public void setUp() {
196 mgr = new InOrderFlowObjectiveManager();
197 mgr.pipeliners.put(DEV1, pipeliner);
198 mgr.executorService = newFixedThreadPool(4, groupedThreads("foo", "bar"));
Charles Chan45c19d72018-04-19 21:38:40 -0700199 mgr.cfgService = createMock(ComponentConfigService.class);
200 mgr.deviceService = createMock(DeviceService.class);
201 mgr.driverService = createMock(DriverService.class);
Charles Chana7903c82018-03-15 20:14:16 -0700202 mgr.flowObjectiveStore = createMock(FlowObjectiveStore.class);
Charles Chan45c19d72018-04-19 21:38:40 -0700203 mgr.activate();
Charles Chana7903c82018-03-15 20:14:16 -0700204
Charles Chan45c19d72018-04-19 21:38:40 -0700205 reset(mgr.flowObjectiveStore);
206 timeout = false;
207 offset = DEFAULT_OFFSET;
208 bound = DEFAULT_BOUND;
Charles Chana7903c82018-03-15 20:14:16 -0700209 actualObjs.clear();
210 }
211
212 @Test
Charles Chan45c19d72018-04-19 21:38:40 -0700213 public void filter() {
Charles Chana7903c82018-03-15 20:14:16 -0700214 expectFiltObjs.forEach(filtObj -> mgr.filter(DEV1, filtObj));
215
216 // Wait for the pipeline operation to complete
Charles Chan45c19d72018-04-19 21:38:40 -0700217 int expectedTime = (bound + offset) * 7;
Charles Chana7903c82018-03-15 20:14:16 -0700218 assertAfter(expectedTime, expectedTime * 5, () -> assertEquals(expectFiltObjs.size(), actualObjs.size()));
219
220 assertTrue(actualObjs.indexOf(FILT1) < actualObjs.indexOf(FILT2));
221 assertTrue(actualObjs.indexOf(FILT2) < actualObjs.indexOf(FILT3));
222 assertTrue(actualObjs.indexOf(FILT3) < actualObjs.indexOf(FILT5));
223 assertTrue(actualObjs.indexOf(FILT5) < actualObjs.indexOf(FILT7));
224 assertTrue(actualObjs.indexOf(FILT4) < actualObjs.indexOf(FILT6));
225 }
226
227 @Test
Charles Chan45c19d72018-04-19 21:38:40 -0700228 public void forward() {
Charles Chana7903c82018-03-15 20:14:16 -0700229 expect(mgr.flowObjectiveStore.getNextGroup(NID1)).andReturn(NGRP1).times(3);
230 expect(mgr.flowObjectiveStore.getNextGroup(NID2)).andReturn(NGRP2).times(3);
231 replay(mgr.flowObjectiveStore);
232
233 expectFwdObjs.forEach(fwdObj -> mgr.forward(DEV1, fwdObj));
234
235 // Wait for the pipeline operation to complete
Charles Chan45c19d72018-04-19 21:38:40 -0700236 int expectedTime = (bound + offset) * 6;
Charles Chana7903c82018-03-15 20:14:16 -0700237 assertAfter(expectedTime, expectedTime * 5, () -> assertEquals(expectFwdObjs.size(), actualObjs.size()));
238
239 assertTrue(actualObjs.indexOf(FWD1) < actualObjs.indexOf(FWD3));
240 assertTrue(actualObjs.indexOf(FWD3) < actualObjs.indexOf(FWD5));
241 assertTrue(actualObjs.indexOf(FWD2) < actualObjs.indexOf(FWD4));
242 assertTrue(actualObjs.indexOf(FWD4) < actualObjs.indexOf(FWD6));
243
244 verify(mgr.flowObjectiveStore);
245 }
246
247 @Test
Charles Chan45c19d72018-04-19 21:38:40 -0700248 public void forwardTimeout() {
Ray Milkey95c9e0f2018-05-30 14:16:37 -0700249 expect(mgr.flowObjectiveStore.getNextGroup(NID1)).andReturn(NGRP1).times(2);
Charles Chan45c19d72018-04-19 21:38:40 -0700250 expect(mgr.flowObjectiveStore.getNextGroup(NID2)).andReturn(NGRP2).times(2);
251 replay(mgr.flowObjectiveStore);
252
253 // Force this objective to time out
254 offset = InOrderFlowObjectiveManager.OBJ_TIMEOUT_MS + 500;
255
256 expectFwdObjsTimeout.forEach(fwdObj -> mgr.forward(DEV1, fwdObj));
257
258 // Wait for the pipeline operation to complete
259 int expectedTime = (bound + offset) * 3;
260 assertAfter(expectedTime, expectedTime * 5, () -> assertEquals(expectFwdObjsTimeout.size(), actualObjs.size()));
261
262 assertTrue(timeout);
263 assertTrue(actualObjs.indexOf(FWD11) < actualObjs.indexOf(FWD1));
264
265 verify(mgr.flowObjectiveStore);
266 }
267
268 @Test
269 public void forwardPending() {
Charles Chana7903c82018-03-15 20:14:16 -0700270 // Note: current logic will double check if the next obj need to be queued
271 // it does not check when resubmitting pending next back to the queue
272 expect(mgr.flowObjectiveStore.getNextGroup(NID1)).andReturn(null).times(2);
273 expect(mgr.flowObjectiveStore.getNextGroup(NID2)).andReturn(null).times(2);
274 expect(mgr.flowObjectiveStore.getNextGroup(NID1)).andReturn(NGRP1).times(3);
275 expect(mgr.flowObjectiveStore.getNextGroup(NID2)).andReturn(NGRP2).times(3);
276 replay(mgr.flowObjectiveStore);
277
278 expectFwdObjs.forEach(fwdObj -> mgr.forward(DEV1, fwdObj));
279
280 // Trigger the next objectives
281 mgr.next(DEV1, NEXT1);
282 mgr.next(DEV1, NEXT2);
283
284 // Wait for the pipeline operation to complete
Charles Chan45c19d72018-04-19 21:38:40 -0700285 int expectedTime = (bound + offset) * 8;
Charles Chana7903c82018-03-15 20:14:16 -0700286 assertAfter(expectedTime, expectedTime * 5, () -> assertEquals(expectFwdObjs.size() + 2, actualObjs.size()));
287
288 assertTrue(actualObjs.indexOf(NEXT1) < actualObjs.indexOf(FWD1));
289 assertTrue(actualObjs.indexOf(FWD1) < actualObjs.indexOf(FWD3));
290 assertTrue(actualObjs.indexOf(FWD3) < actualObjs.indexOf(FWD5));
291 assertTrue(actualObjs.indexOf(NEXT2) < actualObjs.indexOf(FWD2));
292 assertTrue(actualObjs.indexOf(FWD2) < actualObjs.indexOf(FWD4));
293 assertTrue(actualObjs.indexOf(FWD4) < actualObjs.indexOf(FWD6));
294
295 verify(mgr.flowObjectiveStore);
296 }
297
298 @Test
Charles Chan45c19d72018-04-19 21:38:40 -0700299 public void next() {
Charles Chana7903c82018-03-15 20:14:16 -0700300 // Note: ADD operation won't query this
301 expect(mgr.flowObjectiveStore.getNextGroup(NID1)).andReturn(NGRP1).times(3);
302 expect(mgr.flowObjectiveStore.getNextGroup(NID2)).andReturn(NGRP2).times(3);
303 replay(mgr.flowObjectiveStore);
304
305 expectNextObjs.forEach(nextObj -> mgr.next(DEV1, nextObj));
306
307 // Wait for the pipeline operation to complete
Charles Chan45c19d72018-04-19 21:38:40 -0700308 int expectedTime = (bound + offset) * 8;
Charles Chana7903c82018-03-15 20:14:16 -0700309 assertAfter(expectedTime, expectedTime * 5, () -> assertEquals(expectNextObjs.size(), actualObjs.size()));
310
311 assertTrue(actualObjs.indexOf(NEXT1) < actualObjs.indexOf(NEXT3));
312 assertTrue(actualObjs.indexOf(NEXT3) < actualObjs.indexOf(NEXT5));
313 assertTrue(actualObjs.indexOf(NEXT5) < actualObjs.indexOf(NEXT7));
314 assertTrue(actualObjs.indexOf(NEXT2) < actualObjs.indexOf(NEXT4));
315 assertTrue(actualObjs.indexOf(NEXT4) < actualObjs.indexOf(NEXT6));
316 assertTrue(actualObjs.indexOf(NEXT6) < actualObjs.indexOf(NEXT8));
317
318 verify(mgr.flowObjectiveStore);
319 }
320
321 // FIXME We currently do not handle the case when an app sends edit/remove of a next id before add.
322 // The edit/remove operation will be queued by pendingNext, and the add operation will be
323 // queued by the ordering queue forever due to the deadlock. This can be improved by making
324 // pendingForwards, pendingNexts and ordering queue caches.
325 @Test
326 @Ignore("Not supported")
Charles Chan45c19d72018-04-19 21:38:40 -0700327 public void nextPending() {
Charles Chana7903c82018-03-15 20:14:16 -0700328 // Note: current logic will double check if the next obj need to be queued
329 // it does not check when resubmitting pending next back to the queue
330 expect(mgr.flowObjectiveStore.getNextGroup(NID1)).andReturn(null).times(6);
331 expect(mgr.flowObjectiveStore.getNextGroup(NID2)).andReturn(null).times(6);
332 replay(mgr.flowObjectiveStore);
333
334 expectNextObjsPending.forEach(nextObj -> mgr.next(DEV1, nextObj));
335
336 // Wait for the pipeline operation to complete
Charles Chan45c19d72018-04-19 21:38:40 -0700337 int expectedTime = (bound + offset) * 8;
Charles Chana7903c82018-03-15 20:14:16 -0700338 assertAfter(expectedTime, expectedTime * 5, () -> assertEquals(expectNextObjs.size(), actualObjs.size()));
339
340 assertTrue(actualObjs.indexOf(NEXT1) < actualObjs.indexOf(NEXT5));
341 assertTrue(actualObjs.indexOf(NEXT5) < actualObjs.indexOf(NEXT3));
342 assertTrue(actualObjs.indexOf(NEXT3) < actualObjs.indexOf(NEXT7));
343 assertTrue(actualObjs.indexOf(NEXT2) < actualObjs.indexOf(NEXT6));
344 assertTrue(actualObjs.indexOf(NEXT6) < actualObjs.indexOf(NEXT4));
345 assertTrue(actualObjs.indexOf(NEXT4) < actualObjs.indexOf(NEXT8));
346
347 verify(mgr.flowObjectiveStore);
348 }
349
350 /**
351 * Creates filtering objective builder with a serial number encoded in MPLS label.
352 * The serial number is used to identify same objective that occurs multiple times.
353 *
354 * @param portnum Port number
355 * @param vlanId VLAN Id
356 * @param mac MAC address
357 * @param serial Serial number
358 * @return Filtering objective builder
359 */
360 private static FilteringObjective.Builder buildFilteringObjective(PortNumber portnum, VlanId vlanId,
361 MacAddress mac, int serial) {
362 FilteringObjective.Builder fob = DefaultFilteringObjective.builder();
363 fob.withKey(Criteria.matchInPort(portnum))
364 .addCondition(Criteria.matchEthDst(mac))
365 .addCondition(Criteria.matchVlanId(VlanId.NONE))
366 .addCondition(Criteria.matchMplsLabel(MplsLabel.mplsLabel(serial)))
367 .withPriority(PRIORITY);
368
369 TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder();
370 tBuilder.pushVlan().setVlanId(vlanId);
371 fob.withMeta(tBuilder.build());
372
373 fob.permit().fromApp(APP_ID);
374 return fob;
375 }
376
377 /**
378 * Creates next objective builder.
379 *
380 * @param nextId next ID
381 * @param vlanId VLAN ID
382 * @param ports Set of ports that is in the given VLAN ID
383 *
384 * @return Next objective builder
385 */
386 private static NextObjective.Builder buildNextObjective(int nextId, VlanId vlanId, Collection<PortNumber> ports) {
387 TrafficSelector metadata =
388 DefaultTrafficSelector.builder().matchVlanId(vlanId).build();
389
390 NextObjective.Builder nextObjBuilder = DefaultNextObjective
391 .builder().withId(nextId)
392 .withType(NextObjective.Type.BROADCAST).fromApp(APP_ID)
393 .withMeta(metadata);
394
395 ports.forEach(port -> {
396 TrafficTreatment.Builder tBuilder = DefaultTrafficTreatment.builder();
397 tBuilder.popVlan();
398 tBuilder.setOutput(port);
399 nextObjBuilder.addTreatment(tBuilder.build());
400 });
401
402 return nextObjBuilder;
403 }
404
405 /**
406 * Creates forwarding objective builder.
407 *
408 * @param selector Traffic selector
409 * @param nextId next ID
410 * @return Forwarding objective builder
411 */
412 private static ForwardingObjective.Builder buildFwdObjective(TrafficSelector selector, int nextId) {
413 return DefaultForwardingObjective.builder()
414 .makePermanent()
415 .withSelector(selector)
416 .nextStep(nextId)
417 .fromApp(APP_ID)
418 .withPriority(PRIORITY)
419 .withFlag(ForwardingObjective.Flag.SPECIFIC);
420 }
421}