Re: [nox-dev] Wrong Route update after link down event
In fact, I think the problem is that the routing modules treats the link_down event after the components that depend on it. Karim On 08/20/2011 04:21 AM, Murphy McCauley wrote: Just going to note that I have suspected there was a problem here for several months, but haven't really looked into it. Thanks for the report. Please let us know if you figure anything out! -- Murphy On Aug 15, 2011, at 7:48 AM, karim torkmen wrote: Hi all, I am writing a module for link protection after a link failure. The problem is that when I ask for a new route through the get_route() method, after the link down event occurs, I get the same route, as if the routing module did not detect the link down. Any idea why ? Thanks a lot, Karim ___ 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
[nox-dev] a possible bug report
Hi, I am developing an application to reroute traffic upon a link failure, using the routing module to calculate the shortest path. When a link failure occurs, the application should get a new path using the routing module. However, when treating the link failure inside a callback of the link failure event, the routing module returns always the same path i.e. containing the link that is down, so the behaviour is as if the link database of nox was not updated. Any idea what it can be, Thanks, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] check if a link is in route
Hi all, I want to know if there is any method that allows to know if a given link is in a given route and what do the following methods of the routing module bool is_on_path_location(const RouteId id, uint16_t src_port, uint16_t dst_port) and void clean_route(const RoutePtr, RoutePtr, bool) do. Thanks a lot, karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] problem with get_switch_links
Hi all, I am having some problems by using the get_switch_links method. This method requires a callback method, however for my program I want that this method returns a link list. I tried using global variables, but it seems that the link list that I get is not updated, with the last link list retrieved, it seems like there is a problem of synchronization. here is a snippet : def checkRoute(self,route): self.currentDp = route.id.src for i in range(route.path.size()): self.bindings.get_switch_links(self.currentDp,self.checkLinks) (1) print self.linkLst self.currentDp = route.path[i].dst def checkLinks(self,links): (2) self.linkLst = links print linkLst instruction (1) gives me an outdated link list i.e a link list that is relative to another dpid different from the current dpid. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] strange send_openflow_packet behaviour
Hi, i am trying to send a packet through the send_openflow_packet method, to send the packet i do some processing on dict saved as a global variable on the form dict {key:[v1,v2],v3,v4}. When i send the packet the first time everything goes well, but after the second time, the dict form changes and it becomes dict {key:[v1,v2]} which rises an index error. Here is a snippet of the sending packet code: def sendPADI(self): ppp_padi = PPPoE() ppp_padi.type=1 ppp_padi.code =9 print the ppp packet is print str(ppp_padi.type) eth =Ethernet() eth.src= \x3e\xde\x23\x4b\x97\x48 eth.dst= \x5a\x9d\xd0\x2f\x13\x02 # \xff\xff\xff\xff\xff\xff eth.type= 34915 eth.data = ppp_padi #return eth self.send_openflow_packet(dpid, str(eth), [[openflow.OFPAT_OUTPUT [0,port]]],openflow.OFPP_NONE) where dpid , port and mac addresses are retrieved from the dict. Could it be a bug in the send_openflow_packet method. Any help is appreciated. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] availability of host tracker for python
Hi all, I want to use host tracker in python, but it seems that it is available just for C++. can anyone please forward to me the necessary files if available, to wrap this component and make it available to python. Thanks, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
Re: [nox-dev] matching fields
Hi Murphy, thanks a lot for your answeer. The small problem is that I am using python and the setup_route (self.routing.setup_route(flow,route, inport, outport,FLOW_TIMEOUT, [], False)) method of pyrouting which takes as an entry a flow not an attrs. My aim is to make the switch just decide on the source mac address and to ignore the destination mac address. Regards, karim On 05/06/2011 02:20 AM, Murphy McCauley wrote: In general, OpenFlow supports this feature by the wildcards field of ofp_match. So if you're on the C++ side, you may just set bits in there. There are constants that correlate to each of the match fields (e.g., match.wildcards = OFPFW_DL_DST would cause a switch to ignore the destination MAC address). IP addresses are a bit trickier, because you can wildcard a suffix. If you're doing this from Python, a lot of functions take an attrs dictionary to describe the flow. This includes thigs like send_flow_command(), install_datapath_flow(), etc. It has keys like dl_dst (or more properly, I think this is nox.lib.core.DL_DST). These dictionaries are translated to an ofp_match structure by set_match(), and entries which are not present in the dictionary are automatically wildcarded. So if you have some dictionary describing a flow in Python, you can just do del myflow[core.DL_DST], so there's no destination MAC to match on. Hope that helps. If you want more detail or a more specific answer, feel free to give some more context about what exactly you are trying to do or post some code. -- Murphy On Thursday, May 05, 2011 08:32:42 AM karim torkmen wrote: Hi, Is there any function in nox that allows to select the fields to match in a flow table (e.g. order the switch to ignore the destination mac address). Thanks a lot. Karim ___ 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
[nox-dev] matching fields
Hi, Is there any function in nox that allows to select the fields to match in a flow table (e.g. order the switch to ignore the destination mac address). Thanks a lot. Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] strange switches behaviour
Hi all, When trying my controller I noticed some strange behaviour. In fact, my aim is to set a path from one host to another. I started doing this by setting it statically. Than I enhanced it using the routing module to calculate the optimal path. However, when the enhanced controller is not working, I noticed that when one of the hosts sends traffic to the other, switch entries are set, as if there is another controller working in the background. In fact, i switched off one of the switches and the path was no more available. Any idea of what this can be ? Thanks a lot for the help, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
Re: [nox-dev] strange switches behaviour
Thanks a lot, it was because of the default switch behaviour as you explained :) On 05/03/2011 08:40 PM, Murphy McCauley wrote: I think the most likely explanation is that the switch is failing open. If a switch can't connect to a controller for some amount of time, it may fall back into a mode where it tries to pass traffic itself in hopes of not just bringing everything to a dead stop. Are you using Open vSwitch? This behavior is the default with Open vSwitch's openflowd, but can be changed with the --fail=... option. It logs some message about this when it happens, after which it pretty much *is* another controller that acts like an L2 learning switch. When it reconnects to its controller, it will stop doing this again. -- Murphy On Tuesday, May 03, 2011 10:42:46 AM karim torkmen wrote: Hi all, When trying my controller I noticed some strange behaviour. In fact, my aim is to set a path from one host to another. I started doing this by setting it statically. Than I enhanced it using the routing module to calculate the optimal path. However, when the enhanced controller is not working, I noticed that when one of the hosts sends traffic to the other, switch entries are set, as if there is another controller working in the background. In fact, i switched off one of the switches and the path was no more available. Any idea of what this can be ? Thanks a lot for the help, Karim ___ 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
[nox-dev] some explanations about pyrouting memebers
Hi, I need to know what does the following functions do, unfortuanately no documnetation is provided for them: - setup_flow(self, flow, dp, outport, bid, buf, timeout,actions, check_nat) - send_packet(self, dp, inport, outport, bid, buf, actions, check_nat, flow) Can anyone explain it to me. Thanks a lot, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] strange ethernet type returned by authenticator
Hi, I am using the authenticator module. I registered to the flow in event : self.register_handler(Flow_in_event.static_get_name(),self.flow_in_call_back) When I try to get the EtherType of a flow through calling this parameter: type = event.flow.dl_type I get EtherType equal to 25480 which is 0x6388, however I am expecting to get a PPP type 34915 (0x8863). Does any one have an idea about this, could it be a bug ? Thanks a lot for the help, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
Re: [nox-dev] error: no C++ to Python event converter
On 04/26/2011 07:46 PM, Murphy McCauley wrote: Actually, I think this event should work and that there is an event converter for it. Can you share a code snippet that exhibits the problem? And tell us which branch you're using? -- Murphy On Apr 26, 2011, at 7:35 AM, karim torkmen wrote: Hi all, I am trying to use the authenticator component, however it seems to be not fully supported by python. In fact, I get the following error: Host_auth_event has no C++ to Python event converter Is there any method to have this event converted to python. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev Sorry I forget to tell you the branch . It is zaku Thanks ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
Re: [nox-dev] error: no C++ to Python event converter
On 04/28/2011 07:26 PM, Murphy McCauley wrote: ave you noticed any weird errors from SWIG during the build or anything? Did you add pyauthenticator as a dependency for your component (though I don't think this would cause exactly that error)? Hi Murphy, In fact, it was a dependency problem :) Thanks a lot ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] error: no C++ to Python event converter
Hi all, I am trying to use the authenticator component, however it seems to be not fully supported by python. In fact, I get the following error: Host_auth_event has no C++ to Python event converter Is there any method to have this event converted to python. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] pybindings_storage
Hi, When executing the method 'get_names_by_mac()' of py_bindings I get the following output, which seems a little bit strange : [(u'authenticated', 2L, -1L), (u'authenticated', 1L, -1L)] Can you please telle what does this mean ? Thanks for your help. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
Re: [nox-dev] getting switch port number connected to a host
On 04/07/2011 05:46 AM, Kyriakos Zarifis wrote: void get_location_by_name(int64_t locationname, Name::Type name_type, const Get_locations_callback cb); Hi Kyriakos, Thanks for your reply :) I tried them like this : get_names_by_mac(create_eaddr('3e:b5:78:95:38:09'), cb) get_location_by_name(,4,cb) (the 4 here stands for SWITCH as I guessed, since using SWITCH returns always the unrecognised variable error) but they always return an empty dictionary :( Is there any other proposition ? Thanks, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] problem using authenticator
Hi, Is there any example that is using the authenticator component, I want to get access to the Auth_event and the other functionalities of it. I am having some troubles to install it. In fact, I did the following: from nox.netapps.authenticator.pyauth import pyauthenticator from nox.netapps.authenticator.pyauth import authenticator (as a second trial) And i get always the error of can not import python module etc. Than I tried with rom nox.netapps.authenticator.pyauth import * And the error now became at those levels: self.aut = self.resolve(authenticator) / self.aut = self.resolve(pyauthenticator): the error i got is : NameError: global name 'authenticator'/pyauthenticator is not defined and at this line of code self.register_handler (self.Auth_event.static_get_name(),self.auth_call_back) error AttributeError: try_topology instance has no attribute 'Auth_event' Thanks a lot for the help Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] problem constructing a datapath id
Hi, I am trying to use the method : self.bindings.get_names_by_ap(self.datapathid(),2,self.topology_call_back) Since it needs a datapathid i tried both the constructor datapathid() and the method create_datapathid_from_host(uint64_t id) given by the netinet lib, however eventhough i imported this lib it seems that it is not being recognized and I get the folowing error: 00069|reactor|ERR:Unhandled Error Traceback (most recent call last): --- exception caught here --- File ./nox/coreapps/pyrt/pyoxidereactor.py, line 86, in __call__ self.func(*self.args, **self.kw); File ./nox/coreapps/try_topology/try_topology.py, line 48, in call_back self.debugPrint(self.bindings.get_names_by_ap(self.datapathid(),2,self.topology_call_back)) exceptions.AttributeError: try_topology instance has no attribute 'datapathid' My second question is in the following method: def get_entities_by_name(self,name, name_type, cb), what are the values that can be taken by name and name_type, in the nox spec (under nox/src/nox/apps/bindings_storage/bs_datastructures.i) name_type can be for example : HOST,SWITCH etc. but using one of them I get the error that those values are not defined. Any help would be very appreciated. Thanks a lot, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] getting switch port number connected to a host
Hi, I am trying to retrieve the topology of an openflow network through pybindings_storage. Untill now, I succeed to get the different connections between the switches i.e the tuple (src_dpid,src_port,dst_dpid,dst_port) through the method get_all_links() which seems to return just teh links between the switches. But, I still need to have a tuple of the type (host_mac_address, dst_dpid,dst_port). Any idea about how to get this information. Thanks a lot for your help. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] problem running a new component
Hi, I am developing a new component called try_topology that uses the bindings_storage component. When I run it with this command : - ./nox_core -v -i ptcp:6633 pybindings_storage try_topology It returns no errors. However, by calling just the try_topolgy component, I get the following error: 00042|nox|ERR:Cannot change the state of 'try_topology' to INSTALLED: 'try_topology' ran into an error: cannot import a Python module 'nox.coreapps.try_topology.try_topology': Traceback (most recent call last): File /home/karim/nox/build/src/nox/coreapps/try_topology/try_topology.py, line 3, in module from nox.netapps.bindings_storage.pybindings_storage import pybindings_storage File /home/karim/nox/build/src/nox/netapps/bindings_storage/pybindings_storage.py, line 25, in module _pybindings_storage = swig_import_helper() File /home/karim/nox/build/src/nox/netapps/bindings_storage/pybindings_storage.py, line 21, in swig_import_helper _mod = imp.load_module('_pybindings_storage', fp, pathname, description) ImportError: /home/karim/nox/build/src/nox/netapps/bindings_storage/_pybindings_storage.so: undefined symbol: vigil::applications::Bindings_Storage::get_all_names(vigil::applications::Name::Type, boost::functionvoid ()(std::__debug::listvigil::applications::Name, std::allocatorvigil::applications::Name ) const) Any Idea about this error. Thanks a lot, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
Re: [nox-dev] 00005|nox|ERR:Application
Hi Kyriakos, Thanks for the answer :) Yes, indeed I compiled nox again, but nothing changed. Also, the examples that are included in nox such as pyloop etc. do not work for me. On 03/31/2011 11:29 PM, Kyriakos Zarifis wrote: Hi Karim, did you rerun ../configure and make after you edited configure.ac http://configure.ac and Makefile.am? On Thu, Mar 31, 2011 at 7:42 AM, karim torkmen karim.torkm...@gmail.com mailto:karim.torkm...@gmail.com wrote: Hi, I developed a component when I try to run it, I get the following error message : 1|nox|INFO:Starting nox_core (/nox/build/src/.libs/lt-nox_core) 2|nox|DBG:Application installation report: 3|nox|DBG:built-in DSO deployer: Current state: INSTALLED Required state: INSTALLED Dependencies: 4|nox|DBG:built-in event dispatcher: Current state: INSTALLED Required state: INSTALLED Dependencies: 5|nox|ERR:Application 'try_topology' description not found. *** To add my component I tried two methods: The first one is through executing the script : nox-new-c-app.py The second one is by editing meta.json, configure.ac http://configure.ac and Makefile.am. Unfortunately, none of them was able to make me run my component. Thank you for your help. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org mailto: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
Re: [nox-dev] 00005|nox|ERR:Application
Hi, In fact I forgot to add this line to configure: src/nox/coreapps/try_topology/Makefile Now, the problem is with make. I think I did not edit well the makefile.am since when compiling it gives me this error: No rule to make target `try_topology.py', needed by `all-am'. Stop. Here is my makefile.am: include ../../../Make.vars EXTRA_DIST =\ meta.json\ __init__.py\ try_topology.py NOX_RUNTIMEFILES = meta.json\ __init__.py\ try_topology.py all-local: nox-all-local clean-local: nox-clean-local install-exec-hook: nox-install-local and my meta.json file: { components: [ { name: try_topology , dependencies: [ python ], python: nox.coreapps.try_topology.try_topology } ] } Can you please check if everything is ok ? Thanks a lot for your kind help. Regards, Karim On 04/01/2011 10:32 AM, kk yap wrote: Try editing configure.ac.in and rerunning ./boot.sh, ../configure and make. Regards KK On 1 April 2011 01:30, Kyriakos Zarifiskyr.zari...@gmail.com wrote: Hey, you only need to rebuild NOX the first time you introduce a new python component (after following the instructions on the wiki), so that the links are created to the build/src/ directory. After that, you can simply run NOX each time you edit your python component. On Thu, Mar 31, 2011 at 11:32 PM, Bill Liaolwlw1...@gmail.com wrote: On Fri, Apr 1, 2011 at 5:29 AM, Kyriakos Zarifiskyr.zari...@gmail.com wrote: Hi Karim, did you rerun ../configure and make after you edited configure.ac and Makefile.am? On Thu, Mar 31, 2011 at 7:42 AM, karim torkmen karim.torkm...@gmail.com wrote: Hi, I developed a component when I try to run it, I get the following error message : 1|nox|INFO:Starting nox_core (/nox/build/src/.libs/lt-nox_core) 2|nox|DBG:Application installation report: 3|nox|DBG:built-in DSO deployer: Current state: INSTALLED Required state: INSTALLED Dependencies: 4|nox|DBG:built-in event dispatcher: Current state: INSTALLED Required state: INSTALLED Dependencies: 5|nox|ERR:Application 'try_topology' description not found. *** To add my component I tried two methods: The first one is through executing the script : nox-new-c-app.py The second one is by editing meta.json, configure.ac and Makefile.am. Unfortunately, none of them was able to make me run my component. Thank you for your help. Regards, Karim ___ 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 Hi, Kyriakos Sorry to interrupt. But I'm wondering is it necessary to re-make after building a new python component. As far as I know after reading some source, there is no such requirement right? The python component is managed by PyRt, just as Dso-deployer. So, for c++ component, maybe we should make to produce the *.so dynamic library, but what will MAKE produce for new python component? Regards wliao ___ 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 ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] 00005|nox|ERR:Application
Hi, I developed a component when I try to run it, I get the following error message : 1|nox|INFO:Starting nox_core (/nox/build/src/.libs/lt-nox_core) 2|nox|DBG:Application installation report: 3|nox|DBG:built-in DSO deployer: Current state: INSTALLED Required state: INSTALLED Dependencies: 4|nox|DBG:built-in event dispatcher: Current state: INSTALLED Required state: INSTALLED Dependencies: 5|nox|ERR:Application 'try_topology' description not found. *** To add my component I tried two methods: The first one is through executing the script : nox-new-c-app.py The second one is by editing meta.json, configure.ac and Makefile.am. Unfortunately, none of them was able to make me run my component. Thank you for your help. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] correspondence mac address port number
Hi, I want to set-up statically a path using openflow but the install_datapath_flow() method does not accept mac address as parameter, so I need to know the correspondence between mac addresses and port numbers in a switch so that I can choose the out_port that is correspondent to a mac address. Is there any method that allows it ? Thanks a lot, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
Re: [nox-dev] correspondence mac address port number
On 03/29/2011 12:29 PM, Kyriakos Zarifis wrote: Hi Karim, the second parameter of install_datapath_flow() is a python dictionary that describes the flow for which you are setting up an entry. This is where you specify the MAC address(es). Create a dictionary, populate as you want (the keys for the source and destination addresses are 'dl_src' and 'dl_dst' respectively. - missing key/value pair equals wildcard for that field), and pass it to install_datapath_flow. If you take a look at src/nox/lib/core.py, which defines the python API, you'll find some information about this in the definition of install_datapath_flow() On Tue, Mar 29, 2011 at 3:03 AM, karim torkmen karim.torkm...@gmail.com mailto:karim.torkm...@gmail.com wrote: Hi, I want to set-up statically a path using openflow but the install_datapath_flow() method does not accept mac address as parameter, so I need to know the correspondence between mac addresses and port numbers in a switch so that I can choose the out_port that is correspondent to a mac address. Is there any method that allows it ? Thanks a lot, Karim ___ nox-dev mailing list nox-dev@noxrepo.org mailto:nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev Thanks Kyriakos :) My question was not very well formulated ;) I meant in order to set a path I need to know the topology of the openFlow network, e.g. port 1 of switch 1 is linked to port 1 of switch 2 etc. in order to decide how to populate the switching table. Is there any method to get this information ? Thanks a lot ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] some explanations about the pyswitch code
Hi all, I am starting with openFlow and nox. As starting example I am trying to understand the pyswitch code. However, there are some lines of code that are not very clear to me. Those lines are : 1- if ord(srcaddr[0]) 1: what is really meant by this condition ? 2- dst[0] != inport: why should we use dst[0] in stead of just 'dst' ? Isn't it a string so why to take the first character ? 3- mac = mac_to_int(packet.src): the variable mac is just invoked in this line, so what is its usefulness, sine this variable is not accessed by any function ? 4- can you provide me with exact format of the 'st ' dictionary ? (e.g st[dpid][mac_address][etc.]) Thank you very much. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] some confusions about the inport parameter
Hi, I am a little bit confused about the inport parameter in : * send_openflow(dpid, bufid, buf, openflow.OFPP_FLOOD, inport) And in: * install_datapath_flow(dpid, flow, 5, 0, actions, bufid, openflow.OFP_DEFAULT_PRIORITY, inport, packet) Do they design the port of communication between the controller and the switch, or the port from which a switch received a packet and that has after to forward it to the controller. In the first case it seems that the inport is the port between the controller and the switch, however the second case seems to be the port from which a switch received a packet. Thanks a lot. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
Re: [nox-dev] some confusions about the inport parameter
Thanks Kyriakos :) In fact, my confusion came from the fact that the inport is got from registering to the packet_in event. So when you register you get the inport, however this inport is used for two different cases. So, in the case where the inport is got from registering to the packet_in event, would this be the port from which the controller received the packet from the switch or the port from which the switch received the packet from the network but did not know how to handle it. Thanks again! On 03/28/2011 06:39 PM, Kyriakos Zarifis wrote: Hi Karim, 'inport' actually refers to a different thing in each case: * send_openflow(dpid, bufid, buf, openflow.OFPP_FLOOD, inport) send_openflow is used to inject a packet in the network, and send it out the 'dpids's port(s) described the 4th parameter. The switch should treat the packet as if it arrived on 'inport'. The packet actually arrives through the openflow channel, but you use this for things like openflow.OFPP_TABLE, where the packet will be forwarded based on the flow_table matches, in which case it needs to have arrived on a physical port. * install_datapath_flow(dpid, flow, 5, 0, actions, bufid, openflow.OFP_DEFAULT_PRIORITY, inport, packet) Here it is indeed what you said: it is the input port to match for this flow entry we are installing. (after installing this entry, packets matching 'flow' arriving on 'inport' all be treated according to 'actions') Do they design the port of communication between the controller and the switch, or the port from which a switch received a packet and that has after to forward it to the controller. In the first case it seems that the inport is the port between the controller and the switch, however the second case seems to be the port from which a switch received a packet. Thanks a lot. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org mailto: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
[nox-dev] packet_in_event
Hi all, I have some problem to understand some conditions in the nox example 'pyswitch'. *My first question is that when a packet_in_event is received by the controller, the 'inport' parameter designs the port of controller that received the packet from the switch or the port of the switch that received the packet. Than, in the following code: def forward_l2_packet(dpid, inport, packet, buf, bufid): dstaddr = packet.dst.tostring() if not ord(dstaddr[0]) 1 and inst.st[dpid].has_key(dstaddr): prt = inst.st[dpid][dstaddr] if prt[0] == inport: log.err('**warning** learned port = inport', system=ppp_switch) inst.send_openflow(dpid, bufid, buf, openflow.OFPP_FLOOD, inport) else: # We know the outport, set up a flow log.msg('installing flow for ' + str(packet), system=ppp_switch) flow = extract_flow(packet) flow[core.IN_PORT] = inport actions = [[openflow.OFPAT_OUTPUT, [0, prt[0 inst.install_datapath_flow(dpid, flow, CACHE_TIMEOUT, actions, bufid, openflow.OFP_DEFAULT_PRIORITY, inport, buf) else: # haven't learned destination MAC. Flood inst.send_openflow(dpid, bufid, buf, openflow.OFPP_FLOOD, inport) why do we compare the prt[0] to the inport and why do we do a inst.send_openflow(dpid, bufid, buf, openflow.OFPP_FLOOD, inport) when they are equal but we do inst.install_datapath_flow(dpid, flow, CACHE_TIMEOUT, actions, bufid, openflow.OFP_DEFAULT_PRIORITY, inport, buf) when they are different. Thanks a lot and sorry for bothering with those basic questions. Regards, Karim ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev