Well it does make some sense and should be able to work but when I try it in my application like shown below, I get the following errors
def handle_flow_stats_in(self, dpid, flows, more, xid): print "Flow stats in from datapath", longlong_to_octstr(dpid)[6:] temp = 0 for item in flows: val = item['byte_count'] z = int(val) if z > temp: temp = z print "highest", temp if temp > 1000: inport = flows[0]['match']['in_port'] flow = flows[0]['match'] print inport #print flow actions = [] self.install_datapath_flow(dpid, flow, CACHE_TIMEOUT, DROP_TIMEOUT, actions, openflow.OFP_DEFAULT_PRIORITY, inport) First error: 00006|openflow-event|ERR:received Openflow error packet from dpid=000000000001: type=1, code=8, 128 bytes of data When I change the command for installing a flow to contain the bufid and buf: self.install_datapath_flow(dpid, flow, CACHE_TIMEOUT, DROP_TIMEOUT, actions, bufid, openflow.OFP_DEFAULT_PRIORITY, inport, buf) I get this error: 00006|pyrt|ERR:unable to invoke a Python event handler: Traceback (most recent call last): File "./nox/lib/util.py", line 192, in f ret = f.cb(event.datapath_id, event.flows, event.more, event.xid) File "./nox/netapps/routing/samplerouting.py", line 181, in handle_flow_stats_in actions, bufid, openflow.OFP_DEFAULT_PRIORITY, NameError: global name 'bufid' is not defined Where could the problem be? Thanks, Chris On Sat, Sep 3, 2011 at 1:47 AM, Murphy McCauley <jam...@nau.edu> wrote: > Yes. From the flow stats event, you should be able to do something like: > e.flows[0]["match"] to get the match dictionary to use with > install_datapath_flow(), send_flow_command(), etc. for that flow. > > -- Murphy > > On Sep 2, 2011, at 3:16 PM, chris oleke wrote: > > > Hi, > > > > I am trying to create a rate-limiting functionality in my application > using the flow statistics that I obtain from the switch. I'm using the > byte_count from the flows to match against a threshold value that when > exceeded will be used to prompt flows to be dropped. Is it possible to > create a packet within NOX that I would use to install a flow just like the > case in a packet_in_event? In other words I'd like to know if I can use the > details obtained from a particular flow statistic to create a packet and > consequently have a flow sent to the switch that will be used to drop the > packets that match the flow. > > > > > > Thanks, > > Chris > > _______________________________________________ > > nox-dev mailing list > > nox-dev@noxrepo.org > > http://noxrepo.org/mailman/listinfo/nox-dev > >
_______________________________________________ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev