Discussion:
[Ryu-devel] Installing multiple flows in parrallel
corey ross
2017-06-17 11:47:39 UTC
Permalink
Hey there,
I was wondering if it is possible to install multiple flows in parallel, if
yes how?

for e.g if I have a topology of three switches (s1, s2, s3), I want to
install flow-rules f1 on s1, f2 on s2 and f3 on s3. How can I install this
three flow rules in parallel instead of doing so in serial fashion?

I have searched around and It seems that using threads is not an effective
way.
Iwase Yusuke
2017-06-19 00:26:36 UTC
Permalink
Hi,
Post by corey ross
Hey there,
I was wondering if it is possible to install multiple flows in parallel, if yes how?
for e.g if I have a topology of three switches (s1, s2, s3), I want to install flow-rules f1 on s1, f2 on s2 and f3 on s3. How can I install this three flow rules in parallel instead of doing so in serial fashion?
I have searched around and It seems that using threads is not an effective way.
Please let me make your question more clear.
What does "in parallel" and "in serial" exactly mean?

You mean; you currently uses multi-thread (using "ryu.lib.hub" or "eventlet"),
but some post you read says "multi-thread on Python is not effective enough",
right?
If so, are you facing the performance limit, for example?

Or, you want to get "Datapath" instance for s2 and s3, when you get event from
s1?

Thanks,
Iwase
Post by corey ross
------------------------------------------------------------------------------
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
corey ross
2017-06-19 10:44:00 UTC
Permalink
Yes I am referring to the first statement "multi-thread on Python is not
effective enough"...

Please let me give another example to make my question more clear
Lets say the routing algorithm wants to update the paths on switch S1, S2,
S3. One way is to update all the switches at time 0 (in parallel), and the
other way is to update s1 at time 0, s2 at time 1, and s3 at time 3
(serial).

Because of GIL in python a thread has to finish its task before moving to
another thread; with this in mind I believe using threads will update the
switches in serial; because the first thread has to finish installing the
rules on s1, then it moves to the next thread to install the rules on s2
and so on....

So my question is in Ryu what mechanism I can use to update s1, s2, s3 at
time 0 (in one go)?
I hope my question is more clear now.


Thank you all for your time,
Corry
Post by corey ross
Hi,
Post by corey ross
Hey there,
I was wondering if it is possible to install multiple flows in parallel,
if yes how?
Post by corey ross
for e.g if I have a topology of three switches (s1, s2, s3), I want to
install flow-rules f1 on s1, f2 on s2 and f3 on s3. How can I install this
three flow rules in parallel instead of doing so in serial fashion?
Post by corey ross
I have searched around and It seems that using threads is not an
effective way.
Please let me make your question more clear.
What does "in parallel" and "in serial" exactly mean?
You mean; you currently uses multi-thread (using "ryu.lib.hub" or "eventlet"),
but some post you read says "multi-thread on Python is not effective enough",
right?
If so, are you facing the performance limit, for example?
Or, you want to get "Datapath" instance for s2 and s3, when you get event from
s1?
Thanks,
Iwase
Post by corey ross
------------------------------------------------------------
------------------
Post by corey ross
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
Yi Tseng
2017-06-20 18:14:52 UTC
Permalink
Hi,

I think we have some similar thread before:
https://sourceforge.net/p/ryu/mailman/ryu-devel/thread/CAM5MNiVPXW3xWeoHPMriXvSKkUnAHbgv6LqRZ%2BrE5rOZqDKaLQ%40mail.gmail.com/#msg35801377

