Comments (6)
The error message seems suggesting that we should omit the entire match field instead of using wildcard mask.
Have you tried removing the entire match field on hdr.ethernet.dst
?
from ngsdn-tutorial.
I have removed hdr.ethernet.dst
, so the criterion looks like this:
final PiCriterion unmatchedTrafficCriterion = PiCriterion.builder() .matchTernary( PiMatchFieldId.of(""), MacAddress.valueOf("00:00:00:00:00:00").toBytes(), MacAddress.valueOf("00:00:00:00:00:00").toBytes()) .build();
In the result I have received this exception in onos logs:
Exception in thread "pool-13-thread-3" java.lang.IllegalArgumentException: Name cannot be empty at com.google.common.base.Preconditions.checkArgument(Preconditions.java:134) at org.onosproject.net.pi.model.PiMatchFieldId.of(PiMatchFieldId.java:43) at org.onosproject.ngsdn.tutorial.L2BridgingComponent.insertUnmatchedBridgingFlowRule(L2BridgingComponent.java:274) at org.onosproject.ngsdn.tutorial.L2BridgingComponent.setUpDevice(L2BridgingComponent.java:158) at org.onosproject.ngsdn.tutorial.L2BridgingComponent.lambda$setUpAllDevices$2(L2BridgingComponent.java:496) at com.google.common.collect.Iterables$4.lambda$forEach$0(Iterables.java:584) at java.base/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4772) at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085) at com.google.common.collect.Iterables$4.forEach(Iterables.java:581) at org.onosproject.ngsdn.tutorial.L2BridgingComponent.setUpAllDevices(L2BridgingComponent.java:493) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)
There is no way to omit entire object of PiMatchFieldID.of() because in PiCriterion which is used in L2BridingComponent.java all versions of matchTernary() function require 3 arguments. I really don't understand why it doesn't work despite it is a tutorial.
from ngsdn-tutorial.
I was suggesting skipping the entire ethernet dst match field. Something like this:
final PiCriterion unmatchedTrafficCriterion = PiCriterion.builder().build();
This should theoretically create a "catch all" match
from ngsdn-tutorial.
I checked your suggestion but I get:
Exception in thread "pool-13-thread-3" java.lang.IllegalArgumentException: Cannot build PI criterion with 0 field matches at com.google.common.base.Preconditions.checkArgument(Preconditions.java:134) at org.onosproject.net.flow.criteria.PiCriterion$Builder.build(PiCriterion.java:334) at org.onosproject.ngsdn.tutorial.L2BridgingComponent.insertUnmatchedBridgingFlowRule(L2BridgingComponent.java:272) at org.onosproject.ngsdn.tutorial.L2BridgingComponent.setUpDevice(L2BridgingComponent.java:158) at org.onosproject.ngsdn.tutorial.L2BridgingComponent.lambda$setUpAllDevices$2(L2BridgingComponent.java:491) at com.google.common.collect.Iterables$4.lambda$forEach$0(Iterables.java:584) at java.base/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4772) at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085) at com.google.common.collect.Iterables$4.forEach(Iterables.java:581) at org.onosproject.ngsdn.tutorial.L2BridgingComponent.setUpAllDevices(L2BridgingComponent.java:488) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
from ngsdn-tutorial.
Hmm... alright, looks like it doesn't like it either. Will need to take a closer look to figure out why the original PiCriterion get rejected.
from ngsdn-tutorial.
Hi @makrofag1, you are describing the case where an app wants to modify a table's default action, which is equivalent to a flow rule with all match fields set to "don't care". To create such a flow rule, you simply need to omit adding a selector when invoking the flow rule builder. Unfortunately, in this tutorial we use the utility method buildFlowRule
which always adds a selector:
You could solve this by creating a different utility method that looks like this:
public static FlowRule buildFlowRuleDefaultAction(DeviceId switchId, ApplicationId appId,
String tableId, PiTableAction piAction) {
return DefaultFlowRule.builder()
.forDevice(switchId)
.forTable(PiTableId.of(tableId))
.fromApp(appId)
.withPriority(DEFAULT_FLOW_RULE_PRIORITY)
.makePermanent(
.withTreatment(DefaultTrafficTreatment.builder()
.piTableAction(piAction).build())
.build();
}
from ngsdn-tutorial.
Related Issues (20)
- help!QAQ
- Problem running the onos-cli in Excercise 3 HOT 6
- Ternary Match Issue in Advanced Branch
- Custom Topologies HOT 1
- Iperf UDP in Exercise 7 HOT 2
- New Entry in Table overriding the previous one
- pingall not working but ping works after Exercise 1
- How to create my own Topology? HOT 1
- Error pushing the netcfg to the controller HOT 5
- branch master - mininet container exit issue HOT 1
- [ASK] about to push p4 switch to ELK server HOT 1
- [ASK] how logging packet_in packet_out?
- Can I use the ONOS app in Excersice 5 for IPv4?
- Problem running make netcfg
- Are member variables in ONOS Component Classes thread safe and persistent. (Question)
- The mininet container cannot use xterm and wireshark HOT 5
- pushing netcfg when using IPv4 topology on mininet HOT 1
- Service Function Chaining Implementation
- The clone operation results in a very large number of packets
- Links are not showing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngsdn-tutorial.