Discussion:
[Ryu-devel] rest_QOS port name when posting new queue
Fahmy Sherif Alaa Salaheldin
2017-07-18 14:18:25 UTC
Permalink
In the Ryu documentation this is written


# set a queue to the switches
# POST /qos/queue/{switch-id}
#
# request body format:
# {"port_name":"<name of port>",
# "type": "<linux-htb or linux-other>",
# "max-rate": "<int>",
# "queues":[{"max_rate": "<int>", "min_rate": "<int>"},...]}
#
# Note: This operation override
# previous configurations.
# Note: Queue configurations are available for
# OpenvSwitch.
# Note: port_name is optional argument.
# If does not pass the port_name argument,

# all ports are target for configuration.

I was wondering if this meant that we cannot configure each port separately.


For instance if I want to have 2 queues x,y on port s1-eth1 and 2 queues a,b,c on port s1-eth2, is that possible? if yes then in the flow rule what should the "actions" be (since we can only give "queue" and queue_id)!
Iwase Yusuke
2017-07-20 06:49:52 UTC
Permalink
Hi Sherif,
Post by Fahmy Sherif Alaa Salaheldin
In the Ryu documentation this is written
# set a queue to the switches
# POST /qos/queue/{switch-id}
#
# {"port_name":"<name of port>",
# "type": "<linux-htb or linux-other>",
# "max-rate": "<int>",
# "queues":[{"max_rate": "<int>", "min_rate": "<int>"},...]}
#
# Note: This operation override
# previous configurations.
# Note: Queue configurations are available for
# OpenvSwitch.
# Note: port_name is optional argument.
# If does not pass the port_name argument,
# all ports are target for configuration.
I was wondering if this meant that we cannot configure each port separately.
For instance if I want to have 2 queues x,y on port s1-eth1 and 2 queues a,b,c on port s1-eth2, is
that possible? if yes then in the flow rule what should the "actions" be (since we can only give
"queue" and queue_id)!
I guess "port_name" parameter enables to configure each port separately.
e.g.)
$ curl -X POST -d '{"port_name": "s1-eth1", "type": "linux-htb", "max_rate": "1000000", "queues":
[{"max_rate": "500000"}, {"min_rate": "800000"}]}' http://localhost:8080/qos/queue/0000000000000001
| jq .
[
{
"switch_id": "0000000000000001",
"command_result": {
"result": "success",
"details": {
"0": { # ----> Queue X
"config": {
"max-rate": "500000"
}
},
"1": { # ----> Queue Y
"config": {
"min-rate": "800000"
}
}
}
}
}
]

$ curl -X POST -d '{"port_name": "s1-eth2", "type": "linux-htb", "max_rate": "1000000", "queues":
[{"max_rate": "300000"}, {"max_rate": "500000"}, {"min_rate": "800000"}]}'
http://localhost:8080/qos/queue/0000000000000001 | jq .
[
{
"switch_id": "0000000000000001",
"command_result": {
"result": "success",
"details": {
"0": { # ----> Queue A
"config": {
"max-rate": "300000"
}
},
"1": { # ----> Queue B
"config": {
"max-rate": "500000"
}
},
"2": { # ----> Queue C
"config": {
"min-rate": "800000"
}
}
}
}
}
]

For "queue_id" in OFPActionSetQueue, please specify Queue ID corresponding to each port.

http://ryu.readthedocs.io/en/latest/ofproto_v1_3_ref.html#ryu.ofproto.ofproto_v1_3_parser.OFPActionSetQueue
e.g.)
If you want to output packets to Queue A:
actions = [parser.OFPActionSetQueue(queue_id=0),
parser.OFPActionOutput(2)] # assume "s1-eth2" has "port_no=2"


Thanks,
Iwase
Post by Fahmy Sherif Alaa Salaheldin
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
https://lists.sourceforge.net/lists/listinfo/ryu-devel
Loading...