Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-23 Thread Yi Tseng
Hi,

How do you create multiple process? You create multiple Ryu process?

If you create multiple Ryu process, you need to connect switch to all
process.

Or you need to share the connection between processes and switches


-Yi

2017-04-22 12:19 GMT-07:00 Yiwen Shen :

> Hi,
>
> In order to add flows in parallel from a controller I'm using python's
> multiprocessing library to create separate processes, each to add flows.
> However I've observed that in many situations flows don't get properly
> added. Can you please help?
>
> Thank you,
> Yiwen Shen
>
> 
> --
> 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
> Ryu-devel@lists.sourceforge.net
> 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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-23 Thread Yi Tseng
Hi,

*Please don't drop mailing list.*

Is there any warning/error log? (run Ryu with --verbose)

How did you share OpenFlow sessions between processes?

-Yi

2017-04-23 16:53 GMT-07:00 Yiwen Shen :

> Hi,
>
> I have a function that takes arguments like datapath, inport, outport, IP
> address, priority, and adds that flow onto that datapath. Then I create
> multiple processes and each uses this function to add different flows.
>
> If I use the function normally, then the flows will get added, but if I
> use multiprocessing with this function, the flows do not get added.
>
> Thank you,
> Yiwen Shen
>
>
>
> On Apr 23, 2017 3:59 AM, "Yi Tseng"  wrote:
>
> Hi,
>
> How do you create multiple process? You create multiple Ryu process?
>
> If you create multiple Ryu process, you need to connect switch to all
> process.
>
> Or you need to share the connection between processes and switches
>
>
> -Yi
>
> 2017-04-22 12:19 GMT-07:00 Yiwen Shen :
>
>> Hi,
>>
>> In order to add flows in parallel from a controller I'm using python's
>> multiprocessing library to create separate processes, each to add flows.
>> However I've observed that in many situations flows don't get properly
>> added. Can you please help?
>>
>> Thank you,
>> Yiwen Shen
>>
>> 
>> --
>> 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
>> Ryu-devel@lists.sourceforge.net
>> 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
>
>
>


-- 
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-23 Thread Yi Tseng
Also, I am not sure if you processes did send OpenFlow message correctly.

Can you verify OpenFlow messages sent by controller by using tcpdump or
Wireshark?

--
Yi

2017-04-23 17:04 GMT-07:00 Yi Tseng :

> Hi,
>
> *Please don't drop mailing list.*
>
> Is there any warning/error log? (run Ryu with --verbose)
>
> How did you share OpenFlow sessions between processes?
>
> -Yi
>
> 2017-04-23 16:53 GMT-07:00 Yiwen Shen :
>
>> Hi,
>>
>> I have a function that takes arguments like datapath, inport, outport, IP
>> address, priority, and adds that flow onto that datapath. Then I create
>> multiple processes and each uses this function to add different flows.
>>
>> If I use the function normally, then the flows will get added, but if I
>> use multiprocessing with this function, the flows do not get added.
>>
>> Thank you,
>> Yiwen Shen
>>
>>
>>
>> On Apr 23, 2017 3:59 AM, "Yi Tseng"  wrote:
>>
>> Hi,
>>
>> How do you create multiple process? You create multiple Ryu process?
>>
>> If you create multiple Ryu process, you need to connect switch to all
>> process.
>>
>> Or you need to share the connection between processes and switches
>>
>>
>> -Yi
>>
>> 2017-04-22 12:19 GMT-07:00 Yiwen Shen :
>>
>>> Hi,
>>>
>>> In order to add flows in parallel from a controller I'm using python's
>>> multiprocessing library to create separate processes, each to add flows.
>>> However I've observed that in many situations flows don't get properly
>>> added. Can you please help?
>>>
>>> Thank you,
>>> Yiwen Shen
>>>
>>> 
>>> --
>>> 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
>>> Ryu-devel@lists.sourceforge.net
>>> 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
>>
>>
>>
>
>
> --
> Yi Tseng (a.k.a Takeshi)
> Taiwan National Chiao Tung University
> Department of Computer Science
> W2CNLab
>
> https://takeshi.tw
>



-- 
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-24 Thread Yiwen Shen
Hi,

I ran it with --verbose and nothing out of the ordinary appeared.

I'm not sure what you mean by sharing OpenFlow sessions between processes.
I'm just attaching the function that adds flows into different processes,
like I have a function called add_flow(in_port, out_port, ip_dst, ...), and
then I use

p1 = multiprocessing.Process(target = add_flow, args = ( ... ))
p2 = multiprocessing.Process(target = add_flow, args = ( ... ))
p1.start()
p2.start()

I used tcpdump and wireshark and both show that openflow messages were
sent. I have attached the tcpdump output and the wireshark capture. You can
see that there are some messages around the middle that are Openflow
messages.

If I just do add_flow(..) by itself the flows will get added properly onto
the switch, but if I do multiprocessing it doesn't appear. However,
multiprocessing is the only way I know to do this stuff in parallel. (I've
tried multithreading, and the flows do get added but because of GIL, it
isn't truly happening in parallel).

Thank you,
Yiwen


On Sun, Apr 23, 2017 at 8:17 PM, Yi Tseng  wrote:

> Also, I am not sure if you processes did send OpenFlow message correctly.
>
> Can you verify OpenFlow messages sent by controller by using tcpdump or
> Wireshark?
>
> --
> Yi
>
> 2017-04-23 17:04 GMT-07:00 Yi Tseng :
>
>> Hi,
>>
>> *Please don't drop mailing list.*
>>
>> Is there any warning/error log? (run Ryu with --verbose)
>>
>> How did you share OpenFlow sessions between processes?
>>
>> -Yi
>>
>> 2017-04-23 16:53 GMT-07:00 Yiwen Shen :
>>
>>> Hi,
>>>
>>> I have a function that takes arguments like datapath, inport, outport,
>>> IP address, priority, and adds that flow onto that datapath. Then I create
>>> multiple processes and each uses this function to add different flows.
>>>
>>> If I use the function normally, then the flows will get added, but if I
>>> use multiprocessing with this function, the flows do not get added.
>>>
>>> Thank you,
>>> Yiwen Shen
>>>
>>>
>>>
>>> On Apr 23, 2017 3:59 AM, "Yi Tseng"  wrote:
>>>
>>> Hi,
>>>
>>> How do you create multiple process? You create multiple Ryu process?
>>>
>>> If you create multiple Ryu process, you need to connect switch to all
>>> process.
>>>
>>> Or you need to share the connection between processes and switches
>>>
>>>
>>> -Yi
>>>
>>> 2017-04-22 12:19 GMT-07:00 Yiwen Shen :
>>>
 Hi,

 In order to add flows in parallel from a controller I'm using python's
 multiprocessing library to create separate processes, each to add flows.
 However I've observed that in many situations flows don't get properly
 added. Can you please help?

 Thank you,
 Yiwen Shen

 
 --
 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
 Ryu-devel@lists.sourceforge.net
 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
>>>
>>>
>>>
>>
>>
>> --
>> Yi Tseng (a.k.a Takeshi)
>> Taiwan National Chiao Tung University
>> Department of Computer Science
>> W2CNLab
>>
>> https://takeshi.tw
>>
>
>
>
> --
> Yi Tseng (a.k.a Takeshi)
> Taiwan National Chiao Tung University
> Department of Computer Science
> W2CNLab
>
> https://takeshi.tw
>



-- 
*Yiwen Shen*
PhD Candidate at Lightwave Research Laboratory

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eno1, link-type EN10MB (Ethernet), capture size 262144 bytes
18:24:43.711378 IP 128.59.87.121.6633 > 128.59.87.223.45675: Flags [R.], seq 0, 
ack 1726962875, win 0, length 0
18:24:51.711375 IP 128.59.87.121.6633 > 128.59.87.223.45676: Flags [S.], seq 
730045996, ack 3145795434, win 28960, options [mss 1460,sackOK,TS val 179348636 
ecr 2144687500,nop,wscale 7], length 0
18:24:51.711661 IP 128.59.87.121.6633 > 128.59.87.223.45676: Flags [.], ack 9, 
win 227, options [nop,nop,TS val 179348636 ecr 2144687500], length 0
18:24:51.714434 IP 128.59.87.121.6633 > 128.59.87.223.45676: Flags [P.], seq 
1:9, ack 9, win 227, options [nop,nop,TS val 179348637 ecr 2144687500], length 
8: OpenFlow
version unknown (0x04), type 0x00, length 8, xid 0xfa4be336
18:24:51.714531 IP 128.59.87.121.6633 > 128.59.87.223.45676: Flags [P.], seq 
9:17, ack 9, win 227, options [nop,nop,TS val 179348637 ecr 2144687500], length 
8: OpenFlow
version unknown (0x04), type 0x05, length 8, xid 0xfa4be337
18:24:51.717256 IP 128.59.87.121.6633 > 128.59.87.223.45676: Flags [P.], seq 
17:33, ack 41, win 227, options [nop,nop,TS val 179348638 ecr 2144687500], 
length 16: OpenFlow
version unknown (0x04), type 0x12, length 16, xid 0xfa4be338
18:24:51.756708 IP 

Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-24 Thread Yi Tseng
Hi,

I didn't see any *FLOW_ADD* message, is this correct pcap file?

--
Yi

2017-04-24 15:46 GMT-07:00 Yiwen Shen :

> Hi,
>
> I ran it with --verbose and nothing out of the ordinary appeared.
>
> I'm not sure what you mean by sharing OpenFlow sessions between processes.
> I'm just attaching the function that adds flows into different processes,
> like I have a function called add_flow(in_port, out_port, ip_dst, ...), and
> then I use
>
> p1 = multiprocessing.Process(target = add_flow, args = ( ... ))
> p2 = multiprocessing.Process(target = add_flow, args = ( ... ))
> p1.start()
> p2.start()
>
> I used tcpdump and wireshark and both show that openflow messages were
> sent. I have attached the tcpdump output and the wireshark capture. You can
> see that there are some messages around the middle that are Openflow
> messages.
>
> If I just do add_flow(..) by itself the flows will get added properly onto
> the switch, but if I do multiprocessing it doesn't appear. However,
> multiprocessing is the only way I know to do this stuff in parallel. (I've
> tried multithreading, and the flows do get added but because of GIL, it
> isn't truly happening in parallel).
>
> Thank you,
> Yiwen
>
>
> On Sun, Apr 23, 2017 at 8:17 PM, Yi Tseng  wrote:
>
>> Also, I am not sure if you processes did send OpenFlow message correctly.
>>
>> Can you verify OpenFlow messages sent by controller by using tcpdump or
>> Wireshark?
>>
>> --
>> Yi
>>
>> 2017-04-23 17:04 GMT-07:00 Yi Tseng :
>>
>>> Hi,
>>>
>>> *Please don't drop mailing list.*
>>>
>>> Is there any warning/error log? (run Ryu with --verbose)
>>>
>>> How did you share OpenFlow sessions between processes?
>>>
>>> -Yi
>>>
>>> 2017-04-23 16:53 GMT-07:00 Yiwen Shen :
>>>
 Hi,

 I have a function that takes arguments like datapath, inport, outport,
 IP address, priority, and adds that flow onto that datapath. Then I create
 multiple processes and each uses this function to add different flows.

 If I use the function normally, then the flows will get added, but if I
 use multiprocessing with this function, the flows do not get added.

 Thank you,
 Yiwen Shen



 On Apr 23, 2017 3:59 AM, "Yi Tseng"  wrote:

 Hi,

 How do you create multiple process? You create multiple Ryu process?

 If you create multiple Ryu process, you need to connect switch to all
 process.

 Or you need to share the connection between processes and switches


 -Yi

 2017-04-22 12:19 GMT-07:00 Yiwen Shen :

> Hi,
>
> In order to add flows in parallel from a controller I'm using python's
> multiprocessing library to create separate processes, each to add flows.
> However I've observed that in many situations flows don't get properly
> added. Can you please help?
>
> Thank you,
> Yiwen Shen
>
> 
> --
> 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
> Ryu-devel@lists.sourceforge.net
> 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



>>>
>>>
>>> --
>>> Yi Tseng (a.k.a Takeshi)
>>> Taiwan National Chiao Tung University
>>> Department of Computer Science
>>> W2CNLab
>>>
>>> https://takeshi.tw
>>>
>>
>>
>>
>> --
>> Yi Tseng (a.k.a Takeshi)
>> Taiwan National Chiao Tung University
>> Department of Computer Science
>> W2CNLab
>>
>> https://takeshi.tw
>>
>
>
>
> --
> *Yiwen Shen*
> PhD Candidate at Lightwave Research Laboratory
> 
>



-- 
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-24 Thread William Fisher
On Mon, Apr 24, 2017 at 3:46 PM, Yiwen Shen  wrote:
>
> If I just do add_flow(..) by itself the flows will get added properly
onto the switch, but if I do multiprocessing it doesn't appear. However,
multiprocessing is the only way I know to do this stuff in parallel. (I've
tried multithreading, and the flows do get added but because of GIL, it
isn't truly happening in parallel).
>

What are you ultimately testing, the controller or the switch?  If you are
optimizing, what is the performance benchmark you are trying to reach?

If you are testing the ability of a switch to process multiple simultaneous
OpenFlow messages, you should use two separate connections to the switch.
Perhaps by running two ryu processes listening on different ports.

If you are testing the controller, be aware that ryu has one connection to
the switch and isn't designed to share it between processes. (Even if it is
possible to share the connection, you may still run into atomicity issues
where openflow message bytes get interleaved.) If you tried multithreading
in a single process and that worked for you, that's probably the best you
can expect.
--
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-24 Thread Yiwen Shen
I am testing the controller to do parallel flow addition/deletions, in
order to see how fast the controller can add or delete a large number of
flows. Because in a large network, you may need to add thousands of flows
and it needs to be done in parallel so that the network can be scalable.

You may be correct in saying that Ryu cannot share the connection to the
switch among different processes, but the problem right now is that even if
I just use a single process to add a flow (so no other processes are
conflicting with it or causing interleaving problems), the OFPT_FLOW_MOD
message didn't send according to the Wireshark capture.


On Mon, Apr 24, 2017 at 8:12 PM, William Fisher 
wrote:

> On Mon, Apr 24, 2017 at 3:46 PM, Yiwen Shen  wrote:
> >
> > If I just do add_flow(..) by itself the flows will get added properly
> onto the switch, but if I do multiprocessing it doesn't appear. However,
> multiprocessing is the only way I know to do this stuff in parallel. (I've
> tried multithreading, and the flows do get added but because of GIL, it
> isn't truly happening in parallel).
> >
>
> What are you ultimately testing, the controller or the switch?  If you are
> optimizing, what is the performance benchmark you are trying to reach?
>
> If you are testing the ability of a switch to process multiple
> simultaneous OpenFlow messages, you should use two separate connections to
> the switch. Perhaps by running two ryu processes listening on different
> ports.
>
> If you are testing the controller, be aware that ryu has one connection to
> the switch and isn't designed to share it between processes. (Even if it is
> possible to share the connection, you may still run into atomicity issues
> where openflow message bytes get interleaved.) If you tried multithreading
> in a single process and that worked for you, that's probably the best you
> can expect.
>
>


-- 
*Yiwen Shen*
PhD Candidate at Lightwave Research Laboratory

--
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-25 Thread Tao Li
I think, even if you only start one single process to add a flow, the 
connection (object) between the controller and switch is still owned by the 
root process, in which you start your delegate process. In the case that you 
want to add more computation capacity, maybe you can perform the computation 
inside the additionally created processes and get the results back to the root 
process to send out to the switches. But this approach cannot increase Ryu’s 
capacity of accepting/sending OF messages, as far as I can see.

Best regards,
Tao

> On 25 Apr 2017, at 05:12, Yiwen Shen  wrote:
> 
> I am testing the controller to do parallel flow addition/deletions, in order 
> to see how fast the controller can add or delete a large number of flows. 
> Because in a large network, you may need to add thousands of flows and it 
> needs to be done in parallel so that the network can be scalable. 
> 
> You may be correct in saying that Ryu cannot share the connection to the 
> switch among different processes, but the problem right now is that even if I 
> just use a single process to add a flow (so no other processes are 
> conflicting with it or causing interleaving problems), the OFPT_FLOW_MOD 
> message didn't send according to the Wireshark capture. 
> 
> 
> On Mon, Apr 24, 2017 at 8:12 PM, William Fisher  > wrote:
> On Mon, Apr 24, 2017 at 3:46 PM, Yiwen Shen  > wrote:
> >
> > If I just do add_flow(..) by itself the flows will get added properly onto 
> > the switch, but if I do multiprocessing it doesn't appear. However, 
> > multiprocessing is the only way I know to do this stuff in parallel. (I've 
> > tried multithreading, and the flows do get added but because of GIL, it 
> > isn't truly happening in parallel).
> >
> 
> What are you ultimately testing, the controller or the switch?  If you are 
> optimizing, what is the performance benchmark you are trying to reach?
> 
> If you are testing the ability of a switch to process multiple simultaneous 
> OpenFlow messages, you should use two separate connections to the switch. 
> Perhaps by running two ryu processes listening on different ports.
> 
> If you are testing the controller, be aware that ryu has one connection to 
> the switch and isn't designed to share it between processes. (Even if it is 
> possible to share the connection, you may still run into atomicity issues 
> where openflow message bytes get interleaved.) If you tried multithreading in 
> a single process and that worked for you, that's probably the best you can 
> expect.
> 
> 
> 
> 
> -- 
> Yiwen Shen
> PhD Candidate at Lightwave Research Laboratory 
> --
> 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
> Ryu-devel@lists.sourceforge.net
> 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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-25 Thread Yiwen Shen
Alright thank you. So I guess there is no method to send out multiple flows
in parallel by Ryu?

On Tue, Apr 25, 2017 at 5:22 AM, Tao Li  wrote:

> I think, even if you only start one single process to add a flow, the
> connection (object) between the controller and switch is still owned by the
> root process, in which you start your delegate process. In the case that
> you want to add more computation capacity, maybe you can perform the
> computation inside the additionally created processes and get the results
> back to the root process to send out to the switches. But this approach
> cannot increase Ryu’s capacity of accepting/sending OF messages, as far as
> I can see.
>
> Best regards,
> Tao
>
> On 25 Apr 2017, at 05:12, Yiwen Shen  wrote:
>
> I am testing the controller to do parallel flow addition/deletions, in
> order to see how fast the controller can add or delete a large number of
> flows. Because in a large network, you may need to add thousands of flows
> and it needs to be done in parallel so that the network can be scalable.
>
> You may be correct in saying that Ryu cannot share the connection to the
> switch among different processes, but the problem right now is that even if
> I just use a single process to add a flow (so no other processes are
> conflicting with it or causing interleaving problems), the OFPT_FLOW_MOD
> message didn't send according to the Wireshark capture.
>
>
> On Mon, Apr 24, 2017 at 8:12 PM, William Fisher  gmail.com> wrote:
>
>> On Mon, Apr 24, 2017 at 3:46 PM, Yiwen Shen  wrote:
>> >
>> > If I just do add_flow(..) by itself the flows will get added properly
>> onto the switch, but if I do multiprocessing it doesn't appear. However,
>> multiprocessing is the only way I know to do this stuff in parallel. (I've
>> tried multithreading, and the flows do get added but because of GIL, it
>> isn't truly happening in parallel).
>> >
>>
>> What are you ultimately testing, the controller or the switch?  If you
>> are optimizing, what is the performance benchmark you are trying to reach?
>>
>> If you are testing the ability of a switch to process multiple
>> simultaneous OpenFlow messages, you should use two separate connections to
>> the switch. Perhaps by running two ryu processes listening on different
>> ports.
>>
>> If you are testing the controller, be aware that ryu has one connection
>> to the switch and isn't designed to share it between processes. (Even if it
>> is possible to share the connection, you may still run into atomicity
>> issues where openflow message bytes get interleaved.) If you tried
>> multithreading in a single process and that worked for you, that's probably
>> the best you can expect.
>>
>>
>
>
> --
> *Yiwen Shen*
> PhD Candidate at Lightwave Research Laboratory
> 
> 
> --
> 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
> Ryu-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
>
>


-- 
*Yiwen Shen*
PhD Candidate at Lightwave Research Laboratory

--
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-25 Thread Yi Tseng
Hi

In my opinion, you can create multiple instance of Ryu controller, and
connect switch to all controllers.

You need to design mechanism for syncing flow data between multiple
controller instances.


--Yi

2017-04-25 12:54 GMT-07:00 Yiwen Shen :

> Alright thank you. So I guess there is no method to send out multiple
> flows in parallel by Ryu?
>
> On Tue, Apr 25, 2017 at 5:22 AM, Tao Li  wrote:
>
>> I think, even if you only start one single process to add a flow, the
>> connection (object) between the controller and switch is still owned by the
>> root process, in which you start your delegate process. In the case that
>> you want to add more computation capacity, maybe you can perform the
>> computation inside the additionally created processes and get the results
>> back to the root process to send out to the switches. But this approach
>> cannot increase Ryu’s capacity of accepting/sending OF messages, as far as
>> I can see.
>>
>> Best regards,
>> Tao
>>
>> On 25 Apr 2017, at 05:12, Yiwen Shen  wrote:
>>
>> I am testing the controller to do parallel flow addition/deletions, in
>> order to see how fast the controller can add or delete a large number of
>> flows. Because in a large network, you may need to add thousands of flows
>> and it needs to be done in parallel so that the network can be scalable.
>>
>> You may be correct in saying that Ryu cannot share the connection to the
>> switch among different processes, but the problem right now is that even if
>> I just use a single process to add a flow (so no other processes are
>> conflicting with it or causing interleaving problems), the OFPT_FLOW_MOD
>> message didn't send according to the Wireshark capture.
>>
>>
>> On Mon, Apr 24, 2017 at 8:12 PM, William Fisher > .com> wrote:
>>
>>> On Mon, Apr 24, 2017 at 3:46 PM, Yiwen Shen  wrote:
>>> >
>>> > If I just do add_flow(..) by itself the flows will get added properly
>>> onto the switch, but if I do multiprocessing it doesn't appear. However,
>>> multiprocessing is the only way I know to do this stuff in parallel. (I've
>>> tried multithreading, and the flows do get added but because of GIL, it
>>> isn't truly happening in parallel).
>>> >
>>>
>>> What are you ultimately testing, the controller or the switch?  If you
>>> are optimizing, what is the performance benchmark you are trying to reach?
>>>
>>> If you are testing the ability of a switch to process multiple
>>> simultaneous OpenFlow messages, you should use two separate connections to
>>> the switch. Perhaps by running two ryu processes listening on different
>>> ports.
>>>
>>> If you are testing the controller, be aware that ryu has one connection
>>> to the switch and isn't designed to share it between processes. (Even if it
>>> is possible to share the connection, you may still run into atomicity
>>> issues where openflow message bytes get interleaved.) If you tried
>>> multithreading in a single process and that worked for you, that's probably
>>> the best you can expect.
>>>
>>>
>>
>>
>> --
>> *Yiwen Shen*
>> PhD Candidate at Lightwave Research Laboratory
>> 
>> 
>> --
>> 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
>> Ryu-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>>
>>
>
>
> --
> *Yiwen Shen*
> PhD Candidate at Lightwave Research Laboratory
> 
>
> 
> --
> 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
> Ryu-devel@lists.sourceforge.net
> 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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-25 Thread Yiwen Shen
How do you create multiple instances of the Ryu controller?

On Tue, Apr 25, 2017 at 7:57 PM, Yi Tseng  wrote:

> Hi
>
> In my opinion, you can create multiple instance of Ryu controller, and
> connect switch to all controllers.
>
> You need to design mechanism for syncing flow data between multiple
> controller instances.
>
>
> --Yi
>
> 2017-04-25 12:54 GMT-07:00 Yiwen Shen :
>
>> Alright thank you. So I guess there is no method to send out multiple
>> flows in parallel by Ryu?
>>
>> On Tue, Apr 25, 2017 at 5:22 AM, Tao Li  wrote:
>>
>>> I think, even if you only start one single process to add a flow, the
>>> connection (object) between the controller and switch is still owned by the
>>> root process, in which you start your delegate process. In the case that
>>> you want to add more computation capacity, maybe you can perform the
>>> computation inside the additionally created processes and get the results
>>> back to the root process to send out to the switches. But this approach
>>> cannot increase Ryu’s capacity of accepting/sending OF messages, as far as
>>> I can see.
>>>
>>> Best regards,
>>> Tao
>>>
>>> On 25 Apr 2017, at 05:12, Yiwen Shen  wrote:
>>>
>>> I am testing the controller to do parallel flow addition/deletions, in
>>> order to see how fast the controller can add or delete a large number of
>>> flows. Because in a large network, you may need to add thousands of flows
>>> and it needs to be done in parallel so that the network can be scalable.
>>>
>>> You may be correct in saying that Ryu cannot share the connection to the
>>> switch among different processes, but the problem right now is that even if
>>> I just use a single process to add a flow (so no other processes are
>>> conflicting with it or causing interleaving problems), the OFPT_FLOW_MOD
>>> message didn't send according to the Wireshark capture.
>>>
>>>
>>> On Mon, Apr 24, 2017 at 8:12 PM, William Fisher >> .com> wrote:
>>>
 On Mon, Apr 24, 2017 at 3:46 PM, Yiwen Shen 
 wrote:
 >
 > If I just do add_flow(..) by itself the flows will get added properly
 onto the switch, but if I do multiprocessing it doesn't appear. However,
 multiprocessing is the only way I know to do this stuff in parallel. (I've
 tried multithreading, and the flows do get added but because of GIL, it
 isn't truly happening in parallel).
 >

 What are you ultimately testing, the controller or the switch?  If you
 are optimizing, what is the performance benchmark you are trying to reach?

 If you are testing the ability of a switch to process multiple
 simultaneous OpenFlow messages, you should use two separate connections to
 the switch. Perhaps by running two ryu processes listening on different
 ports.

 If you are testing the controller, be aware that ryu has one connection
 to the switch and isn't designed to share it between processes. (Even if it
 is possible to share the connection, you may still run into atomicity
 issues where openflow message bytes get interleaved.) If you tried
 multithreading in a single process and that worked for you, that's probably
 the best you can expect.


>>>
>>>
>>> --
>>> *Yiwen Shen*
>>> PhD Candidate at Lightwave Research Laboratory
>>> 
>>> 
>>> --
>>> 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
>>> Ryu-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>>
>>>
>>>
>>
>>
>> --
>> *Yiwen Shen*
>> PhD Candidate at Lightwave Research Laboratory
>> 
>>
>> 
>> --
>> 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
>> Ryu-devel@lists.sourceforge.net
>> 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
>



-- 
*Yiwen Shen*
PhD Candidate at Lightwave Research Laboratory

--
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
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-25 Thread Yi Tseng
Hi

For me, I just start multiple Ryu controller with different IP/TCP port

And create connection between controllers(by simple socket)

--
Yi

2017-04-25 20:31 GMT-07:00 Yiwen Shen :

> How do you create multiple instances of the Ryu controller?
>
> On Tue, Apr 25, 2017 at 7:57 PM, Yi Tseng  wrote:
>
>> Hi
>>
>> In my opinion, you can create multiple instance of Ryu controller, and
>> connect switch to all controllers.
>>
>> You need to design mechanism for syncing flow data between multiple
>> controller instances.
>>
>>
>> --Yi
>>
>> 2017-04-25 12:54 GMT-07:00 Yiwen Shen :
>>
>>> Alright thank you. So I guess there is no method to send out multiple
>>> flows in parallel by Ryu?
>>>
>>> On Tue, Apr 25, 2017 at 5:22 AM, Tao Li  wrote:
>>>
 I think, even if you only start one single process to add a flow, the
 connection (object) between the controller and switch is still owned by the
 root process, in which you start your delegate process. In the case that
 you want to add more computation capacity, maybe you can perform the
 computation inside the additionally created processes and get the results
 back to the root process to send out to the switches. But this approach
 cannot increase Ryu’s capacity of accepting/sending OF messages, as far as
 I can see.

 Best regards,
 Tao

 On 25 Apr 2017, at 05:12, Yiwen Shen  wrote:

 I am testing the controller to do parallel flow addition/deletions, in
 order to see how fast the controller can add or delete a large number of
 flows. Because in a large network, you may need to add thousands of flows
 and it needs to be done in parallel so that the network can be scalable.

 You may be correct in saying that Ryu cannot share the connection to
 the switch among different processes, but the problem right now is that
 even if I just use a single process to add a flow (so no other processes
 are conflicting with it or causing interleaving problems), the
 OFPT_FLOW_MOD message didn't send according to the Wireshark capture.


 On Mon, Apr 24, 2017 at 8:12 PM, William Fisher >>> .com> wrote:

> On Mon, Apr 24, 2017 at 3:46 PM, Yiwen Shen 
> wrote:
> >
> > If I just do add_flow(..) by itself the flows will get added
> properly onto the switch, but if I do multiprocessing it doesn't appear.
> However, multiprocessing is the only way I know to do this stuff in
> parallel. (I've tried multithreading, and the flows do get added but
> because of GIL, it isn't truly happening in parallel).
> >
>
> What are you ultimately testing, the controller or the switch?  If you
> are optimizing, what is the performance benchmark you are trying to reach?
>
> If you are testing the ability of a switch to process multiple
> simultaneous OpenFlow messages, you should use two separate connections to
> the switch. Perhaps by running two ryu processes listening on different
> ports.
>
> If you are testing the controller, be aware that ryu has one
> connection to the switch and isn't designed to share it between processes.
> (Even if it is possible to share the connection, you may still run into
> atomicity issues where openflow message bytes get interleaved.) If you
> tried multithreading in a single process and that worked for you, that's
> probably the best you can expect.
>
>


 --
 *Yiwen Shen*
 PhD Candidate at Lightwave Research Laboratory
 
 
 --
 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
 Ryu-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ryu-devel



>>>
>>>
>>> --
>>> *Yiwen Shen*
>>> PhD Candidate at Lightwave Research Laboratory
>>> 
>>>
>>> 
>>> --
>>> 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
>>> Ryu-devel@lists.sourceforge.net
>>> 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
>>
>
>
>
> --
> *Yiwen Shen*
> PhD Candidate at Lightwave Research Laboratory
> 
>



-- 
Yi Tseng (a.k.a Takeshi)
Taiwan National Chiao Tung University
Department of Computer Science
W2CNLab

https://takeshi.tw

Re: [Ryu-devel] Using multiprocessing to modify flows

2017-04-25 Thread Yiwen Shen
I see,  thank you.

On Apr 26, 2017 2:35 AM, "Yi Tseng"  wrote:

> Hi
>
> For me, I just start multiple Ryu controller with different IP/TCP port
>
> And create connection between controllers(by simple socket)
>
> --
> Yi
>
> 2017-04-25 20:31 GMT-07:00 Yiwen Shen :
>
>> How do you create multiple instances of the Ryu controller?
>>
>> On Tue, Apr 25, 2017 at 7:57 PM, Yi Tseng  wrote:
>>
>>> Hi
>>>
>>> In my opinion, you can create multiple instance of Ryu controller, and
>>> connect switch to all controllers.
>>>
>>> You need to design mechanism for syncing flow data between multiple
>>> controller instances.
>>>
>>>
>>> --Yi
>>>
>>> 2017-04-25 12:54 GMT-07:00 Yiwen Shen :
>>>
 Alright thank you. So I guess there is no method to send out multiple
 flows in parallel by Ryu?

 On Tue, Apr 25, 2017 at 5:22 AM, Tao Li  wrote:

> I think, even if you only start one single process to add a flow, the
> connection (object) between the controller and switch is still owned by 
> the
> root process, in which you start your delegate process. In the case that
> you want to add more computation capacity, maybe you can perform the
> computation inside the additionally created processes and get the results
> back to the root process to send out to the switches. But this approach
> cannot increase Ryu’s capacity of accepting/sending OF messages, as far as
> I can see.
>
> Best regards,
> Tao
>
> On 25 Apr 2017, at 05:12, Yiwen Shen  wrote:
>
> I am testing the controller to do parallel flow addition/deletions, in
> order to see how fast the controller can add or delete a large number of
> flows. Because in a large network, you may need to add thousands of flows
> and it needs to be done in parallel so that the network can be scalable.
>
> You may be correct in saying that Ryu cannot share the connection to
> the switch among different processes, but the problem right now is that
> even if I just use a single process to add a flow (so no other processes
> are conflicting with it or causing interleaving problems), the
> OFPT_FLOW_MOD message didn't send according to the Wireshark capture.
>
>
> On Mon, Apr 24, 2017 at 8:12 PM, William Fisher <
> william.w.fis...@gmail.com> wrote:
>
>> On Mon, Apr 24, 2017 at 3:46 PM, Yiwen Shen 
>> wrote:
>> >
>> > If I just do add_flow(..) by itself the flows will get added
>> properly onto the switch, but if I do multiprocessing it doesn't appear.
>> However, multiprocessing is the only way I know to do this stuff in
>> parallel. (I've tried multithreading, and the flows do get added but
>> because of GIL, it isn't truly happening in parallel).
>> >
>>
>> What are you ultimately testing, the controller or the switch?  If
>> you are optimizing, what is the performance benchmark you are trying to
>> reach?
>>
>> If you are testing the ability of a switch to process multiple
>> simultaneous OpenFlow messages, you should use two separate connections 
>> to
>> the switch. Perhaps by running two ryu processes listening on different
>> ports.
>>
>> If you are testing the controller, be aware that ryu has one
>> connection to the switch and isn't designed to share it between 
>> processes.
>> (Even if it is possible to share the connection, you may still run into
>> atomicity issues where openflow message bytes get interleaved.) If you
>> tried multithreading in a single process and that worked for you, that's
>> probably the best you can expect.
>>
>>
>
>
> --
> *Yiwen Shen*
> PhD Candidate at Lightwave Research Laboratory
> 
> 
> --
> 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
> Ryu-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
>
>


 --
 *Yiwen Shen*
 PhD Candidate at Lightwave Research Laboratory
 

 
 --
 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
 Ryu-devel@lists.sourceforge.net
 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
>>>
>>
>>
>>
>> --
>> *Yiwen Shen*
>> PhD Candidat