I'm very new to sdn and virtualization world
after a lot of headache, I finally could do a successful GET request to
http://127.0.0.1:8181/rests/data/opendaylight-inventory:nodes
but when I tried to add flows it never works.
the problem is that most of the actual useful docs or links are either for older releases which still use
- old features
- old urls like restconf/...
either the links are just broken, and the official documentation is not very beginner-friendly.
however I tried:
if I send to http://127.0.0.1:8181/rests/data/opendaylight-inventory:nodes/node=openflow:1/table=0/flow=1
via put or post it says:
"error-tag": "data-missing",
"error-message": "Schema for '(urn:opendaylight:inventory?revision=2013年08月19日)table' not found"
if I send to http://127.0.0.1:8181/rests/data/opendaylight-inventory:nodes/node=openflow:1/flow-node-inventory:table=0/flow=1
via put it says:
500 Server Error
via post it says :
"error-tag": "malformed-message",
"error-info": "Schema node with name in_port was not found under (urn:opendaylight:flow:inventory?revision=2013年08月19日)match.",
"error-message": "Error parsing input: Schema node with name in_port was not found under (urn:opendaylight:flow:inventory?revision=2013年08月19日)match."
I did on the parameter "in_port" :
"match": {
"in_port": "openflow:1:1",
I tried to send to that link first because I saw it somewhere on stack exchange
second because I at least could access http://127.0.0.1:8181/rests/data/opendaylight-inventory:nodes/node=openflow:1/flow-node-inventory:table=0
and see its content on the browser
I know I'm lacking a lot and it might look like a mess to you, but I really am very new to this but I need to configure flow rules as soon as possible,I keep looking everywhere but it's really hard to get this without a good background on networking, please help and thanks in advance.
if I need to add more information like what features did I install, and how much nodes are there please tell me to add it.
2 Answers 2
BTW, there is a new guide that describes how to configure OpenDaylight and add flows for an SDN network. You may find it here:
http://repositorioinstitucional.uaslp.mx/xmlui/handle/i/8772
1 Comment
To add a flow in ODL, it is necessary to define the flow in a JSON or XML file and to provide the instruction where the flow needs to be installed. For example, if you want to add flow 12, at table 0 in node openflow:1 and the flow is defined at file myflow12.json, you may use the following instruction:
curl -u admin:admin -X PUT -d "@myflow12.json" -H "Content-Type: application/json" http://127.0.0.1:8181/rests/data/opendaylight-inventory:nodes/node=openflow:1/flow-node-inventory:table=0/flow=12
Additionally, you need to provide the myflow12.json file with flow instructions. An example of a flow that instructs openflow:1 to flood all packets received at port 3 would be:
{
"flow": [
{
"table_id": 0,
"id": "12",
"priority": "1001",
"match": {
"in-port": "openflow:1:3"
},
"instructions": {
"instruction": [
{
"order": 0,
"apply-actions": {
"action": [
{
"order": 0,
"output-action": {
"output-node-connector": "FLOOD"
}
}
]
}
}
]
}
}
]
}
Notice that table_id and id (flow id) match the restconf instruction.