Basically, I would suggest using multiple Ryu instance(process) to install
flows to switch.
Post by corey ross
Yes I am referring to the first statement "multi-thread on Python is not
effective enough"...
Please let me give another example to make my question more clear
Lets say the routing algorithm wants to update the paths on switch S1, S2,
S3. One way is to update all the switches at time 0 (in parallel), and the
other way is to update s1 at time 0, s2 at time 1, and s3 at time 3
(serial).
Because of GIL in python a thread has to finish its task before moving to
another thread; with this in mind I believe using threads will update the
switches in serial; because the first thread has to finish installing the
rules on s1, then it moves to the next thread to install the rules on s2
and so on....
So my question is in Ryu what mechanism I can use to update s1, s2, s3 at
time 0 (in one go)?
I hope my question is more clear now.
Thank you all for your time,
Corry
Post by corey ross
Hi,
Post by corey ross
Hey there,
I was wondering if it is possible to install multiple flows in
parallel, if yes how?
Post by corey ross
for e.g if I have a topology of three switches (s1, s2, s3), I want to
install flow-rules f1 on s1, f2 on s2 and f3 on s3. How can I install this
three flow rules in parallel instead of doing so in serial fashion?
Post by corey ross
I have searched around and It seems that using threads is not an
effective way.
Please let me make your question more clear.
What does "in parallel" and "in serial" exactly mean?
You mean; you currently uses multi-thread (using "ryu.lib.hub" or "eventlet"),
but some post you read says "multi-thread on Python is not effective enough",
right?
If so, are you facing the performance limit, for example?
Or, you want to get "Datapath" instance for s2 and s3, when you get event from
s1?
Thanks,
Iwase
Post by corey ross
------------------------------------------------------------
------------------
Post by corey ross
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
------------------------------------------------------------
------------------
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
--
Yi Tseng (a.k.a Takeshi)
Taiwan National Chiao Tung University
Department of Computer Science
W2CNLab

https://takeshi.tw
Iwase Yusuke
2017-06-21 01:48:13 UTC
Permalink
Hi Corry and Yi,
Post by Yi Tseng
Hi,
https://sourceforge.net/p/ryu/mailman/ryu-devel/thread/CAM5MNiVPXW3xWeoHPMriXvSKkUnAHbgv6LqRZ%2BrE5rOZqDKaLQ%40mail.gmail.com/#msg35801377
Basically, I would suggest using multiple Ryu instance(process) to install flows to switch.
Thanks Yi!
Yes, I guess it is the best way to use multiple instances.
The architecture might become complex though.

Just an idea, I am wondering if we could use "multiprocessing" module...

Thanks,
Iwase
Post by Yi Tseng
Yes I am referring to the first statement "multi-thread on Python is not effective enough"...
Please let me give another example to make my question more clear
Lets say the routing algorithm wants to update the paths on switch S1, S2, S3. One way is to update all the switches at time 0 (in parallel), and the other way is to update s1 at time 0, s2 at time 1, and s3 at time 3 (serial).
Because of GIL in python a thread has to finish its task before moving to another thread; with this in mind I believe using threads will update the switches in serial; because the first thread has to finish installing the rules on s1, then it moves to the next thread to install the rules on s2 and so on....
So my question is in Ryu what mechanism I can use to update s1, s2, s3 at time 0 (in one go)?
I hope my question is more clear now.
Thank you all for your time,
Corry
Hi,
Post by corey ross
Hey there,
I was wondering if it is possible to install multiple flows in parallel, if yes how?
for e.g if I have a topology of three switches (s1, s2, s3), I want to install flow-rules f1 on s1, f2 on s2 and f3 on s3. How can I install this three flow rules in parallel instead of doing so in serial fashion?
I have searched around and It seems that using threads is not an effective way.
Please let me make your question more clear.
What does "in parallel" and "in serial" exactly mean?
You mean; you currently uses multi-thread (using "ryu.lib.hub" or "eventlet"),
but some post you read says "multi-thread on Python is not effective enough",
right?
If so, are you facing the performance limit, for example?
Or, you want to get "Datapath" instance for s2 and s3, when you get event from
s1?
Thanks,
Iwase
Post by corey ross
------------------------------------------------------------------------------
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 <https://lists.sourceforge.net/lists/listinfo/ryu-devel>
------------------------------------------------------------------------------
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 <https://lists.sourceforge.net/lists/listinfo/ryu-devel>
--
Yi Tseng (a.k.a Takeshi)
Taiwan National Chiao Tung University
Department of Computer Science
W2CNLab
https://takeshi.tw
------------------------------------------------------------------------------
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
Yi Tseng
2017-06-21 20:18:04 UTC
Permalink
Hi Iwase,

I am not sure we can do that with multiprocessing module.

Might need to change Ryu event mechanism to do that (e.g. need to send
events to different process...)

Yi
Post by Iwase Yusuke
Hi Corry and Yi,
Post by Yi Tseng
Hi,
https://sourceforge.net/p/ryu/mailman/ryu-devel/thread/
CAM5MNiVPXW3xWeoHPMriXvSKkUnAHbgv6LqRZ%2BrE5rOZqDKaLQ%
40mail.gmail.com/#msg35801377
Post by Yi Tseng
Basically, I would suggest using multiple Ryu instance(process) to
install flows to switch.
Thanks Yi!
Yes, I guess it is the best way to use multiple instances.
The architecture might become complex though.
Just an idea, I am wondering if we could use "multiprocessing" module...
Thanks,
Iwase
Post by Yi Tseng
Yes I am referring to the first statement "multi-thread on Python is
not effective enough"...
Post by Yi Tseng
Please let me give another example to make my question more clear
Lets say the routing algorithm wants to update the paths on switch
S1, S2, S3. One way is to update all the switches at time 0 (in parallel),
and the other way is to update s1 at time 0, s2 at time 1, and s3 at time 3
(serial).
Post by Yi Tseng
Because of GIL in python a thread has to finish its task before
moving to another thread; with this in mind I believe using threads will
update the switches in serial; because the first thread has to finish
installing the rules on s1, then it moves to the next thread to install the
rules on s2 and so on....
Post by Yi Tseng
So my question is in Ryu what mechanism I can use to update s1, s2,
s3 at time 0 (in one go)?
Post by Yi Tseng
I hope my question is more clear now.
Thank you all for your time,
Corry
On Mon, Jun 19, 2017 at 5:26 AM, Iwase Yusuke <
Hi,
Post by corey ross
Hey there,
I was wondering if it is possible to install multiple flows in
parallel, if yes how?
Post by Yi Tseng
Post by corey ross
for e.g if I have a topology of three switches (s1, s2, s3), I
want to install flow-rules f1 on s1, f2 on s2 and f3 on s3. How can I
install this three flow rules in parallel instead of doing so in serial
fashion?
Post by Yi Tseng
Post by corey ross
I have searched around and It seems that using threads is not
an effective way.
Post by Yi Tseng
Please let me make your question more clear.
What does "in parallel" and "in serial" exactly mean?
You mean; you currently uses multi-thread (using "ryu.lib.hub"
or "eventlet"),
Post by Yi Tseng
but some post you read says "multi-thread on Python is not
effective enough",
Post by Yi Tseng
right?
If so, are you facing the performance limit, for example?
Or, you want to get "Datapath" instance for s2 and s3, when you
get event from
Post by Yi Tseng
s1?
Thanks,
Iwase
Post by corey ross
------------------------------------------------------------
------------------
Post by Yi Tseng
Post by corey ross
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
sourceforge.net>
Post by Yi Tseng
Post by corey ross
https://lists.sourceforge.net/lists/listinfo/ryu-devel <
https://lists.sourceforge.net/lists/listinfo/ryu-devel>
Post by Yi Tseng
------------------------------------------------------------
------------------
Post by Yi Tseng
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
sourceforge.net>
Post by Yi Tseng
https://lists.sourceforge.net/lists/listinfo/ryu-devel <
https://lists.sourceforge.net/lists/listinfo/ryu-devel>
Post by Yi Tseng
--
Yi Tseng (a.k.a Takeshi)
Taiwan National Chiao Tung University
Department of Computer Science
W2CNLab
https://takeshi.tw
------------------------------------------------------------
------------------
Post by Yi Tseng
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
--
Yi Tseng (a.k.a Takeshi)
Taiwan National Chiao Tung University
Department of Computer Science
W2CNLab

https://takeshi.tw
Iwase Yusuke
2017-06-22 02:47:16 UTC
Permalink
Hi Yi,
Post by Yi Tseng
Hi Iwase,
I am not sure we can do that with multiprocessing module.
Might need to change Ryu event mechanism to do that (e.g. need to send events to different process...)
Yes you are right.
I tried to use multiprocessing module a little, I found we need to some modification on Ryu core.
So this is just an idea.

Thanks,
Iwase
Post by Yi Tseng
Yi
Hi Corry and Yi,
Hi,
https://sourceforge.net/p/ryu/mailman/ryu-devel/thread/CAM5MNiVPXW3xWeoHPMriXvSKkUnAHbgv6LqRZ%2BrE5rOZqDKaLQ%40mail.gmail.com/#msg35801377 <https://sourceforge.net/p/ryu/mailman/ryu-devel/thread/CAM5MNiVPXW3xWeoHPMriXvSKkUnAHbgv6LqRZ%2BrE5rOZqDKaLQ%40mail.gmail.com/#msg35801377>
Basically, I would suggest using multiple Ryu instance(process) to install flows to switch.
Thanks Yi!
Yes, I guess it is the best way to use multiple instances.
The architecture might become complex though.
Just an idea, I am wondering if we could use "multiprocessing" module...
Thanks,
Iwase
Yes I am referring to the first statement "multi-thread on Python is not effective enough"...
Please let me give another example to make my question more clear
Lets say the routing algorithm wants to update the paths on switch S1, S2, S3. One way is to update all the switches at time 0 (in parallel), and the other way is to update s1 at time 0, s2 at time 1, and s3 at time 3 (serial).
Because of GIL in python a thread has to finish its task before moving to another thread; with this in mind I believe using threads will update the switches in serial; because the first thread has to finish installing the rules on s1, then it moves to the next thread to install the rules on s2 and so on....
So my question is in Ryu what mechanism I can use to update s1, s2, s3 at time 0 (in one go)?
I hope my question is more clear now.
Thank you all for your time,
Corry
Hi,
Post by corey ross
Hey there,
I was wondering if it is possible to install multiple flows in parallel, if yes how?
for e.g if I have a topology of three switches (s1, s2, s3), I want to install flow-rules f1 on s1, f2 on s2 and f3 on s3. How can I install this three flow rules in parallel instead of doing so in serial fashion?
I have searched around and It seems that using threads is not an effective way.
Please let me make your question more clear.
What does "in parallel" and "in serial" exactly mean?
You mean; you currently uses multi-thread (using "ryu.lib.hub" or "eventlet"),
but some post you read says "multi-thread on Python is not effective enough",
right?
If so, are you facing the performance limit, for example?
Or, you want to get "Datapath" instance for s2 and s3, when you get event from
s1?
Thanks,
Iwase
Post by corey ross
------------------------------------------------------------------------------
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 <https://lists.sourceforge.net/lists/listinfo/ryu-devel> <https://lists.sourceforge.net/lists/listinfo/ryu-devel <https://lists.sourceforge.net/lists/listinfo/ryu-devel>>
------------------------------------------------------------------------------
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 <https://lists.sourceforge.net/lists/listinfo/ryu-devel> <https://lists.sourceforge.net/lists/listinfo/ryu-devel <https://lists.sourceforge.net/lists/listinfo/ryu-devel>>
--
Yi Tseng (a.k.a Takeshi)
Taiwan National Chiao Tung University
Department of Computer Science
W2CNLab
https://takeshi.tw
------------------------------------------------------------------------------
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 <https://lists.sourceforge.net/lists/listinfo/ryu-devel>
--
Yi Tseng (a.k.a Takeshi)
Taiwan National Chiao Tung University
Department of Computer Science
W2CNLab
https://takeshi.tw
corey ross
2017-06-28 09:58:36 UTC
Permalink
Thank you all for your replies...
Yes, It seems the multiprocess module doesn't work properly in ryu...
I did some experiment with multiprocess and Thread modules also without any
threading.

when I used multiprocess module none of the rules got installed on the
switches, and with threads it did work and the rules were installed
successful; however the best result -- fastest result -- was installing
the rules without any threading ( can any one tell me why?? )


I am not good in programming but I am curious to know what should I change
in Ryu core to allow multiprocess to work?

Yi Tseng using multiple instance of Ryu works but if I want to install
large number of flows in parallel it would be infeasible ( it will have
high overhead )

If anyone has any suggestion and solution I would appreciate it.
Post by Iwase Yusuke
Hi Yi,
Post by Yi Tseng
Hi Iwase,
I am not sure we can do that with multiprocessing module.
Might need to change Ryu event mechanism to do that (e.g. need to send
events to different process...)
Yes you are right.
I tried to use multiprocessing module a little, I found we need to some
modification on Ryu core.
So this is just an idea.
Thanks,
Iwase
Post by Yi Tseng
Yi
Hi Corry and Yi,
Post by Yi Tseng
Hi,
https://sourceforge.net/p/ryu/mailman/ryu-devel/thread/
CAM5MNiVPXW3xWeoHPMriXvSKkUnAHbgv6LqRZ%2BrE5rOZqDKaLQ%
40mail.gmail.com/#msg35801377 <https://sourceforge.net/p/
ryu/mailman/ryu-devel/thread/CAM5MNiVPXW3xWeoHPMriXvSKkUnAH
bgv6LqRZ%2BrE5rOZqDKaLQ%40mail.gmail.com/#msg35801377>
Post by Yi Tseng
Post by Yi Tseng
Basically, I would suggest using multiple Ryu instance(process) to
install flows to switch.
Post by Yi Tseng
Thanks Yi!
Yes, I guess it is the best way to use multiple instances.
The architecture might become complex though.
Just an idea, I am wondering if we could use "multiprocessing"
module...
Post by Yi Tseng
Thanks,
Iwase
Post by Yi Tseng
Yes I am referring to the first statement "multi-thread on
Python is not effective enough"...
Post by Yi Tseng
Post by Yi Tseng
Please let me give another example to make my question more
clear
Post by Yi Tseng
Post by Yi Tseng
Lets say the routing algorithm wants to update the paths on
switch S1, S2, S3. One way is to update all the switches at time 0 (in
parallel), and the other way is to update s1 at time 0, s2 at time 1, and
s3 at time 3 (serial).
Post by Yi Tseng
Post by Yi Tseng
Because of GIL in python a thread has to finish its task
before moving to another thread; with this in mind I believe using threads
will update the switches in serial; because the first thread has to finish
installing the rules on s1, then it moves to the next thread to install the
rules on s2 and so on....
Post by Yi Tseng
Post by Yi Tseng
So my question is in Ryu what mechanism I can use to update
s1, s2, s3 at time 0 (in one go)?
Post by Yi Tseng
Post by Yi Tseng
I hope my question is more clear now.
Thank you all for your time,
Corry
On Mon, Jun 19, 2017 at 5:26 AM, Iwase Yusuke <
Hi,
Post by corey ross
Hey there,
I was wondering if it is possible to install multiple
flows in parallel, if yes how?
Post by Yi Tseng
Post by Yi Tseng
Post by corey ross
for e.g if I have a topology of three switches (s1, s2,
s3), I want to install flow-rules f1 on s1, f2 on s2 and f3 on s3. How can
I install this three flow rules in parallel instead of doing so in serial
fashion?
Post by Yi Tseng
Post by Yi Tseng
Post by corey ross
I have searched around and It seems that using threads
is not an effective way.
Post by Yi Tseng
Post by Yi Tseng
Please let me make your question more clear.
What does "in parallel" and "in serial" exactly mean?
You mean; you currently uses multi-thread (using
"ryu.lib.hub" or "eventlet"),
Post by Yi Tseng
Post by Yi Tseng
but some post you read says "multi-thread on Python is not
effective enough",
Post by Yi Tseng
Post by Yi Tseng
right?
If so, are you facing the performance limit, for example?
Or, you want to get "Datapath" instance for s2 and s3,
when you get event from
Post by Yi Tseng
Post by Yi Tseng
s1?
Thanks,
Iwase
Post by corey ross
------------------------------
------------------------------------------------
Post by Yi Tseng
Post by Yi Tseng
Post by corey ross
Check out the vibrant tech community on one of the
world's most
Post by Yi Tseng
Post by Yi Tseng
Post by corey ross
engaging tech sites, Slashdot.org!
http://sdm.link/slashdot
Post by Yi Tseng
Post by Yi Tseng
Post by corey ross
_______________________________________________
Ryu-devel mailing list
https://lists.sourceforge.net/lists/listinfo/ryu-devel <
https://lists.sourceforge.net/lists/listinfo/ryu-devel> <
https://lists.sourceforge.net/lists/listinfo/ryu-devel <
https://lists.sourceforge.net/lists/listinfo/ryu-devel>>
Post by Yi Tseng
Post by Yi Tseng
------------------------------------------------------------
------------------
Post by Yi Tseng
Post by Yi Tseng
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 <
https://lists.sourceforge.net/lists/listinfo/ryu-devel> <
https://lists.sourceforge.net/lists/listinfo/ryu-devel <
https://lists.sourceforge.net/lists/listinfo/ryu-devel>>
Post by Yi Tseng
Post by Yi Tseng
--
Yi Tseng (a.k.a Takeshi)
Taiwan National Chiao Tung University
Department of Computer Science
W2CNLab
https://takeshi.tw
------------------------------------------------------------
------------------
Post by Yi Tseng
Post by Yi Tseng
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
sourceforge.net>
Post by Yi Tseng
Post by Yi Tseng
https://lists.sourceforge.net/lists/listinfo/ryu-devel <
https://lists.sourceforge.net/lists/listinfo/ryu-devel>
Post by Yi Tseng
--
Yi Tseng (a.k.a Takeshi)
Taiwan National Chiao Tung University
Department of Computer Science
W2CNLab
https://takeshi.tw
Iwase Yusuke
2017-06-30 00:43:23 UTC
Permalink
Hi Corry,
Post by corey ross
Thank you all for your replies...
Yes, It seems the multiprocess module doesn't work properly in ryu...
I did some experiment with multiprocess and Thread modules also without any threading.
when I used multiprocess module none of the rules got installed on the switches,
I had the same problem when using multiprocess module.
I guess we need to share socket file descriptors of datapath between subprocesses,
but sorry I had no luck.
Post by corey ross
and with threads it did work and the rules were installed successful;
however the best result -- fastest result -- was
installing the rules without any threading ( can any one tell me why?? )
With too many threads, it should take some overhead to switch a thread to another
thread. Each of this overhead is not so high, but the number of thread becomes
larger, and it will become to be non-ignorable.


Thanks,
Iwase
Post by corey ross
I am not good in programming but I am curious to know what should I change in Ryu core to allow
multiprocess to work?
Yi Tseng using multiple instance of Ryu works but if I want to install large number of flows in
parallel it would be infeasible ( it will have high overhead )
If anyone has any suggestion and solution I would appreciate it.
Hi Yi,
Post by Yi Tseng
Hi Iwase,
I am not sure we can do that with multiprocessing module.
Might need to change Ryu event mechanism to do that (e.g. need to send events to different process...)
Yes you are right.
I tried to use multiprocessing module a little, I found we need to some modification on Ryu core.
So this is just an idea.
Thanks,
Iwase
Post by Yi Tseng
Yi
Hi Corry and Yi,
Post by Yi Tseng
Hi,
https://sourceforge.net/p/ryu/mailman/ryu-devel/thread/CAM5MNiVPXW3xWeoHPMriXvSKkUnAHbgv6LqRZ%2BrE5rOZqDKaLQ%40mail.gmail.com/#msg35801377
<https://sourceforge.net/p/ryu/mailman/ryu-devel/thread/CAM5MNiVPXW3xWeoHPMriXvSKkUnAHbgv6LqRZ%2BrE5rOZqDKaLQ%40mail.gmail.com/#msg35801377>
<https://sourceforge.net/p/ryu/mailman/ryu-devel/thread/CAM5MNiVPXW3xWeoHPMriXvSKkUnAHbgv6LqRZ%2BrE5rOZqDKaLQ%40mail.gmail.com/#msg35801377
<https://sourceforge.net/p/ryu/mailman/ryu-devel/thread/CAM5MNiVPXW3xWeoHPMriXvSKkUnAHbgv6LqRZ%2BrE5rOZqDKaLQ%40mail.gmail.com/#msg35801377>>
Post by Yi Tseng
Post by Yi Tseng
Basically, I would suggest using multiple Ryu instance(process) to install flows to switch.
Thanks Yi!
Yes, I guess it is the best way to use multiple instances.
The architecture might become complex though.
Just an idea, I am wondering if we could use "multiprocessing" module...
Thanks,
Iwase
Post by Yi Tseng
Yes I am referring to the first statement "multi-thread on Python is not effective enough"...
Please let me give another example to make my question more clear
Lets say the routing algorithm wants to update the paths on switch S1, S2, S3. One way is to update all the switches at time 0 (in parallel), and the other way is to update s1 at time 0, s2 at time 1, and s3 at time 3 (serial).
Because of GIL in python a thread has to finish its task before moving to another thread; with this in mind I believe using threads will update the switches in serial; because the first thread has to finish installing the rules on s1, then it moves to the next thread to install the rules on s2 and so on....
So my question is in Ryu what mechanism I can use to update s1, s2, s3 at time 0 (in one go)?
I hope my question is more clear now.
Thank you all for your time,
Corry
Hi,
Post by corey ross
Hey there,
I was wondering if it is possible to install multiple flows in parallel, if yes how?
for e.g if I have a topology of three switches (s1, s2, s3), I want to install flow-rules f1 on s1, f2 on s2 and f3 on s3. How can I install this three flow rules in parallel instead of doing so in serial fashion?
I have searched around and It seems that using threads is not an effective way.
Please let me make your question more clear.
What does "in parallel" and "in serial" exactly mean?
You mean; you currently uses multi-thread (using "ryu.lib.hub" or "eventlet"),
but some post you read says "multi-thread on Python is not effective enough",
right?
If so, are you facing the performance limit, for example?
Or, you want to get "Datapath" instance for s2 and s3, when you get event from
s1?
Thanks,
Iwase
Post by corey ross
------------------------------------------------------------------------------
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
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>
<https://lists.sourceforge.net/lists/listinfo/ryu-devel
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>>
<https://lists.sourceforge.net/lists/listinfo/ryu-devel
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>
<https://lists.sourceforge.net/lists/listinfo/ryu-devel
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>>>
Post by Yi Tseng
Post by Yi Tseng
------------------------------------------------------------------------------
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
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>
<https://lists.sourceforge.net/lists/listinfo/ryu-devel
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>>
<https://lists.sourceforge.net/lists/listinfo/ryu-devel
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>
<https://lists.sourceforge.net/lists/listinfo/ryu-devel
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>>>
Post by Yi Tseng
Post by Yi Tseng
--
Yi Tseng (a.k.a Takeshi)
Taiwan National Chiao Tung University
Department of Computer Science
W2CNLab
https://takeshi.tw
------------------------------------------------------------------------------
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
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>
<https://lists.sourceforge.net/lists/listinfo/ryu-devel
<https://lists.sourceforge.net/lists/listinfo/ryu-devel>>
Post by Yi Tseng
--
Yi Tseng (a.k.a Takeshi)
Taiwan National Chiao Tung University
Department of Computer Science
W2CNLab
https://takeshi.tw
------------------------------------------------------------------------------
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...