On Fri, Mar 09, 2012 at 05:49:08PM +0900, FUJITA Tomonori wrote:
> On Fri, 9 Mar 2012 11:50:12 +0900
> bty, why simple_isolation needs dpset? network moduoles keep the list
> of dps, right? Why can't we do something like the following?
It's because there is race condition between network-id registration and
datapath connecting to Ryu. Some clean up is needed somehow for code clarity.
The difference is
network modules: This tracks network id corresponding to datapath id.
This is set by REST api.
So the datapath may not connect to the ryu for some reason.
dpset: This tracks what datapaths are connecting to Ryu.
At the time when datapath connecting to ryu, the network id might
not be known.
Those tow can be consolidated into single table, something like
datapath id
network id; uuid or unknown
status: connected or disconnected
thanks,
> Note that it's not tested at all.
>
> diff --git a/ryu/app/simple_isolation.py b/ryu/app/simple_isolation.py
> index f547529..1f378a0 100644
> --- a/ryu/app/simple_isolation.py
> +++ b/ryu/app/simple_isolation.py
> @@ -304,8 +304,8 @@ class SimpleIsolation(object):
> return
>
> for mac_ in self.mac2port.mac_list(datapath_id, port_no):
> - for dp in self.dpset.get_all():
> - if self.mac2port.port_get(dp.id, mac_) is None:
> + for dpid in self.nw.get_dpid_list():
> + if self.mac2port.port_get(dpid, mac_) is None:
> continue
>
> wildcards = dp.ofproto.OFPFW_ALL
> diff --git a/ryu/controller/network.py b/ryu/controller/network.py
> index 0c61ba0..00dabbf 100644
> --- a/ryu/controller/network.py
> +++ b/ryu/controller/network.py
> @@ -139,6 +139,9 @@ class Network(object):
> for port_no in ports:
> self.port_added(datapath, port_no)
>
> + def get_dpid_list(self):
> + return [dpid for dpid, _port in self.dpids.iteritems()]
> +
> def port_added(self, datapath, port_no):
> if port_no == 0 or port_no >= datapath.ofproto.OFPP_MAX:
> # skip fake output ports
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
--
yamahata
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel