Re: [nox-dev] Information on Python APIs available in NOX controller.
Thanks Kyriakos, James & KK for the inputs. Few more questions down.. Appreciate your help : ) 1. I checked the file pytutorial.py and then modified it by simply adding some print commands and then restarting the nox controller. It did print my commands. So instead of taking a new file and changing the xml(json) file, I decided I will make the changes in this code and then test my code. I want to know is there any limitation of using this approach or I need to start with the new file and make changes in the configuration files? 2. Like I mentioned in the earlier email, that I would like to parse the packets based on the IP addresses and port number. By reading the documentation I have understood that I need to perform following operations, Would request someone to validate my assumptions: a. I need to convert the pytutorial.py into a learning switch. The learning switch example is giving in pyswitch.py file. One approach is to merge the code of these two files in pytutorial.py for testing. Is this correct? b. Once I have this learning switch working, I need to get the packet information. For this I will be using code present in IPv4.py, tcp.py, udp.py. Learning switch is layer 2 device as created in step above, how would I extract layer 3 packet information from the packet received by this switch. Is the code available in the files in "packet" folder? c. Once the packet information is obtained, then I would like to modify the flow-tables . For this, core.py has functions to install the flow paths. So I simply call the functions in core.py with my own arguments and I should be able to set the flowpaths. d. Since I would be calling the files like pyswitch.py, IPv4.py, core.py etc which are located in different folders, do I need to modify any configuration in Pytutorial.py so that they can find all the respective files when NOX is executed. e. Also to configure queues in switch and setting buffer etc, I would require dpctl tool or can I perform all the tasks what dpctl does using the python code? Thanks, Kavitesh. -Original Message- From: yap...@gmail.com [mailto:yap...@gmail.com] On Behalf Of kk yap Sent: Thursday, November 11, 2010 08:06 PM To: James Murphy McCauley Cc: Kavitesh Singh; nox-dev@noxrepo.org Subject: Re: [nox-dev] Information on Python APIs available in NOX controller. Just one thing, please use doxygen. Reading code is unfortunately still necessary at this point, but we are happy to take patches for documentation. Regards KK On 11 November 2010 15:25, James "Murphy" McCauley < <mailto:jam...@nau.edu> jam...@nau.edu> wrote: > Responses inline. > > On Thu, 2010-11-11 at 15:24 -0500, Kavitesh Singh wrote: >> Hi, >> >> >> >> I have recently started learning Openflow using NOX controller. I >> have downloaded the VMware image available on OpenFlow website having >> inbuilt NOX controller. >> >> >> >> I am following the tutorial available at >> <http://openflowswitch.org/wk/index.php/HOTITutorial2010> http://openflowswitch.org/wk/index.php/HOTITutorial2010 >> >> >> >> I require help on following issues, would appreciate if the developer >> community assist me this: >> >> 1. I am new to Python so it takes a bit of time for me to get >> hold of the APIs which are available in NOX controller. I am looking >> for some documentation on APIs which I can/would use in programming >> of NOX controller. I am not looking for generic tutorial on Python. > > Reading the code is probably the best way. A lot of the good stuff is > in src/nox/lib/core.py and is somewhat documented in there. The > example components (like pyswitch) are also useful. > > There is also some good content on both the noxrepo and the OpenFlow > wikis. For example: > <http://noxrepo.org/noxwiki/index.php/Developing_in_NOX> http://noxrepo.org/noxwiki/index.php/Developing_in_NOX > <http://noxrepo.org/noxwiki/index.php/FAQ> http://noxrepo.org/noxwiki/index.php/FAQ > <http://www.openflowswitch.org/wk/index.php/Brazil_tutorial#Learning_NO> http://www.openflowswitch.org/wk/index.php/Brazil_tutorial#Learning_NO > X > >> 2. I was able to run the NOX controller using "./nox_core -v -i >> ptcp: pytutorial" command. In this command the pytutorial is the >> pytutorial.py file. Would we not require to provide a full path for >> this file(~/noxcore/src/nox/coreapps/tutorial/pytutorial.py) or the >> VMware consist of some variables for this particular file? Can I >> replace this file with say my test.py and run the command normally by >> "./nox_core -v -i ptcp: test" > > A
Re: [nox-dev] Information on Python APIs available in NOX controller.
Just one thing, please use doxygen. Reading code is unfortunately still necessary at this point, but we are happy to take patches for documentation. Regards KK On 11 November 2010 15:25, James "Murphy" McCauley wrote: > Responses inline. > > On Thu, 2010-11-11 at 15:24 -0500, Kavitesh Singh wrote: >> Hi, >> >> >> >> I have recently started learning Openflow using NOX controller. I have >> downloaded the VMware image available on OpenFlow website having >> inbuilt NOX controller. >> >> >> >> I am following the tutorial available at >> http://openflowswitch.org/wk/index.php/HOTITutorial2010 >> >> >> >> I require help on following issues, would appreciate if the developer >> community assist me this: >> >> 1. I am new to Python so it takes a bit of time for me to get >> hold of the APIs which are available in NOX controller. I am looking >> for some documentation on APIs which I can/would use in programming of >> NOX controller. I am not looking for generic tutorial on Python. > > Reading the code is probably the best way. A lot of the good stuff is > in src/nox/lib/core.py and is somewhat documented in there. The example > components (like pyswitch) are also useful. > > There is also some good content on both the noxrepo and the OpenFlow > wikis. For example: > http://noxrepo.org/noxwiki/index.php/Developing_in_NOX > http://noxrepo.org/noxwiki/index.php/FAQ > http://www.openflowswitch.org/wk/index.php/Brazil_tutorial#Learning_NOX > >> 2. I was able to run the NOX controller using “./nox_core -v -i >> ptcp: pytutorial” command. In this command the pytutorial is the >> pytutorial.py file. Would we not require to provide a full path for >> this file(~/noxcore/src/nox/coreapps/tutorial/pytutorial.py) or the >> VMware consist of some variables for this particular file? Can I >> replace this file with say my test.py and run the command normally by >> “./nox_core -v -i ptcp: test” > > Actually, no. The "pytutorial" in the commandline refers to the > pytutorial *component*. That this particular component happens to be > implemented in a file called pytutorial.py is "just happenstance" -- it > could have been in foo.py. > > NOX components are defined in the meta.json files (or meta.xml for older > versions). These are scanned for and parsed when NOX starts up. They > define (among other things): a component's name (pytutorial in your > case), its dependencies (which other components it needs to be loaded), > and where/how it is implemented (in your case, pytutorial.py, but this > could also be a shared library, etc.). > > The first link to the NOX wiki above has further information on this > topic. > >> 3. I am trying to figure out a way in which packets coming from >> hosts are parsed by the switch using Python. I would like to know the >> source and destination address of the packets and also the port >> numbers like 8080,121 etc. Any clues to the types of Python APIs which >> I would be requiring would be a great help. > > The code that does the parsing is in src/nox/lib/packet/. In your case, > you are probably interested in ipv4.py, and tcp.py or udp.py. > >> 4. Also, for generating traffic between the nodes created using >> mIninet, should I use iPerf or cBench? > > I think iperf. cBench *emulates* switches and only generates very > specific traffic for doing benchmarking. I can't immediately think of > why it'd be desirable to use in conjunction with mininet. > >> Thanks, >> >> Kavitesh. > > > > ___ > nox-dev mailing list > nox-dev@noxrepo.org > http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org > ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
Re: [nox-dev] Information on Python APIs available in NOX controller.
Responses inline. On Thu, 2010-11-11 at 15:24 -0500, Kavitesh Singh wrote: > Hi, > > > > I have recently started learning Openflow using NOX controller. I have > downloaded the VMware image available on OpenFlow website having > inbuilt NOX controller. > > > > I am following the tutorial available at > http://openflowswitch.org/wk/index.php/HOTITutorial2010 > > > > I require help on following issues, would appreciate if the developer > community assist me this: > > 1. I am new to Python so it takes a bit of time for me to get > hold of the APIs which are available in NOX controller. I am looking > for some documentation on APIs which I can/would use in programming of > NOX controller. I am not looking for generic tutorial on Python. Reading the code is probably the best way. A lot of the good stuff is in src/nox/lib/core.py and is somewhat documented in there. The example components (like pyswitch) are also useful. There is also some good content on both the noxrepo and the OpenFlow wikis. For example: http://noxrepo.org/noxwiki/index.php/Developing_in_NOX http://noxrepo.org/noxwiki/index.php/FAQ http://www.openflowswitch.org/wk/index.php/Brazil_tutorial#Learning_NOX > 2. I was able to run the NOX controller using “./nox_core -v -i > ptcp: pytutorial” command. In this command the pytutorial is the > pytutorial.py file. Would we not require to provide a full path for > this file(~/noxcore/src/nox/coreapps/tutorial/pytutorial.py) or the > VMware consist of some variables for this particular file? Can I > replace this file with say my test.py and run the command normally by > “./nox_core -v -i ptcp: test” Actually, no. The "pytutorial" in the commandline refers to the pytutorial *component*. That this particular component happens to be implemented in a file called pytutorial.py is "just happenstance" -- it could have been in foo.py. NOX components are defined in the meta.json files (or meta.xml for older versions). These are scanned for and parsed when NOX starts up. They define (among other things): a component's name (pytutorial in your case), its dependencies (which other components it needs to be loaded), and where/how it is implemented (in your case, pytutorial.py, but this could also be a shared library, etc.). The first link to the NOX wiki above has further information on this topic. > 3. I am trying to figure out a way in which packets coming from > hosts are parsed by the switch using Python. I would like to know the > source and destination address of the packets and also the port > numbers like 8080,121 etc. Any clues to the types of Python APIs which > I would be requiring would be a great help. The code that does the parsing is in src/nox/lib/packet/. In your case, you are probably interested in ipv4.py, and tcp.py or udp.py. > 4. Also, for generating traffic between the nodes created using > mIninet, should I use iPerf or cBench? I think iperf. cBench *emulates* switches and only generates very specific traffic for doing benchmarking. I can't immediately think of why it'd be desirable to use in conjunction with mininet. > Thanks, > > Kavitesh. ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
Re: [nox-dev] Information on Python APIs available in NOX controller.
Hi Kavitesh, > 1. I am new to Python so it takes a bit of time for me to get hold > of the APIs which are available in NOX controller. I am looking for some > documentation on APIs which I can/would use in programming of NOX > controller. I am not looking for generic tutorial on Python. > Although not exhaustive, part of the API is described here: http://noxrepo.org/noxwiki/index.php/Developing_in_NOX The best to familiarize with the API still remains to look some examples (e.g. the components in the coreapps/examples/ folder) > 2. I was able to run the NOX controller using “./nox_core -v -i > ptcp: pytutorial” command. In this command the pytutorial is the > pytutorial.py file. Would we not require to provide a full path for this > file(~/noxcore/src/nox/coreapps/tutorial/pytutorial.py) or the VMware > consist of some variables for this particular file? Can I replace this file > with say my test.py and run the command normally by “./nox_core -v -i ptcp: > test” > Simply replacing / renaming the file would not work; take a look at this: http://noxrepo.org/noxwiki/index.php/FAQ#Where_can_I_see_and_edit_the_code_that_corresponds_to_different_NOX_components.3F > 3. I am trying to figure out a way in which packets coming from > hosts are parsed by the switch using Python. I would like to know the source > and destination address of the packets and also the port numbers like > 8080,121 etc. Any clues to the types of Python APIs which I would be > requiring would be a great help. > The packet parsing library under nox/lib/packet/ is the API for that. For example usage you could take a look at 'pyswitch', which does some basic parsing. That should give you an idea of how the API works > 4. Also, for generating traffic between the nodes created using > mIninet, should I use iPerf or cBench? > I have used iPerf and it worked fine Regards ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
[nox-dev] Information on Python APIs available in NOX controller.
Hi, I have recently started learning Openflow using NOX controller. I have downloaded the VMware image available on OpenFlow website having inbuilt NOX controller. I am following the tutorial available at http://openflowswitch.org/wk/index.php/HOTITutorial2010 I require help on following issues, would appreciate if the developer community assist me this: 1. I am new to Python so it takes a bit of time for me to get hold of the APIs which are available in NOX controller. I am looking for some documentation on APIs which I can/would use in programming of NOX controller. I am not looking for generic tutorial on Python. 2. I was able to run the NOX controller using "./nox_core -v -i ptcp: pytutorial" command. In this command the pytutorial is the pytutorial.py file. Would we not require to provide a full path for this file(~/noxcore/src/nox/coreapps/tutorial/pytutorial.py) or the VMware consist of some variables for this particular file? Can I replace this file with say my test.py and run the command normally by "./nox_core -v -i ptcp: test" 3. I am trying to figure out a way in which packets coming from hosts are parsed by the switch using Python. I would like to know the source and destination address of the packets and also the port numbers like 8080,121 etc. Any clues to the types of Python APIs which I would be requiring would be a great help. 4. Also, for generating traffic between the nodes created using mIninet, should I use iPerf or cBench? Thanks, Kavitesh. ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org