Hi Clément,
On 2014年12月10日 22:30, Clément Rault wrote:
> Hi,
>
> It there a way to force the actions present in the actions set to be
> immediately applied?
If you use Apply-Actions instruction, please describe the "action" directly
in actions array.
e.g.)
curl -X POST -d '{
"dpid": 1,
"match":{
"dl_vlan": 5
},
"actions":[
{
"type": "PUSH_VLAN", # Push a new VLAN tag if a input frame
is non-VLAN-tagged
"ethertype": 33024 # Ethertype 0x8100(=33024): IEEE 802.1Q
VLAN-tagged frame
},
{
"type": "SET_FIELD",
"field": "vlan_vid", # Set VLAN ID
"value": 4102 # Describe sum of vlan_id(e.g. 6) |
OFPVID_PRESENT(0x1000=4096)
},
{
"type": "OUTPUT",
"port": 2
}
]
}' http://localhost:8080/stats/flowentry/add
For more details, please refer to "Description of Actions on request messages"
(http://ryu.readthedocs.org/en/latest/app/ofctl_rest.html#description-of-actions-on-request-messages)
>
> It's quite important for me to be able to do that so that I can use
> the metadata to communicate between tables but I couldn't find it in
> the documentation
> (http://ryu.readthedocs.org/en/latest/app/ofctl_rest.html).
How about this scinario?
I hope it is helpful for you.
1.Build topology
$ sudo mn --topo single,2 --mac --switch ovsk --controller remote
2.Run ofctl_rest
$ sudo ryu-manager ryu.app.ofctl_rest
3.Install Flow entries
# Install the Flow entries to communicate between table 0 and table 1.
$ curl -X POST -d '{
"dpid": "1",
"table_id": 0, # The 1st table
"match":{
"in_port":1 # From Host 1
},
"actions":[
{
"type": "WRITE_METADATA", # Write metadata.
"metadata": 0x1, # e.g.) "0x1" which shows in_port value
"metadata_mask": 0x3
},
{
"type": "GOTO_TABLE", # Describe next table
"table_id": 1
}
]
}' http://localhost:8080/stats/flowentry/add
$ curl -X POST -d '{
"dpid": "1",
"table_id": 0, # The 1st table
"match":{
"in_port":2 # From Host 2
},
"actions":[
{
"type": "WRITE_METADATA", # Write metadata.
"metadata": 0x2, # e.g.) "0x2" which shows in_port value
"metadata_mask": 0x3
},
{
"type": "GOTO_TABLE", # Describe next table
"table_id": 1
}
]
}' http://localhost:8080/stats/flowentry/add
# Install the Flow entries which use metadata to detect in_port.
$ curl -X POST -d '{
"dpid": "1",
"table_id": 1, # The 2nd table
"match":{
"metadata": "0x1/0x03" # "0x1/0x03" means in_port value is "1"
},
"actions":[
{
"type": "OUTPUT", # Output to Host 2
"port": 2
}
]
}' http://localhost:8080/stats/flowentry/add
$ curl -X POST -d '{
"dpid": "1",
"table_id": 1, # The 2nd table
"match":{
"metadata": "0x2/0x03" # "0x2/0x03" means in_port value is "2"
},
"actions":[
{
"type": "OUTPUT", # Output to Host 1
"port": 1
}
]
}' http://localhost:8080/stats/flowentry/add
3.Confirm Flow entries
$ curl -X GET http://localhost:8080/stats/flow/1 | jq .
4.Ping test
mininet> h1 ping h2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.915 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.043 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.049 ms
...
Tips for the above commands is described in the documentation.
(http://ryu.readthedocs.org/en/latest/app/ofctl_rest.html)
Thanks
>
> Thanks in advance.
> Best,
> Clément
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel