Re: [nox-dev] ports statistics questions

2012-03-07 Thread Murphy McCauley
What you're doing looks about right.

A note here is that you have to be doing "reactive" flow installations for this 
to work -- something like what sprouting and pyswitch do.  Since these install 
exact matches on demand, you'll be likely to see the first packet of each flow 
at the controller, which you'll need if what you're looking for is the sequence 
of TCP/UDP port usage.

As well as the wiki documentation on noxrepo, you can also build doxygen 
documentation from the source code.

-- Murphy

On Mar 7, 2012, at 11:12 AM, Diana Marosin wrote:

> Hello,
> 
> Can you please be more explicit on how is this done from the flows?
> 
> I tried using the packet in callback, like this:
> flow=extract_flow(packet)
> if not self.port_stat.has_key(dpid):
> self.port_stat[dpid] = []
> self.port_stat[dpid].append(int(flow['tp_dst']))
> 
> I would like to know if there is another way for extracting the tcp/udp 
> ports. The final goal is to retrieve all the ports sequences from a switch in 
> order to check later for patterns. 
> 
> Also, can you point me to a good documentation? I am currently using the one 
> on noxrepo.
> 
> Thanks a lot! 
> Diana
> On Sat, Feb 18, 2012 at 11:25 AM, Murphy McCauley  wrote:
> Ah, I begin to see the problem here. :)
> 
> The ports that the port stats are referring to are *switch ports*.  Like the 
> ethernet and wifi interfaces.  Not TCP/UDP ports.
> 
> If you want to gather statistics on TCP/UDP ports, you do that by installing 
> flows that match on those TCP/UDP ports and then monitoring the flow stats.
> 
> -- Murphy
> 
> On Feb 18, 2012, at 1:53 AM, Diana Marosin wrote:
> 
>> Hello,
>> 
>> I use a Linksys wrt54gl, v1.1.
>> 
>> With Wireshark I can identify ports 46245 for ACK controller -> switch and 
>> 22 for the SSH PC -> switch, in nox the output is totally different.
>> 
>> In nox, if I use the monitoring.py I receive empty stats and ports 1 and 
>> 65534, but if I use the packet_in_callback I can extract the port from the 
>> packet (here the 22 for the ssh)
>> 
>> Maybe I misunderstood what those stats should show, but please point me in 
>> the right direction.
>> 
>> My output is in this form :
>> Aggregate stats in from datapath 58:6d:87:62:f8:b1
>> {'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L}
>> packet_in_callback:  58:6d:87:62:f8:b1
>> ssh packet received on port 22
>> Table stats in from datapath 58:6d:87:62:f8:b1
>> hash2 : 0
>> linear : 0
>> Port stats in from datapath 58:6d:87:62:f8:b1
>> 1 : 4162
>> 65534 : 0
>> 
>> My code is bellow:
>> def aggregate_timer(self, dpid):
>> flow = ofp_match() 
>> flow.wildcards = 0x
>> self.ctxt.send_aggregate_stats_request(dpid, flow,  0xff)
>> self.post_callback(MONITOR_TABLE_PERIOD, lambda : 
>> self.aggregate_timer(dpid))
>> 
>> def table_timer(self, dpid):
>> self.ctxt.send_table_stats_request(dpid)
>> self.post_callback(MONITOR_TABLE_PERIOD, lambda : 
>> self.table_timer(dpid))
>> 
>> def port_timer(self, dpid):
>> self.ctxt.send_port_stats_request(dpid, OFPP_NONE)
>> self.post_callback(MONITOR_PORT_PERIOD, lambda : 
>> self.port_timer(dpid))
>> 
>> # For each new datapath that joins, create a timer loop that monitors
>> # the statistics for that switch
>> def datapath_join_callback(self, dpid, stats):
>> print "datapath_join_callback: ", longlong_to_octstr(dpid)[6:]
>> self.post_callback(MONITOR_TABLE_PERIOD, lambda : 
>> self.table_timer(dpid))
>> self.post_callback(MONITOR_PORT_PERIOD + 1, lambda :  
>> self.port_timer(dpid))
>> self.post_callback(MONITOR_AGGREGATE_PERIOD + 2, lambda :  
>> self.aggregate_timer(dpid))
>> 
>> def aggregate_stats_in_handler(self, dpid, stats):
>> print "Aggregate stats in from datapath", 
>> longlong_to_octstr(dpid)[6:]
>> print '\t',stats
>> 
>> def table_stats_in_handler(self, dpid, tables):
>> print "Table stats in from datapath", longlong_to_octstr(dpid)[6:]
>> for item in tables:
>> print '\t',item['name'],':',item['active_count']
>> 
>> def port_stats_in_handler(self, dpid, ports):
>> print "Port stats in from datapath", longlong_to_octstr(dpid)[6:]
>> 

[nox-dev] IMPORTANT: noxrepo.org service outage is forthcoming

2012-03-01 Thread Murphy McCauley
Sometime in the next few days, you may have trouble connecting to noxrepo.org 
and there may be problems with the mailing list and git repositories.  
Hopefully this will be quite short-lived, but I wanted to give a heads up that 
this is liable to occur.

If you have problems, you might want to try finding help on the freenode IRC 
network in our new home: #noxrepo.  For a web-based IRC client, check out 
http://webchat.freenode.net/ .

Sorry for any inconvenience this may cause; we hope to have it sorted out soon.

-- Murphy
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] For help

2012-03-01 Thread Murphy McCauley
Yeah, I think that looks right.

-- Murphy

On Mar 1, 2012, at 7:26 AM, bbs wrote:

> Hi,
> I am writing a component for the nox controller, which can guid the 
> openflow-switch to decide which port to send the packets. But, when I want 
> the packet to be sent to the "local port" in the openflow-switch, I didn't 
> know how to write the "actions list"( using python),  Is the following  right?
>   actions = [[openflow.OFPAT_OUTPUT, [0, OFPP_LOCAL]]]
> 
> Thank you for your replay!
> 
> John
> 
> 
> 在 2012-03-01 21:54:23,"Murphy McCauley"  写道:
> I'm not clear on what you want to do…
> 
> What do you mean by "the local machine"?  The controller?
> Where do you want to output them?  Out of an ethernet adapter?
> 
> -- Murphy
> 
> On Mar 1, 2012, at 2:43 AM, bbs wrote:
> 
>>  Hi,
>> I want to let the packets send to the local machine, how could I write 
>> the command, and what is the output port? 
>> actions = [[openflow.OFPAT_OUTPUT, [0, ?]]]
>> 
>> Thank you very much!
>> 
>> John
>> 
>> 
>> 
>> ___
>> 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


Re: [nox-dev] For help

2012-03-01 Thread Murphy McCauley
I'm not clear on what you want to do…

What do you mean by "the local machine"?  The controller?
Where do you want to output them?  Out of an ethernet adapter?

-- Murphy

On Mar 1, 2012, at 2:43 AM, bbs wrote:

>  Hi,
> I want to let the packets send to the local machine, how could I write 
> the command, and what is the output port? 
> actions = [[openflow.OFPAT_OUTPUT, [0, ?]]]
> 
> Thank you very much!
> 
> John
> 
> 
> 
> ___
> 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


Re: [nox-dev] How to configure an OpenFlow network in in-band mode?

2012-02-28 Thread Murphy McCauley
There are multiple ways that you can set up in-band control, and I believe 
support varies depending on the specific type of switch you're using, so you 
will probably get a better response by asking the specific switch vendor.

(By the way, your message was posted to the list like five or six times.  I am 
guessing this is because you kept getting strange responses because you not 
only sent to nox-dev, but to nox-dev-request.  Please send messages to the list 
only to nox-dev.)

-- Murphy

On Feb 28, 2012, at 5:55 PM, chenyangseamoon wrote:

> Hi,
> I'd like to configure an OpenFlow network in in-band mode. Which document 
> should I refre to? And if the OpenFlow network is configured in this mode how 
> can each OFSwitch connect to the nox controller and how does NOX controller 
> communicate to each OFSwitch?Is there any mechanism that allows OFSwitch to 
> discover its neighbor OFSwitch? My OpenFlow network topology looks like this.
> Only OFSwitch1 connects to NOX controller 
> .NOX Controller...
> clietnt1---OFSwtich2OFSwitch1---OFSwitch3---client2
> client1 IP:192.168.1.1
> client2 IP:192.168.1.2
> NOX controller IP:192.168.1.10
> The NIC of OFSwich1 connects to NOX controller IP:192.168.1.3
> Other OFSwitches' NIC has no IP Address
> 2012-02-29
> chenyangseamoon
> 
> 
> 
> 
> 
> 
> ___
> 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


Re: [nox-dev] Help with NOX to OpenFlow messages

2012-02-28 Thread Murphy McCauley
This sounds like a switch configuration issue; you might try whatever support 
channels HP provides.

Is NOX configured to listen for connections on whatever port you set the 
switches to connect to?

-- Murphy

On Feb 28, 2012, at 3:36 PM, Elias Marti Paz-Rudolph wrote:

> I am using HP ProCurve 3500 yl switches. i have configured the switch to 
> listen on port 6633. 
> I am using ipv4 addresses. I also configured the switch to point to my nox 
> controller. I was using dpctl to see if the switches connect and they dont. I 
> am using Ubuntu to run NOX
> 
> --Elias
> On Feb 28, 2012, at 4:25 PM, Murphy McCauley  wrote:
> 
> "OpenFlow version 2.02" doesn't mean anything to me.  What kind of switches 
> are you using?
> 
> What IP address are you using with dpctl?  The switch?  In general, switches 
> make active connections (they initiate a connection to the controller/NOX), 
> so it's not listening on port 6633.  Sometimes switches can also be 
> configured to listen too, but it depends on the switch and on the 
> configuration.
> 
> More to the point, you say that you're trying to get NOX to send messages to 
> the switch, but dpctl doesn't have anything to do with that.  Have you 
> configured the switches to connect to the IP that you're running NOX on?  If 
> you run NOX and set it to listen for connections, do the switches connect?  
> What commandline are you running NOX with?
> 
> -- Murphy
> 
> On Feb 28, 2012, at 3:11 PM, Elias Marti Paz-Rudolph wrote:
> 
> 
> 
> Hello,
> I am in the beginning stages of implementing an OpenFlow network. I believe i 
> have configured my switch correctly. I am trying to get NOX to send messages 
> to the switch.
> When i send
> 
> dpctl dump-tables tcp:xxx.xx.xx.xxx:6633
> 
> i get a connection refused message back.
> 
> I am using NOX version 0.9.0
> 
> and OpenFlow version  2.02
> 
> Can you help me this is?
> 
> Thanks
> Elias
> 
> 
> 
> 
> Elias Paz
> CompE Undergraduate
> member of HESO
> Hispanic Engineering and
> Science Organization(SHPE/MAES)
> nmeli...@unm.edu
> (505) 550-9554
> ___
> 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


Re: [nox-dev] Help with NOX to OpenFlow messages

2012-02-28 Thread Murphy McCauley
"OpenFlow version 2.02" doesn't mean anything to me.  What kind of switches are 
you using?

What IP address are you using with dpctl?  The switch?  In general, switches 
make active connections (they initiate a connection to the controller/NOX), so 
it's not listening on port 6633.  Sometimes switches can also be configured to 
listen too, but it depends on the switch and on the configuration.

More to the point, you say that you're trying to get NOX to send messages to 
the switch, but dpctl doesn't have anything to do with that.  Have you 
configured the switches to connect to the IP that you're running NOX on?  If 
you run NOX and set it to listen for connections, do the switches connect?  
What commandline are you running NOX with?

-- Murphy

On Feb 28, 2012, at 3:11 PM, Elias Marti Paz-Rudolph wrote:

> 
> 
> Hello, 
> I am in the beginning stages of implementing an OpenFlow network. I believe i 
> have configured my switch correctly. I am trying to get NOX to send messages 
> to the switch. 
> When i send
> 
> dpctl dump-tables tcp:xxx.xx.xx.xxx:6633
> 
> i get a connection refused message back. 
> 
> I am using NOX version 0.9.0 
> 
> and OpenFlow version  2.02
> 
> Can you help me this is?
> 
> Thanks 
> Elias 
> 
> 
> 
> 
> Elias Paz
> CompE Undergraduate
> member of HESO
> Hispanic Engineering and
> Science Organization(SHPE/MAES)
> nmeli...@unm.edu
> (505) 550-9554
> ___
> 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


Re: [nox-dev] nox-destiny src/builtin/nox.cc Syntax Error

2012-02-28 Thread Murphy McCauley
Added to my queue.  Thanks.

-- Murphy

On Feb 28, 2012, at 10:28 AM, Martin Fong wrote:

> When compiling nox-destiny src/builtin/nox.cc with -O0, g++
> _correctly_ reports the syntax error
> 
>../../../src/builtin/nox.cc: In member function `void 
> vigil::nox::Handshake_fsm::handle_vendor(std::auto_ptr)':
>../../../src/builtin/nox.cc:1037: error: expected `(' before `ntohs'
>[Snip.]
> 
> (However, there is _no_ compilation error when this file is compiled
> with -O[12].)
> 
> Given that nox.cc:1037 is
> 
>switch ntohs(ofmph->type) {
> 
> (which is syntactically illegal -- the switch expression must be
> delimited by left and right parentheses), with -O[12]. there is no
> compilation error because ntohs(ofmph->type) is replaced with an
> inline expression that is enclosed by left and right parentheses --
> and this implicitly _corrects_ the syntax error(!).
> 
> Could someone please correct nox.cc in the source code
> distribution?
> 
> Thanks!
> 
> ...Martin Fong
> 
> =
> 
> diff --git a/src/builtin/nox.cc b/src/builtin/nox.cc
> index 71b2b8d..5867f31 100644
> --- a/src/builtin/nox.cc
> +++ b/src/builtin/nox.cc
> @@ -1034,7 +1034,7 @@ void Handshake_fsm::handle_vendor(std::auto_ptr 
> buf)
> }
> }
> 
> -switch ntohs(ofmph->type) {
> +switch (ntohs(ofmph->type)) {
> case OFMPT_CAPABILITY_REPLY: {
> if(state != RECV_MGMT_CAPABILITY_REPLY) {
>   lg.warn("Ignoring mgmt capability reply "
> 
> ___
> 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


Re: [nox-dev] Malformed ARP reply packet

2012-02-26 Thread Murphy McCauley
Are you sure you haven't changed the code that you originally posted?
Specifically, are you still setting the ethernet source address using:
eth.src = octstr_to_array(SOURCE_MAC_ADDR) 
?

-- Murphy

On Feb 26, 2012, at 9:23 PM, Volodymyr Bulakh wrote:

> Hi,
> 
> Thank you for the reply.  I am getting the following error message when I 
> call tostring():
> 
> 00067|pyrt|ERR:unable to invoke a Python event handler:
> Traceback (most recent call last):
>  File "./nox/lib/util.py", line 116, in f
>event.total_len, buffer_id, packet)
>  File "./nox/coreapps/tutorial/pytutorial.py", line 207, in packet_in_callback
>self.learn_and_forward(dpid, inport, packet, packet.arr, bufid)
>  File "./nox/coreapps/tutorial/pytutorial.py", line 186, in learn_and_forward
>self.send_arp_reply(dpid, packet, inport)
>  File "./nox/coreapps/tutorial/pytutorial.py", line 63, in send_arp_reply
>self.send_openflow_packet(dp, replypkt.tostring(), inport)
>  File "./nox/lib/packet/packet_base.py", line 109, in tostring
>buf = self.hdr()
>  File "./nox/lib/packet/ethernet.py", line 107, in hdr
>src = src.tostring()
> AttributeError: 'long' object has no attribute 'tostring'
> 
> The imports are below:
> 
> import socket
> from nox.lib.core import *
> import nox.lib.openflow as openflow
> from nox.lib.packet.ethernet import ethernet, __str__
> from nox.lib.packet.packet_utils import mac_to_str, mac_to_int, ip_to_str, 
> ipstr_to_int, octstr_to_array
> from nox.lib.packet.ipv4 import ipv4
> from socket import ntohs, htons
> from nox.lib.packet.arp import arp
> from nox.lib.packet.packet_base import packet_base
> 
> 
> 
> On 2/26/2012 8:19 PM, Heryandi wrote:
>> Hi,
>> 
>> Instead of this:
>> self.send_openflow_packet(dpid, eth.__str__(), inport)
>> 
>> Try this:
>> self.send_openflow_packet(dpid, eth.tostring(), inport)
> ___
> 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


Re: [nox-dev] Create new OpenFlow message

2012-02-23 Thread Murphy McCauley
What you're really talking about here is changing OpenFlow.  OpenFlow is a 
standard, meaning any changes should go through the Open Networking Foundation 
(who maintains the standard).  Any changes you make will make your program 
incompatible with other switches that implement the OpenFlow protocol.  The 
exception to this is if you add any extra functionality using OpenFlow's vendor 
extension capabilities.

Specifically, your new stats messages should probably use the Vendor Statistics 
mechanism described in the OpenFlow spec, and your new configuration should 
probably be sent using a message with an ofp_vendor_header structure.  For 
additional help on properly extending OpenFlow, you might want to ask on one of 
the OpenFlow mailing lists (like openflow-discuss).

Within NOX, your changes will start in src/lib/openflow-event.cc.  For example, 
your new configuration data will require altering handle_vendor(), and your new 
stats type will require altering handle_stats_reply(). 

Then, of course, you'll have to modify your switch to use the new messages also.

-- Murphy

On Feb 23, 2012, at 6:50 AM, Duc Thien wrote:

> Thanks for reply!
> 
> I'm trying to create 2 kind of message :
> Message send from Nox to change state of switch ( eg:change frequency). I 
> intend to add new variable to message Switch_set_config:
>  
> struct ofp_switch_config {
> struct ofp_header header;
>   uint8_t state;/*State of switch*/
> uint16_t flags;   /* OFPC_* flags. */
> uint16_t miss_send_len;   /* Max bytes of new flow that datapath
> should send to the controller. */
> };
> OFP_ASSERT(sizeof(struct ofp_switch_config) == 13);
>  
> enum ofp_switch_state {
>   STATE_OFF = 0X00; /*switch off */
>   STATE_10Mbps = 0X01;
>   STATE_100Mbps = 0X02;
>   STATE_1Gbps = 0X03;
> } 
> 2. Message carry infomation of switch to NOX (eg: traffic and power 
> consumption). I'm going to create new message using statistic message:
> struct ofp_switch_stats_request{
> uint64_t datapath_id; 
> uint64_t traffic; /* Total traffic in switch*/
> uint16_t power; /*Power consumption in switch */
> }
> OPF_ASSERT(sizeof(struct ofp_switch_stats_request) = 11);
>  
> /*Body of ofp_switch_stats_reply */
>  
> struct ofp_switch_stats_reply{
>  
> uint64_t datapath_id;
> uint8_t traffic; /*traffic in switch*/
> uint16_t power; /*power consumption in switch */
> }
>  
> OPF_ASSERT(sizeof(struct ofp_switch_stats_request) = 11);
> 
>  
> Would you help me? 
> 
> -- 
> Tô Đức Thiện
> Điện tử 5 -K53-Trường ĐHBK Hà Nội
> ĐT :01686481787
> 
> ___
> 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


Re: [nox-dev] Install NOX Destiny on Ubuntu 11.04

2012-02-22 Thread Murphy McCauley
Did you forget a -v?  That is, did you actually run "./nox_core -i ptcp: switch 
-v" or similar?

If so, then this looks good.  Are you sure it's not running fine?  It should be 
listening on port 6633.

-- Murphy

On Feb 22, 2012, at 1:51 AM, ibrahim menem wrote:

> Hi,
> 
> So I decided to upgrade to Destiny, and after warningless compilation I tried 
> to run  "./nox_core -i ptcp: switch" 
> 
> but it freezes at:
> 
> 2|nox|INFO:nox bootstrap complete
> 
> Running "dpkg --info nox-dependencies.deb" I get:
>  new debian package, version 2.0.
>  size 788 bytes: control archive= 491 bytes.
>  511 bytes, 9 lines  control
>  499 bytes, 9 lines  control~
>  Package: nox-dependencies
>  Version: 0.1
>  Architecture: all
>  Depends: doxygen, doxypy, build-essential, python-dev, autoconf, automake, 
> make, g++, libtool, python-twisted, python-dev, swig, libssl-dev, 
> libboost-dev (>= 1.34.1), libboost-test-dev, libboost-filesystem-dev
>  Suggests: git-core, libsqilte3-dev, python-simplejson
>  Maintainer: KK Yap [yap...@stanford.edu]
>  Description: This package installs the dependencies needed for NOX
>  to be built from source.  There is no actual content
>  in this package.
> 
> Any suggestion?
> 
> Thanks,
> 
> Ibrahim
> 
> ___
> 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


Re: [nox-dev] ports statistics questions

2012-02-18 Thread Murphy McCauley
Ah, I begin to see the problem here. :)

The ports that the port stats are referring to are *switch ports*.  Like the 
ethernet and wifi interfaces.  Not TCP/UDP ports.

If you want to gather statistics on TCP/UDP ports, you do that by installing 
flows that match on those TCP/UDP ports and then monitoring the flow stats.

-- Murphy

On Feb 18, 2012, at 1:53 AM, Diana Marosin wrote:

> Hello,
> 
> I use a Linksys wrt54gl, v1.1.
> 
> With Wireshark I can identify ports 46245 for ACK controller -> switch and 22 
> for the SSH PC -> switch, in nox the output is totally different.
> 
> In nox, if I use the monitoring.py I receive empty stats and ports 1 and 
> 65534, but if I use the packet_in_callback I can extract the port from the 
> packet (here the 22 for the ssh)
> 
> Maybe I misunderstood what those stats should show, but please point me in 
> the right direction.
> 
> My output is in this form :
> Aggregate stats in from datapath 58:6d:87:62:f8:b1
> {'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L}
> packet_in_callback:  58:6d:87:62:f8:b1
> ssh packet received on port 22
> Table stats in from datapath 58:6d:87:62:f8:b1
> hash2 : 0
> linear : 0
> Port stats in from datapath 58:6d:87:62:f8:b1
> 1 : 4162
> 65534 : 0
> 
> My code is bellow:
> def aggregate_timer(self, dpid):
> flow = ofp_match() 
> flow.wildcards = 0x
> self.ctxt.send_aggregate_stats_request(dpid, flow,  0xff)
> self.post_callback(MONITOR_TABLE_PERIOD, lambda : 
> self.aggregate_timer(dpid))
> 
> def table_timer(self, dpid):
> self.ctxt.send_table_stats_request(dpid)
> self.post_callback(MONITOR_TABLE_PERIOD, lambda : 
> self.table_timer(dpid))
> 
> def port_timer(self, dpid):
> self.ctxt.send_port_stats_request(dpid, OFPP_NONE)
> self.post_callback(MONITOR_PORT_PERIOD, lambda : 
> self.port_timer(dpid))
> 
> # For each new datapath that joins, create a timer loop that monitors
> # the statistics for that switch
> def datapath_join_callback(self, dpid, stats):
> print "datapath_join_callback: ", longlong_to_octstr(dpid)[6:]
> self.post_callback(MONITOR_TABLE_PERIOD, lambda : 
> self.table_timer(dpid))
> self.post_callback(MONITOR_PORT_PERIOD + 1, lambda :  
> self.port_timer(dpid))
> self.post_callback(MONITOR_AGGREGATE_PERIOD + 2, lambda :  
> self.aggregate_timer(dpid))
> 
> def aggregate_stats_in_handler(self, dpid, stats):
> print "Aggregate stats in from datapath", longlong_to_octstr(dpid)[6:]
> print '\t',stats
> 
> def table_stats_in_handler(self, dpid, tables):
> print "Table stats in from datapath", longlong_to_octstr(dpid)[6:]
> for item in tables:
> print '\t',item['name'],':',item['active_count']
> 
> def port_stats_in_handler(self, dpid, ports):
> print "Port stats in from datapath", longlong_to_octstr(dpid)[6:]
> for item in ports:
> print '\t',item['port_no'],':',item['rx_packets']
> 
> def packet_in_callback(self, dpid, inport, reason, len, bufid, packet):
> flow=extract_flow(packet)
> if flow['tp_dst'] == 22:
> print "packet_in_callback: ", longlong_to_octstr(dpid)[6:]
> print "ssh packet received on port 22"
> 
> def install(self):
> self.register_for_packet_in(self.packet_in_callback)
> self.register_for_datapath_join(lambda dpid, stats : 
> self.datapath_join_callback(dpid,stats))
> self.register_for_table_stats_in(self.table_stats_in_handler)
> self.register_for_port_stats_in(self.port_stats_in_handler)
> self.register_for_aggregate_stats_in(self.aggregate_stats_in_handler)
> 
> 
> Thank you!
> Diana
> 
> 
> On Fri, Feb 17, 2012 at 2:14 PM, Murphy McCauley  wrote:
> What type of switch are you using, and are you sure that it's reporting the 
> ports correctly?  I assume your ssh traffic should be going through multiple 
> ports...
> 
> The first thing I'd suggest is that you check the control traffic with 
> Wireshark and the OpenFlow dissector to see if what's coming across the wire 
> is consistent with what you see in NOX.
> 
> -- Murphy
> 
> On Feb 17, 2012, at 5:02 AM, Diana Marosin wrote:
> 
> > Hello,
> >
> > I am trying to retrieve the ports statistics from an openflow switch using 
> > nox. I tried to use the coreapp/ examples /monitorin

Re: [nox-dev] ports statistics questions

2012-02-17 Thread Murphy McCauley
What type of switch are you using, and are you sure that it's reporting the 
ports correctly?  I assume your ssh traffic should be going through multiple 
ports...

The first thing I'd suggest is that you check the control traffic with 
Wireshark and the OpenFlow dissector to see if what's coming across the wire is 
consistent with what you see in NOX.

-- Murphy

On Feb 17, 2012, at 5:02 AM, Diana Marosin wrote:

> Hello,
> 
> I am trying to retrieve the ports statistics from an openflow switch using 
> nox. I tried to use the coreapp/ examples /monitoring.py script, but no 
> matter what I do (for example a ssh) I retrive only ports 1 (rx_packets 
> values are always increasing) and 65534 (rx_packets = 0). If I use the 
> packet_in_callback then from the packet I can extract the port number, but 
> the parameter inport is 1 (not as I would expect).
> 
> Any idea on what is happening and why the stats don't work? 
> 
> I mention I use NOX 0.9.1-full-beta compiled with OpenFlow 0x01.
> 
> Thank you,
> Diana ___
> 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


Re: [nox-dev] I can't run nox after checking out to destiny

2012-02-16 Thread Murphy McCauley
Could you please include the text that running nox_core produces?

-- Murphy

On Feb 16, 2012, at 3:16 PM, Baraki Halefom wrote:

> 
> please help me. after checking out to destiny branch I can not even run nox 
> controller
> 
> the command  ./nox_core -i ptcp:6633 
> displays a bunch of information with a last info " Caught signal 6 " Aborted.
> 
> what am I supposed to do after checkout.
> I have done the following after checking out.
> 
> ./boot.sh
>mkdir build/
>cd build/
>../configure
>make -j 5
> thanks
> 
> -- 
> 
> 
> Baraki H. Abay
> Department of Math and Computer science
> North Carolina Central University 
> Durham, 27707 NC
> 
> ___
> 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


Re: [nox-dev] NOX requires OpenSSL

2012-02-09 Thread Murphy McCauley
Do you have the openssl-devel package installed?

-- Murphy

On Feb 9, 2012, at 1:51 AM, Prashanth Prahalad wrote:

> Hi Folks,
> 
> I'm seeing this error when running ../configure on Centos. I did see some 
> other threads with similar issues here 
> (http://noxrepo.org/pipermail/nox-dev/2011-October/008152.html). Openssl is 
> installed and available.
> 
> I'm already using destiny branch. 
> 
> Here's the ../configure output :
> 
>   checking for openssl/md5.h... no
>   configure: error: openssl/md5.h not found. NOX requires OpenSSL
> 
> Any ideas ?
> 
> Thanks !
> Prashanth
> ___
> 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


Re: [nox-dev] FW: Nox question

2012-02-04 Thread Murphy McCauley
So the parameters for the packet_in callback are: dpid, inport, reason, len, 
bufid, packet

The last one is an "ethernet" object from src/nox/lib/packet/ethernet.py.  For 
IP packets, this ethernet object will then reference an ipv4 object which then 
might reference a tcp object.  So for example, you might write something like:

def packet_in_callback (dpid, inport, reason, len, bufid, packet):
  ip = packet.find("ipv4")
  if ip is not None:
tcp = ip.find("tcp")
if tcp is not None:
  print "%s:%i -> %s:%i" % (ip.srcip, tcp.srcport, ip.dstip, tcp.dstport)

(Apologies if that doesn't just work; I didn't try it and my NOX is getting a 
little rusty.)

Hopefully that'll get you started.

-- Murphy

On Feb 4, 2012, at 6:58 AM, Gabe Bassett wrote:

>  
> Please see the question below.  If you can point me in the right direction, 
> I’d appreciate it!
>  
> Gabe
>  
> From: Gabe Bassett 
> Sent: Friday, February 03, 2012 5:55 PM
> To: 'yap...@stanford.edu'
> Subject: Nox question
>  
> Hi,
> I’m trying to learn openflow by building on the nox switch tutorial (as well 
> as learning python in the process).  Could you help me with a quick question?
>  
> What is the best way to access the Source and Destination IP addresses and 
> Ports?
>  
> Is there any way to reference it with just the information passed to the 
> register_for_packet_in() event handler that gets passed through 
> packet_in_callback to learn_and_forward?
>  
> Thanks for the help.
>  
> Gabe
> ___
> 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


Re: [nox-dev] Assertion on udp.checksum()

2012-02-01 Thread Murphy McCauley
Thanks for the reminder.  In my branch this actually works differently 
altogether and is, indeed, limited to 16 bits.  That'll get pushed into the 
release version of the destiny branch.

-- Murphy

On Feb 1, 2012, at 11:25 AM, Aaron Rosen wrote:

> Hello,
> 
> I was just merging my local changes with whats in the git and noticed
> this change never made it in.
> 
> In ipv4.py self.id = int(time.time()) but this should be self.id =
> int(time.time)) &0x  (since the field is only 2bytes)
> 
> Aaron
> 
> 
> On Mon, Aug 8, 2011 at 6:31 PM, Murphy McCauley  wrote:
>> It's the identification field of the IPv4 header.  Mostly this is used to
>> match up fragments (which should all retain the same value).  So time.time()
>> isn't really a very good value for it anyway, as it should be relatively
>> unique, but int(time.time()) is only unique for packets sent in different
>> seconds which seems like a fairly unsafe assumption.  We should probably
>> just use a counter.  Which, looking at the code... it looks like may have
>> been done in the past (ip_id field) and then changed.  It should probably be
>> changed back. :)  I think that's what I did when I fixed it before; it must
>> just have not made it out of some experimental branch.  Sorry it got you!
>> 
>> -- Murphy
>> 
>> On Aug 8, 2011, at 3:18 PM, Aaron Rosen wrote:
>> 
>> Thanks that did the trick.
>> 
>> Yea I thought this was strange too since this used to work a while ago.
>> 
>> Out of curiosity what is id in ipv4.py I see that it holds the time but why
>> is that needed?
>> 
>> Thanks again,
>> 
>> Aaron
>> 
>> On Mon, Aug 8, 2011 at 6:13 PM, Murphy McCauley  wrote:
>>> 
>>> Strange, I am positive that I have fixed this.  Maybe it just hasn't
>>> gotten pushed yet.
>>> 
>>> In ipv4.py around line 76, try something like...
>>> self.id = int(time.time()) & 0x
>>> 
>>> -- Murphy
>>> 
>>> On Aug 8, 2011, at 3:08 PM, Aaron Rosen wrote:
>>> 
>>> Thanks,
>>> 
>>> I hate to bug you again but this looks fine to me?
>>> 
>>> iplen = 39 len("hello world")(11)  + udp header(8)  + 20 (ip_header)
>>> 17 =   UDP_PROTOCOL
>>> 
>>>   bad packet [69, 0, 39, 1312840938, 0, 64, 17, 0, 167837954, 167837953]
>>> 00019|pyrt|ERR:unable to invoke a Python event handler:
>>> Traceback (most recent call last):
>>>   File "./nox/lib/util.py", line 114, in f
>>> event.total_len, buffer_id, packet)
>>>   File "./nox/coreapps/examples/sos.py", line 644, in packet_in_callback
>>> learn(dpid, inport, packet, packet.arr, bufid)
>>>   File "./nox/coreapps/examples/sos.py", line 212, in learn
>>> forward(dpid, inport, packet, packet.arr, bufid, TRUNK_PORT)
>>>   File "./nox/coreapps/examples/sos.py", line 333, in forward
>>> ret = install_agent_flows(dpid, inport, packet, buf, bufid,
>>> TRUNK_PORT);
>>>   File "./nox/coreapps/examples/sos.py", line 594, in install_agent_flows
>>> inst.send_openflow_packet(dp_near, inform_dest.tostring(),
>>> inst.Agents[dp_near]['inport'], inport)
>>>   File "./nox/lib/packet/packet_base.py", line 118, in tostring
>>> return ''.join((buf, self.next.tostring()))
>>>   File "./nox/lib/packet/packet_base.py", line 113, in tostring
>>> buf = self.hdr()
>>>   File "./nox/lib/packet/ipv4.py", line 179, in hdr
>>> self.dstip)
>>> error: 'H' format requires 0 <= number <= 65535
>>> 
>>> 
>>> On Mon, Aug 8, 2011 at 5:32 PM, Murphy McCauley  wrote:
>>>> 
>>>> I think you just have a field with a bad value.
>>>> 
>>>> Try replacing the checksum function with something like this to help you
>>>> spot it:
>>>> 
>>>> def checksum(self):
>>>>   try:
>>>> data = struct.pack('!BBHHBBHII', (self.v << 4) + self.hl, self.tos,
>>>>self.iplen, self.id,
>>>>(self.flags << 13) | self.frag, self.ttl,
>>>>self.protocol, 0, self.srcip,
>>>>self.dstip)
>>>> return checksum(data, 0)
>>>>   except:
>>>> print "bad packet",[(self.v << 4) + self.hl,
>>>>  

Re: [nox-dev] how to use own controller in custom topology

2012-01-31 Thread Murphy McCauley
This seems to be much more of a mininet question than a NOX question, and you 
should probably be asking about it somewhere else.  For example, there is a 
mininet mailing list at:
https://mailman.stanford.edu/mailman/listinfo/mininet-discuss

That said, the problem here is that the value you pass in as "controller" in 
the Mininet constructor is later used by addController() to actually construct 
the controller object.  In your case, your lambda function only takes one 
parameter -- the name.  Thus, the port parameter is meaningless.  You could fix 
up the function you pass into the Mininet constructor (to take keyword 
arguments and pass them along to the NOX constructor), but I don't think it's 
really necessary.  I think you can just do:

net = Mininet()
c1 = net.addController("c1", NOX, noxArgs="myswitch", port=6633)

noxArgs just gets spliced into the commandline for NOX.

You should be able to create multiple controllers this way, but as far as I 
know, for this to be useful, you'll also need to subclass a switch class (e.g., 
OVSKernelSwitch) or pass in a factory to the Mininet constructor which actually 
assigns different switches to different controllers.  I believe as it is, 
switches are always just given to the first controller (if anyone knows me to 
be wrong on that, I'd be interested in knowing).

As for why pinging doesn't work -- your controller is broken or you don't have 
the proper links in place.  If you start with mininet's emptynet.py example, 
switch it to use the controller-adding code given above, but specify the normal 
"pyswitch" component -- you should find that pinging works.

-- Murphy

On Jan 31, 2012, at 6:45 AM, Baraki Halefom wrote:

> Dear all,
> I have built a simple custom topology network in mininet. and want to use a 
> my own controller in the topology. as
> follows;
>   
>  net = Mininet(controller= lambda name: NOX(name ,'myswitch'))  # where 
> 'myswitch' is a learning switch component
>  
>   also to add multiple controllers to the topology I did the following 
> additions
>  
>  c1 = net.addController('c1', port = 6633)
>  c2 = net.addController('c2', port = 6634)
> 
> when I run the topology  I got the following error
> controller_new = controller(name,**kwargs)
> TypeError:() got an unexpected key word argument 'port'
> 
> in addition pinging between hosts attached to different switches is not 
> working. How can I resolve this?
> 
> Sincerely,
> 
> 
> -- 
> 
> 
> Baraki H. Abay
> Department of Math and Computer science
> North Carolina Central University 
> Durham, 27707 NC
> 
> ___
> 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


Re: [nox-dev] Receiving JSON messages

2012-01-26 Thread Murphy McCauley
Oops, that was my bad -- as I said, I had adapted that from another message.
The correct import should be:
from nox.coreapps.messenger.pyjsonmsgevent import JSONMsg_event

-- Murphy

On Jan 26, 2012, at 3:40 AM, Giorgio Mazza wrote:

> Thanks, I think I will specify a port.
> 
> Another question...
> At the moment I get an error while importing the JSON_Msg event in the 
> install() of my component.
> 
> "in install
> from nox.coreapps.messenger.pymsgevent import JSONMsg_event
> ImportError: No module named pymsgevent "
> 
> I blindly followed your instructions at first, but then I looked in my 
> messenger folder without finding where this event is defined.
> Could you please tell me where is it, so that I can insert the correct path 
> in my install function? I'm using the standard message folder.
> Thank you. 
> Regards,
> 
> Giorgio
> 
> On 25/01/2012 22:28, Murphy McCauley wrote:
>> 
>> I believe it defaults to port 2703.  You should be able to set the port 
>> number by specifying it on the commandline...
>> ./nox_core -i ptcp: jsonmessenger=tcpport=4096 your_app_here
>> 
>> It listens on all IP addresses; there is currently no way to specify just 
>> one.
>> 
>> -- Murphy
>> 
>> On Jan 25, 2012, at 1:11 PM, Giorgio Mazza wrote:
>> 
>>> A question about the socket opened when invoking jsonmessenger.
>>> What are the IP address, the tcp port and the interface that this socket 
>>> refers to? Is there any way to set them?
>>> I undersotood the mechanism, but I don't know where to send my messages 
>>> from the external application.
>>> Thank you.
>>> Regards,
>>> 
>>> Giorgio
>>> 
>>> On 24/01/2012 13:49, Murphy McCauley wrote:
>>>> 
>>>> The minimum to get up and going should be something like this:
>>>> 
>>>> 1) In your component's install function:
>>>> from nox.coreapps.messenger.pymsgevent import JSONMsg_event
>>>> JSONMsg_event.register_event_converter(self.ctxt)
>>>> self.register_handler(JSONMsg_event.static_get_name(), myHandler)
>>>> 
>>>> 2) Implement a handler:
>>>> def myHandler (e):
>>>>   import json
>>>>   print json.loads(e.jsonstring)
>>>>   e.reply(json.dumps({"msg":"Hello world"}))
>>>> 
>>>> 3) Include jsonmessenger on the commandline or as a dependency
>>>> 
>>>> 
>>>> That may not be exactly correct -- it's adapted from a quick writeup I did 
>>>> in December about using the new Python support for the "regular" messenger 
>>>> (as opposed to the JSON messenger), which has not yet been pushed to the 
>>>> repository.  For reference, that post was:
>>>> http://noxrepo.org/pipermail/nox-dev/2011-December/008382.html
>>>> 
>>>> (If using the new version of messenger that I linked to in that post, you 
>>>> remove the register_event_converter() call from step 1 and include 
>>>> pyjsonmessenger instead of jsonmessenger in step 3.)
>>>> 
>>>> Invoking the jsonmessenger component (on the commandline or by including 
>>>> it as a dependency in your app's meta.json) will create the server socket 
>>>> for you.
>>>> 
>>>> You absolutely do not have to use the messenger.py class.  I'm removing it 
>>>> from that directory, because all it ever does is confuse people -- it 
>>>> really doesn't belong there.  messenger.py is a library for writing JSON 
>>>> messenger *clients* (external programs) in Python.  That may be useful to 
>>>> you, but you don't need it for the NOX side of things.
>>>> 
>>>> Hope that helps.
>>>> 
>>>> -- Murphy
>>>> 
>>>> On Jan 24, 2012, at 4:12 AM, Giorgio Mazza wrote:
>>>> 
>>>>> Thank you.
>>>>> I try to sum up the operations I need to perform, to see if I understood 
>>>>> correctly.
>>>>> Basically in my external application I have to set up a socket that sends 
>>>>> json messages and this would be quite simple.
>>>>> In my nox component, instead, I have to import the "JSONMsg_event" and, 
>>>>> within the "install()" instruction, to handle it with my specific method, 
>>>>> that, in my case, would only save these json messages into a dictionary, 
>>>>> for using them later, ac

Re: [nox-dev] Receiving JSON messages

2012-01-25 Thread Murphy McCauley
I believe it defaults to port 2703.  You should be able to set the port number 
by specifying it on the commandline...
./nox_core -i ptcp: jsonmessenger=tcpport=4096 your_app_here

It listens on all IP addresses; there is currently no way to specify just one.

-- Murphy

On Jan 25, 2012, at 1:11 PM, Giorgio Mazza wrote:

> A question about the socket opened when invoking jsonmessenger.
> What are the IP address, the tcp port and the interface that this socket 
> refers to? Is there any way to set them?
> I undersotood the mechanism, but I don't know where to send my messages from 
> the external application.
> Thank you.
> Regards,
> 
> Giorgio
> 
> On 24/01/2012 13:49, Murphy McCauley wrote:
>> 
>> The minimum to get up and going should be something like this:
>> 
>> 1) In your component's install function:
>> from nox.coreapps.messenger.pymsgevent import JSONMsg_event
>> JSONMsg_event.register_event_converter(self.ctxt)
>> self.register_handler(JSONMsg_event.static_get_name(), myHandler)
>> 
>> 2) Implement a handler:
>> def myHandler (e):
>>   import json
>>   print json.loads(e.jsonstring)
>>   e.reply(json.dumps({"msg":"Hello world"}))
>> 
>> 3) Include jsonmessenger on the commandline or as a dependency
>> 
>> 
>> That may not be exactly correct -- it's adapted from a quick writeup I did 
>> in December about using the new Python support for the "regular" messenger 
>> (as opposed to the JSON messenger), which has not yet been pushed to the 
>> repository.  For reference, that post was:
>> http://noxrepo.org/pipermail/nox-dev/2011-December/008382.html
>> 
>> (If using the new version of messenger that I linked to in that post, you 
>> remove the register_event_converter() call from step 1 and include 
>> pyjsonmessenger instead of jsonmessenger in step 3.)
>> 
>> Invoking the jsonmessenger component (on the commandline or by including it 
>> as a dependency in your app's meta.json) will create the server socket for 
>> you.
>> 
>> You absolutely do not have to use the messenger.py class.  I'm removing it 
>> from that directory, because all it ever does is confuse people -- it really 
>> doesn't belong there.  messenger.py is a library for writing JSON messenger 
>> *clients* (external programs) in Python.  That may be useful to you, but you 
>> don't need it for the NOX side of things.
>> 
>> Hope that helps.
>> 
>> -- Murphy
>> 
>> On Jan 24, 2012, at 4:12 AM, Giorgio Mazza wrote:
>> 
>>> Thank you.
>>> I try to sum up the operations I need to perform, to see if I understood 
>>> correctly.
>>> Basically in my external application I have to set up a socket that sends 
>>> json messages and this would be quite simple.
>>> In my nox component, instead, I have to import the "JSONMsg_event" and, 
>>> within the "install()" instruction, to handle it with my specific method, 
>>> that, in my case, would only save these json messages into a dictionary, 
>>> for using them later, according to some conditions.
>>> Is that correct?
>>> 
>>> A couple of things that I didn't understand:
>>> - I assume I also have to set up a server socket in my nox component, in 
>>> order to receive json messages and handle  JSONMsg_events. So, I think this 
>>> socket has to be already up and running when I handle the event. So, when 
>>> do I have to create it and how? Do I have to use messenger.py channel class?
>>> - Second question, probably related to the first. I think to be pretty 
>>> confused about jsonmessenger: what are the jsonmessenger files I could look 
>>> into in order to understand fields and methods that I would need to use? 
>>> Are the jsonmessenger.cc and jsonmessenger.hh in 
>>> nox/src/nox/coreapps/messenger? And, if it is the case, how can I integrate 
>>> them into a python component?
>>> 
>>> Thanks again,
>>> 
>>> Giorgio
>>> 
>>> On 24/01/2012 12:28, Kyriakos Zarifis wrote:
>>>> 
>>>> Hi Giorgio,
>>>> 
>>>> yes, I think using jsonmessenger would be the best approach for this.
>>>> 
>>>> you need to implement a send/receive interface on the external application 
>>>> and in your nox component. For the external application, it's pretty 
>>>> straightforward - Connect to the jsonmessenger socket and send json 
>>>> strings. In your nox application you need to registe

Re: [nox-dev] Receiving JSON messages

2012-01-24 Thread Murphy McCauley
The minimum to get up and going should be something like this:

1) In your component's install function:
from nox.coreapps.messenger.pymsgevent import JSONMsg_event
JSONMsg_event.register_event_converter(self.ctxt)
self.register_handler(JSONMsg_event.static_get_name(), myHandler)

2) Implement a handler:
def myHandler (e):
  import json
  print json.loads(e.jsonstring)
  e.reply(json.dumps({"msg":"Hello world"}))

3) Include jsonmessenger on the commandline or as a dependency


That may not be exactly correct -- it's adapted from a quick writeup I did in 
December about using the new Python support for the "regular" messenger (as 
opposed to the JSON messenger), which has not yet been pushed to the 
repository.  For reference, that post was:
http://noxrepo.org/pipermail/nox-dev/2011-December/008382.html

(If using the new version of messenger that I linked to in that post, you 
remove the register_event_converter() call from step 1 and include 
pyjsonmessenger instead of jsonmessenger in step 3.)

Invoking the jsonmessenger component (on the commandline or by including it as 
a dependency in your app's meta.json) will create the server socket for you.

You absolutely do not have to use the messenger.py class.  I'm removing it from 
that directory, because all it ever does is confuse people -- it really doesn't 
belong there.  messenger.py is a library for writing JSON messenger *clients* 
(external programs) in Python.  That may be useful to you, but you don't need 
it for the NOX side of things.

Hope that helps.

-- Murphy

On Jan 24, 2012, at 4:12 AM, Giorgio Mazza wrote:

> Thank you.
> I try to sum up the operations I need to perform, to see if I understood 
> correctly.
> Basically in my external application I have to set up a socket that sends 
> json messages and this would be quite simple.
> In my nox component, instead, I have to import the "JSONMsg_event" and, 
> within the "install()" instruction, to handle it with my specific method, 
> that, in my case, would only save these json messages into a dictionary, for 
> using them later, according to some conditions.
> Is that correct?
> 
> A couple of things that I didn't understand:
> - I assume I also have to set up a server socket in my nox component, in 
> order to receive json messages and handle  JSONMsg_events. So, I think this 
> socket has to be already up and running when I handle the event. So, when do 
> I have to create it and how? Do I have to use messenger.py channel class?
> - Second question, probably related to the first. I think to be pretty 
> confused about jsonmessenger: what are the jsonmessenger files I could look 
> into in order to understand fields and methods that I would need to use? Are 
> the jsonmessenger.cc and jsonmessenger.hh in nox/src/nox/coreapps/messenger? 
> And, if it is the case, how can I integrate them into a python component?
> 
> Thanks again,
> 
> Giorgio
> 
> On 24/01/2012 12:28, Kyriakos Zarifis wrote:
>> 
>> Hi Giorgio,
>> 
>> yes, I think using jsonmessenger would be the best approach for this.
>> 
>> you need to implement a send/receive interface on the external application 
>> and in your nox component. For the external application, it's pretty 
>> straightforward - Connect to the jsonmessenger socket and send json strings. 
>> In your nox application you need to register for JSON messages, and handle 
>> them appropriately. 
>> 
>> The wiki explains the communication in a few steps (specifically for the 
>> GUI<->NOX, but it will be similar and simpler for any external app) here:
>> 
>> If you want to see a full example, the GUI and the monitoring component in 
>> destiny could be a place to look. I'm afraid it's much more complex than 
>> what you need, but the bits you need are in there if you dig in the code a 
>> bit.
>> 
>> 
>> On Tue, Jan 24, 2012 at 2:16 AM, Giorgio Mazza  
>> wrote:
>> Hi all!
>> I have written a simple component in python that works fine.
>> Now I would to improve it, making it to install flow entries depending on 
>> parameters received from an external application.
>> In particular I want to pass those parameters via json messages to my 
>> component, which, in my thougths, has to open a "permanent" socket listening 
>> for them, save those parameters in a dictionary and, as a consequence, 
>> decide the desired switch behaviour (whether install or not a flow entry for 
>> the received parameters).
>> In previous threads I found that I have to use jsonmessenger (even in 
>> python?) or to have a look to discovery.py, but I am not sure to have 
>> understood what I have to do and where in order to realize such a behaviour.
>> Could anyone, please, help me?
>> Thank you in advance,
>> 
>> Giorgio Mazza
>> ___
>> 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/mai

Re: [nox-dev] ERR:application 'pyswitch' descritpion not found

2012-01-21 Thread Murphy McCauley
I imagine this means you're not running destiny, which you may want to consider 
unless you have a specific reason to use the zaku branch.

This almost certainly means that Python is disabled in your build.  The most 
common reasons for this are that you didn't have Twisted or SWIG installed.  
Please try installing all the packages that the wiki recommends and rebuilding 
starting with configure.  If that doesn't work, examine the output of configure 
or its log to see why Python is being disabled.

Hope that helps.

-- Murphy

On Jan 20, 2012, at 10:44 AM, Francesco Pocci wrote:

> Hi,
> i've tried to run this command
> #./nox_core -v -i ptcp:6633 pyswitch
> and i have this error
> #5|nox|ERR:Application 'pyswitch' descritpion not found.
> 
> the installation is successful whitout any error.
> If i run this command
> #./nox_core -v -i ptcp:6633
> the controller starts fine, listening on the right port, but
> practically does nothing, only creates secure channel and does
> echo/reply messages with openflow switch.
> It's seems like if all the python applications don't work (router, switch, 
> ecc).
> Each command ends with giving the same error.
> 
> what can i do?
> Regards,
> F.P.
> ___
> 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


Re: [nox-dev] Error while running nox_core

2012-01-21 Thread Murphy McCauley
That fix is actually buggy. :)  A better one is in the destiny branch, which is 
very, very close to being the stable branch.

-- Murphy


On Jan 21, 2012, at 11:44 AM, Maciej Gałkiewicz wrote:

> Have anyone implemented a fix for 
> http://noxrepo.org/pipermail/nox-dev/2010-November/006685.html? I am still 
> experiencing the issue. Murphy's fix works fine for me but I would like to 
> have it fixed in stable branch.
> 
> Murphy fix:
> "I think the fix is to change line 133 in pyoxidereactor.py to:
> signal.signal(signal.SIGCHLD, lambda : self.callLater(0, reapAllProcesses))"
> 
> regards
> M. Galkiewicz
> ___
> 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


Re: [nox-dev] nox api development

2012-01-18 Thread Murphy McCauley
So my first thought is to wonder what happens if you try with wildcards = 
0x...

-- Murphy

On Jan 18, 2012, at 11:19 PM, edward wilson wrote:

> hi,
> Currently im using NOX 0.9.0(zaku)~full~beta (nox_core), compiled Jan  3 2012 
> 15:21:13
> Compiled with OpenFlow 0x01 
> 
> Now i have developed this api for getting aggregrate table stats 
> 1. def aggregate_timer(self, dp):
> flow = ofp_match()
> flow.dl_type=ethernet.ethernet.IP_TYPE
> flow.nw_proto=ipv4.ipv4.ICMP_PROTOCOL
> self.ctxt.send_aggregate_stats_request(dp, flow, 0xff)
> self.post_callback(MONITOR_TABLE_PERIOD, lambda : 
> self.aggregate_timer(dp))
> 
> Now when i connect nox controller to switch and display the aggregrate 
> statistics i get 
> Aggregate stats in from datapath 2c:27:d7:1d:08:7d
> packet_count-- 0 
> flow_count-- 0 
> byte_count-- 0
> however i have a rule with nw_proto=icmp and dl_type=ip, and packets do match 
> this rule but still statistics are displayed as zero.
> 
> 
> 2. Even if i use following definition 
> def aggregate_timer(self, dp):
> flow = ofp_match()
> flow.wildcards=0x
> self.ctxt.send_aggregate_stats_request(dp, flow, 0xff)
> self.post_callback(MONITOR_TABLE_PERIOD, lambda : 
> self.aggregate_timer(dp)
> now in this case statistics should be displayed for all rules but again the 
> aggregrate statistics displayed are zero.
> Aggregate stats in from datapath 2c:27:d7:1d:08:7d
> packet_count-- 0 
> flow_count-- 0 
> byte_count-- 0
> 
> Please let me know if am missing something.
> 
> regards
> 
> ___
> 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


Re: [nox-dev] Python API buffer_id None problems

2012-01-17 Thread Murphy McCauley
You're right about the documentation and the implementation being mismatched.  
The implementation is correct, the documentation is outdated.

The error you see when you pass None as the buffer ID is almost certainly in 
your code and not in NOX.  The error message is not that clear, but it's 
telling you that the "packet" argument must be a str, and you are passing an 
ethernet object from the packet library.  You need to either convert this to a 
string (packet.tostring()), or try to use the original buffer (packet.arr or 
packet.arr.tostring(); I can't remember).

Hope that helps.

-- Murphy

On Jan 17, 2012, at 5:31 AM, Peter Peresini wrote:

> I can reproduce it with following simple command, packet is the packet 
> received in packet_in_callback, actions is a combination of setting ToS and 
> forwarding to a single port.
> 
> self.send_openflow(datapath_id, None, packet, actions, inport=inport)
> 
> Kind regards
>   Peter
> 
> 
> On Tue, Jan 17, 2012 at 11:42 AM, Murphy McCauley  wrote:
> Can you please show us the code you are using to call send_openflow()?
> 
> -- Murphy
> 
> On Jan 17, 2012, at 1:40 AM, Peter Peresini wrote:
> 
>> Hi developers.
>>  It seems that there is an inconsistency in python API (destiny branch) for 
>> using buffer_id. Namely, "send_openflow" documentation states that buffer_id 
>> -1 should be used to indicate no buffer but in the fact it tests for None.
>> But apart from that, if you supply None to this function the call will fail 
>> with the following error:
>> 
>>  (openflow typemap) py argument to Buffer must be of type str, instead 
>> received
>> 
>> 
>> as far as I can tell, the problem occurs inside the call
>>self.ctxt.send_openflow_packet_acts(dp_id, packet, oactions, 
>> inport)
>> in the send_openflow_packet() function.
>> 
>> Any idea what might be the problem? I can debug it even more if you tell me 
>> where to find the implementation of context.
>> 
>> Kind regards
>>   Peter Peresini
>> 
>> ___
>> 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


Re: [nox-dev] Python API buffer_id None problems

2012-01-17 Thread Murphy McCauley
Can you please show us the code you are using to call send_openflow()?

-- Murphy

On Jan 17, 2012, at 1:40 AM, Peter Peresini wrote:

> Hi developers.
>  It seems that there is an inconsistency in python API (destiny branch) for 
> using buffer_id. Namely, "send_openflow" documentation states that buffer_id 
> -1 should be used to indicate no buffer but in the fact it tests for None.
> But apart from that, if you supply None to this function the call will fail 
> with the following error:
> 
>  (openflow typemap) py argument to Buffer must be of type str, instead 
> received
> 
> 
> as far as I can tell, the problem occurs inside the call
>self.ctxt.send_openflow_packet_acts(dp_id, packet, oactions, 
> inport)
> in the send_openflow_packet() function.
> 
> Any idea what might be the problem? I can debug it even more if you tell me 
> where to find the implementation of context.
> 
> Kind regards
>   Peter Peresini
> 
> ___
> 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


Re: [nox-dev] attribute '_handleSigchld'

2012-01-16 Thread Murphy McCauley
I believe you can safely just remove the offending line from pyoxidereactor 
(the signal.signal(signal.SIGCHLD, self._handleSigchld) one).  If not, the 
current version of pyoxidereactor (from the destiny branch) should fix this in 
a way which doesn't require you to modify your system's Twisted installation.

-- Murphy

On Jan 16, 2012, at 1:38 PM, Nikhil Handigol wrote:

> Hi Vjeko,
> 
> I'm facing a similar issue. I recently upgraded twisted to 11.0 and found 
> that an older (customized) version of nox crashes with the same error. Can 
> you tell me to which class in 
> '/usr/lib/python2.6/dist-packages/twisted/internet/base.py' should I add the 
> _handleSigchld function?
> 
> Thanks,
> -- Nikhil
> 
> 
> On Fri, Aug 6, 2010 at 1:58 PM, Vjekoslav Brajkovic 
>  wrote:
> Hi Tim!
> 
> You are correct.  After adding the following function definition to
> '/usr/lib/python2.6/dist-packages/twisted/internet/base.py', the
> problem seems to be gone.
> 
> 
>def _handleSigchld(self, signum, frame, 
> _threadSupport=platform.supportsThreads()):
>from twisted.internet.process import reapAllProcesses
>if _threadSupport:
>self.callFromThread(reapAllProcesses)
>else:
>self.callLater(0, reapAllProcesses)
> 
> 
> Thanks a bunch!
> Vjeko
> 
> 
> On Fri, Aug 06, 2010 at 04:30:28PM -0400, tim.upthegr...@gatech.edu wrote:
> > Hi Vjekoslav,
> >
> > I had this issue before after doing a fresh install on a Debian sid machine 
> > using the openflow-1.0 branch.
> >
> > What I found is, the function _handleSigchld has been moved-around/removed 
> > from more recent versions of TwistedPython.  The fix I found was to go grab 
> > Twisted 8.0 and install it.  I haven't tested the controller in a 
> > production setup yet, but the source compiles and I can run a simple switch 
> > without getting any error messages.
> >
> > Give that a shot and see if it works.
> >
> > Best of luck,
> >
> > Tim Upthegrove
> > Georgia Institute of Technology
> > College of Computing
> > (406)-437-1493
> >
> > - "Vjekoslav Brajkovic"  wrote:
> >
> > > Hello.
> > >
> > > After I upgraded my system, I've been having trouble starting NOX.
> > > This is the error message:
> > >
> > > 
> > > 2|nox|ERR:Cannot change the state of 'python' to INSTALLED:
> > > 'python' ran into an error:
> > > Unable to construct a Python component:
> > > Traceback (most recent call last):
> > >   File "./nox/coreapps/pyrt/pyoxidereactor.py", line 364, in
> > > instance
> > > return pyoxidereactor(ctxt)
> > >   File "./nox/coreapps/pyrt/pyoxidereactor.py", line 133, in
> > > __init__
> > > signal.signal(signal.SIGCHLD, self._handleSigchld)
> > > AttributeError: 'pyoxidereactor' object has no attribute
> > > '_handleSigchld'
> > > 
> > >
> > > Any clues to why this might be happening?
> > >
> > > Thanks!
> > > Vjeko
> > >
> > > ___
> > > 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
> 
> ___
> 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


Re: [nox-dev] questions regarding OFPAT_STRIP_VLAN

2012-01-16 Thread Murphy McCauley
Do you mean support creating flows using the OFPAT_STRIP_VLAN, 
OFPAT_SET_NW_SRC, OFPAT_SET_NW_DST, and OFPAT_SET_NW_TOS action types?  If so, 
all of these should be available if you are using the destiny branch.

-- Murphy

On Jan 16, 2012, at 8:15 AM, Alexander Cheskis wrote:

> Dear All,
> 
> We're working on test suite, which should implement all OF 1.0 features.
> 
> If somebody add OFPAT_STRIP_VLAN, modify IP and TOS fileds to nox sources?
> 
> Thanks
> Alexander
> ___
> 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


Re: [nox-dev] NOX for 64 bit

2012-01-16 Thread Murphy McCauley
Probably no major problems, but there might be minor ones.  I honestly don't 
remember; I have not run zaku in quite some time.

Unless you're already running it, there are only a few good reasons to run zaku 
now.

-- Murphy

On Jan 16, 2012, at 1:01 AM, Sheili Mittal wrote:

> Thanks Murphy
> Please confirm for NOX 0.9 zaku as well?
>  
> Regards,
> Sheili
>  
> From: Murphy McCauley [mailto:jam...@nau.edu] 
> Sent: 16 January 2012 14:29
> To: Sheili Mittal
> Cc: nox-dev@noxrepo.org
> Subject: Re: [nox-dev] NOX for 64 bit
>  
> destiny is routinely run on both 32 and 64 bit systems.
>  
> -- Murphy
>  
> On Jan 16, 2012, at 12:52 AM, Sheili Mittal wrote:
> 
> 
> Hi,
>  
> Can you please confirm are the branch available on git (0.9 zaku) and destiny 
>  supported for 64 bit machine also?
> Are the version we downloading from git is for 32bit and 64 bit both?
>  
> Thanks & Regards,
> Sheili Mittal
>  
> DISCLAIMER: 
> ---
>  
> The contents of this e-mail and any attachment(s) are confidential and
> intended 
> for the named recipient(s) only.  
> It shall not attach any liability on the originator or NECHCL or its 
> affiliates. Any views or opinions presented in  
> this email are solely those of the author and may not necessarily reflect the 
> opinions of NECHCL or its affiliates.  
> Any form of reproduction, dissemination, copying, disclosure, modification, 
> distribution and / or publication of  
> this message without the prior written consent of the author of this e-mail 
> is 
> strictly prohibited. If you have  
> received this email in error please delete it and notify the sender 
> immediately. . 
> ---
> ___
> nox-dev mailing list
> nox-dev@noxrepo.org
> http://noxrepo.org/mailman/listinfo/nox-dev
>  
> DISCLAIMER: 
> ---
>  
> The contents of this e-mail and any attachment(s) are confidential and
> intended 
> for the named recipient(s) only.  
> It shall not attach any liability on the originator or NECHCL or its 
> affiliates. Any views or opinions presented in  
> this email are solely those of the author and may not necessarily reflect the 
> opinions of NECHCL or its affiliates.  
> Any form of reproduction, dissemination, copying, disclosure, modification, 
> distribution and / or publication of  
> this message without the prior written consent of the author of this e-mail 
> is 
> strictly prohibited. If you have  
> received this email in error please delete it and notify the sender 
> immediately. . 
> ---

___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] NOX for 64 bit

2012-01-16 Thread Murphy McCauley
destiny is routinely run on both 32 and 64 bit systems.

-- Murphy

On Jan 16, 2012, at 12:52 AM, Sheili Mittal wrote:

> Hi,
>  
> Can you please confirm are the branch available on git (0.9 zaku) and destiny 
>  supported for 64 bit machine also?
> Are the version we downloading from git is for 32bit and 64 bit both?
>  
> Thanks & Regards,
> Sheili Mittal
>  
> DISCLAIMER: 
> ---
>  
> The contents of this e-mail and any attachment(s) are confidential and
> intended 
> for the named recipient(s) only.  
> It shall not attach any liability on the originator or NECHCL or its 
> affiliates. Any views or opinions presented in  
> this email are solely those of the author and may not necessarily reflect the 
> opinions of NECHCL or its affiliates.  
> Any form of reproduction, dissemination, copying, disclosure, modification, 
> distribution and / or publication of  
> this message without the prior written consent of the author of this e-mail 
> is 
> strictly prohibited. If you have  
> received this email in error please delete it and notify the sender 
> immediately. . 
> ---
> ___
> 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


Re: [nox-dev] need support for these features in NOX

2012-01-16 Thread Murphy McCauley
The enqueue action is supported in destiny.

Flow stats are possible (there has been some recent discussion about it on the 
list, I believe).

I'm not sure what you mean by queue statistics.

Matches support wildcards to the extent offered by OpenFlow 1.0.

I'm actually not sure about fragments.  If I recall correctly, this is more a 
function of the switch rather than the controller.

I'm not sure what you mean by supporting those errors.  The controller receives 
error the messages, so... yes?

You also haven't mentioned whether you're interested in the Python or the C++ 
API, and support differs somewhat across languages.

-- Murphy

On Jan 15, 2012, at 7:55 PM, Sheili Mittal wrote:

> Hi Murphy,
>  
> Thanks for this quick response, I needed that data urgently.
> Can you please confirm are the below mentioned features supported in destiny 
> branch?
>  
> I saw destiny branch is unstable on NOX site so I used 0.9 zaku.
>  
> Thanks & Regards,
> Sheili Mittal
>  
> From: Murphy McCauley [mailto:jam...@nau.edu] 
> Sent: 16 January 2012 09:22
> To: Sheili Mittal
> Cc: nox-dev@noxrepo.org
> Subject: Re: [nox-dev] need support for these features in NOX
>  
> The most recent branch is destiny.
>  
> -- Murphy
>  
> On Jan 15, 2012, at 7:49 PM, Sheili Mittal wrote:
> 
> 
> Hi,
>  
> I am using NOX 0.9 zaku, following is not supporting in this, Can anyone 
> please confirm in which branch of NOX all the following supported:-
>  
> 1)  Action Enqueue
> 2)  Flow statistics
> 3)  Queue statistics
> 4)  Wilcard ( ANY and other wildcard of openflow 1.0)
> 5)  L3 matching on IP fragment
> 6)  Error message –
> OFPET_FLOW_MOD_FAILED
> OFPET_PORT_MOD_FAILED
> OFPET_QUEUE_OP_FAILED
>  
> Regards,
> Sheili
>  
>  
> DISCLAIMER: 
> ---
>  
> The contents of this e-mail and any attachment(s) are confidential and
> intended 
> for the named recipient(s) only.  
> It shall not attach any liability on the originator or NECHCL or its 
> affiliates. Any views or opinions presented in  
> this email are solely those of the author and may not necessarily reflect the 
> opinions of NECHCL or its affiliates.  
> Any form of reproduction, dissemination, copying, disclosure, modification, 
> distribution and / or publication of  
> this message without the prior written consent of the author of this e-mail 
> is 
> strictly prohibited. If you have  
> received this email in error please delete it and notify the sender 
> immediately. . 
> ---
> ___
> nox-dev mailing list
> nox-dev@noxrepo.org
> http://noxrepo.org/mailman/listinfo/nox-dev
>  
> DISCLAIMER: 
> ---
>  
> The contents of this e-mail and any attachment(s) are confidential and
> intended 
> for the named recipient(s) only.  
> It shall not attach any liability on the originator or NECHCL or its 
> affiliates. Any views or opinions presented in  
> this email are solely those of the author and may not necessarily reflect the 
> opinions of NECHCL or its affiliates.  
> Any form of reproduction, dissemination, copying, disclosure, modification, 
> distribution and / or publication of  
> this message without the prior written consent of the author of this e-mail 
> is 
> strictly prohibited. If you have  
> received this email in error please delete it and notify the sender 
> immediately. . 
> ---

___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] need support for these features in NOX

2012-01-15 Thread Murphy McCauley
The most recent branch is destiny.

-- Murphy

On Jan 15, 2012, at 7:49 PM, Sheili Mittal wrote:

> Hi,
>  
> I am using NOX 0.9 zaku, following is not supporting in this, Can anyone 
> please confirm in which branch of NOX all the following supported:-
>  
> 1)  Action Enqueue
> 2)  Flow statistics
> 3)  Queue statistics
> 4)  Wilcard ( ANY and other wildcard of openflow 1.0)
> 5)  L3 matching on IP fragment
> 6)  Error message –
> OFPET_FLOW_MOD_FAILED
> OFPET_PORT_MOD_FAILED
> OFPET_QUEUE_OP_FAILED
>  
> Regards,
> Sheili
>  
>  
> DISCLAIMER: 
> ---
>  
> The contents of this e-mail and any attachment(s) are confidential and
> intended 
> for the named recipient(s) only.  
> It shall not attach any liability on the originator or NECHCL or its 
> affiliates. Any views or opinions presented in  
> this email are solely those of the author and may not necessarily reflect the 
> opinions of NECHCL or its affiliates.  
> Any form of reproduction, dissemination, copying, disclosure, modification, 
> distribution and / or publication of  
> this message without the prior written consent of the author of this e-mail 
> is 
> strictly prohibited. If you have  
> received this email in error please delete it and notify the sender 
> immediately. . 
> ---
> ___
> 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


Re: [nox-dev] Error while installing NOX on Fedora release 14

2012-01-15 Thread Murphy McCauley
First, can you please switch to the destiny branch (git checkout -b destiny 
origin/destiny) and try again?  If that doesn't work, can you please post your 
config.log and the full output of configure?

-- Murphy

On Jan 14, 2012, at 5:23 PM, Dushyant Arora wrote:

> Hello Murphy, John,
> 
> I tried both the solutions and I still get the same error when I run 
> configure. I tried running:
> ../configure --with-boost-filesystem=boost_filesystem 
> --with-boost-unit-test-framework=mt LDFLAGS='-L/usr/include/openssl -lssl 
> -lcrypto' 
> but it doesn't help.
> I have installed all the packages that you mentioned in your mails. I already 
> had boost-devel and boost-system. What should I do now?
> 
> Thanks,
> 
> Dushyant
> 
> 
> 
> - Original Message -
> From: "John Meylor" 
> To: "Dushyant Arora" 
> Cc: nox-dev@noxrepo.org, "Murphy McCauley" 
> Sent: Saturday, January 14, 2012 11:34:59 AM
> Subject: Re: [nox-dev] Error while installing NOX on Fedora release 14
> 
> On RHEL6/RHEL5, we use the following; Fedora 14 should be similar.
> 
> sudo yum install gcc-c++ boost-devel openssl-devel automake autoconf swig git 
> libtool libtool-dev python-devel python-twisted python-simplejson
> 
> git clone git://noxrepo.org/nox
> 
> ./boot.sh
> 
> mkdir build
> 
> cd build
> 
> ../configure --with-boost-filesystem=boost_filesystem 
> --with-boost-unit-test-framework=mt LDFLAGS='-L/usr/include/openssl -lssl 
> -lcrypto'
> 
> make
> 
> cd src
> 
> make check
> 
> --John
> 
> On Jan 14, 2012, at 4:19 AM, Murphy McCauley wrote:
> 
>> I'm not a Fedora user, but try installing boost-system and boost-devel.
>> 
>> -- Murphy
>> 
>> On Jan 14, 2012, at 1:11 AM, Dushyant Arora wrote:
>> 
>>> Hello,
>>> 
>>> I am trying to install NOX by following the instructions on NOX Wiki. I get 
>>> an error while running ~/nox/configure
>>> 
>>> checking for boostlib >= 1.34.1... yes
>>> checking whether the Boost::System library is available... yes
>>> configure: error: Could not find a version of the library!
>>> 
>>> Is there some dependency that I might be missing?
>>> 
>>> Thanks,
>>> 
>>> Dushyant
>>> ___
>>> 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


Re: [nox-dev] Recieved LLDP packet from unconnected switch

2012-01-14 Thread Murphy McCauley
I'd suggest that you don't skip to zaku but skip to destiny instead.

If you still have this problem in destiny, can you please tell us about your 
setup?  Like switch types (ProCurve?), whether you are using FlowVisor, etc.?

-- Murphy

On Jan 14, 2012, at 7:31 AM, Theophlius Benson wrote:

> I'm making the switch from NOX 0.8.0~full~beta (nox_core) to NOX 
> 0.9.0(zaku)~full~beta
> 
> I go zaku from git and have made no modifications.  I'm testing out the 
> routing module and noticed that the discovery module is print out some weird 
> errors and it is unable to discover any links .  Note, when I do switch to 
> the old version .. these links are discovered and routing module works 
> appropriately.  The errors are below. Did the format of the dpid change 
> between versions?  In the past version the switches had this DPID 
> 002347cc4400  but now they have 06d6002347cc4400
> 
> 00623|openflow-event|DBG:received packet-in event from 06d6002347cc4400 
> (len:128)
> 00624|discovery|DBG:Recieved LLDP packet from unconnected switch
> 00625|openflow-event|DBG:received packet-in event from 06d6002347cc4400 
> (len:34)
> 00626|discovery|DBG:Recieved LLDP packet from unconnected switch
> 00627|openflow-event|DBG:received packet-in event from 06d6002347cc4400 
> (len:34)
> 00628|discovery|DBG:Recieved LLDP packet from unconnected switch
> 
> 
> 
> 
> 
> ___
> 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


Re: [nox-dev] Error while installing NOX on Fedora release 14

2012-01-14 Thread Murphy McCauley
I'm not a Fedora user, but try installing boost-system and boost-devel.

-- Murphy

On Jan 14, 2012, at 1:11 AM, Dushyant Arora wrote:

> Hello,
> 
> I am trying to install NOX by following the instructions on NOX Wiki. I get 
> an error while running ~/nox/configure
> 
> checking for boostlib >= 1.34.1... yes
> checking whether the Boost::System library is available... yes
> configure: error: Could not find a version of the library!
> 
> Is there some dependency that I might be missing?
> 
> Thanks,
> 
> Dushyant
> ___
> 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


Re: [nox-dev] help need

2012-01-13 Thread Murphy McCauley
You also need to rerun configure in your build directory.

You might also consider using src/scripts/nox-new-py-app.py to simplify the 
whole process for yourself.

Hope that helps!

-- Murphy

On Jan 13, 2012, at 2:04 PM, Baraki Halefom wrote:

> Hi dear nox developers,
> 
> I am new to NOX development. I am trying to create my own component under a 
> new directory.
> for testing purpose I did the following things (in the virtual machine):
> 
>  1. made directory under the coreapps directory
>  2. I copy the files in the examples directory and renamed the pyswitch.py 
> file to myswitch.py 
>  3. also made all possible changes in the Makefile.ac, meta.json files
>  4. now i want to run the new component in the command line as: ./nox_core -v 
> pctp:2525 myswitch
> 
> it gave me the following error after displaying some verbose descriptions:
>   00042|nox|ERR: Application "myswitch" description not found
> 
> 1. is it possible to create a new directory and create new component under it?
> 2. if possible  how can I compile the component in the new directory? i did 
> ./boot.sh
> 3. what else did I forget?
> 
> what other things did I forget?
> 
> I appreciate your cooperation in advance.
> 
> 
> -- 
> 
> 
> Baraki H. Abay
> Department of Math and Computer science
> North Carolina Central University 
> Durham, 27707 NC
> 
> ___
> 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


Re: [nox-dev] error with try to ./configure

2012-01-12 Thread Murphy McCauley
I was responding earlier from my phone, so I didn't look at this as closely as 
I might have.  Sorry.  However, my initial suggestion -- to use the destiny 
branch -- still stands.  "git checkout destiny" (if you're using a recent 
version of git).

But this really looks like you just don't have the SSL development stuff 
installed.  I think the package is probably openssl-devel.  Do you have that 
installed, or just the plain openssl package?

-- Murphy

On Jan 12, 2012, at 1:03 PM, aurisabel fereira wrote:

> Hi
> 
> I get this message when I execute  ./configure 
> 
> "configure: error: openssl/md5.h not found. NOX requires OpenSSL"
> 
> Any idea what this error could be?
> 
> Thanks 
> 
> Aurisabel 
> ___
> 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


Re: [nox-dev] Topology component and FlowVisor.

2012-01-12 Thread Murphy McCauley
There have been some changes to logging.  Use -v -v.

-- Murphy

On Jan 12, 2012, at 10:10 AM, Sergio Jiménez Feijóo wrote:

> Hi Aaron,
> 
> I have moved to the destiny branch and compiled everything again. The 
> topology component seems to work fine (I can see "new link detected" messages 
> in the log) but now I can't see the log messages of my application (VLOG_DBG 
> function) despite I'm running NOX with the -v flag. My application isn't 
> working properly yet but until I can see those log messages I won't be able 
> to find the cause of the new problem.
> 
> In response to Ali: I Have tested my application in another testbed without 
> flowvisor but I can't run it in this testbed without flowvisor. I can't 
> disable FlowVisor because I'm using the OFELIA project infraestructure (I 
> share the devices with other experimenters): 
> http://www.fp7-ofelia.eu/ofelia-facility-and-islands/equipment/
> 
> Thank you.
> 
> El 12/01/2012 18:08, Aaron Rosen escribió:
>> 
>> If you do a packet dump at the flowvisor do you see vlan tags on these LLDP 
>> packets returned to you?  
>> 
>> I'm guessing the LLDP packets that are returned to you from the switch (Via 
>> PACKET_IN) ) do not have VLAN tags correct? (The switch takes them off since 
>> this switch isn't acting as a pure of switch. Only this one vlan is being 
>> openflow controlled. ) 
>> 
>> This is the same reason why your controller does not need to know which vlan 
>> tag you are using on the switch. When the controller sends a LLDP packet to 
>> the switch the switch will output that packet on the correct port and 
>> automatically add the tag for you. 
>> 
>> You said this was working with out flowvisor right? If you run git branch 
>> from the nox directory what does it say? 
>> 
>> Aaron
>> 
>> 
>> 2012/1/12 Sergio Jiménez Feijóo 
>> Hi Aaron,
>> 
>> My application that runs on NOX examines the packets and forwards them 
>> keeping the same VLAN ID tag. But how does the topology module tell the 
>> switches that they must send the LLDPs with a certain VLAN ID tag? The 
>> topology module is independent from my application and I can't controle it. 
>> If the topology module sends the LLDPs packets without the proper VLAN tag 
>> they won't be forwarded to my controller (because they won't belong to my 
>> FlowVisor flowspace).
>> 
>> This is just a supposition but I think this may be the cause of the problem.
>> 
>> Thank you for your help.
>> 
>> El 12/01/2012 16:25, Aaron Rosen escribió:
>>> Did you do git checkout -b destiny 
>>> 
>>> When the controller sends the LLDP packet it won't have a vlan tag. Once it 
>>> leaves the switch, the switch will add your tag for you.  I don't think 
>>> that's the problem. 
>>> 
>>> Aaron
>>> 
>>> 2012/1/12 Sergio Jiménez Feijóo 
>>> Hi Aaron,
>>> 
>>> I'm using the latest version (I think). I downloaded it from the git 
>>> repository by the command "git clone git://noxrepo.org/nox" a few days ago.
>>> 
>>> My flowspace consists on tagging all my trafic with a certain VLAN ID (VLAN 
>>> 13). All the traffic tagged with that VLAN ID belongs to my flowspace. Is 
>>> it possible that the topology component isn't sending the LLDP frames 
>>> tagged with the proper VLAN ID? How can I force the topology component to 
>>> send the LLDP frames tagged with a certain VLAN ID?
>>> 
>>> Thank you.
>>> 
>>> El 12/01/2012 15:33, Aaron Rosen escribió:
 P.S: Which version of nox are you running? I believe this works fine in 
 destiny. 
 
 Aaron
 
 2012/1/12 Aaron Rosen 
 Hi, 
 
 I've encountered an issue like this before with flowvisor and the 
 discovery module. The easiest thing to do is to change the lldp value in 
 
  ./src/nox/lib/packet/ethernet.py 
 
#LLDP_TYPE = 0x88cc
 LLDP_TYPE = new_value
 
 then add this new_value, ether_type to your slice. 
 
 Hopefully that will do the trick. 
 
 Aaron
 
 
 2012/1/12 Sergio Jiménez Feijóo 
 Hi guys,
 
 I've developed a NOX aplication which needs to use the topology component 
 to discover the network topology. I've tested my application in a testbed 
 of 6 Linksys WRT54GL running the OpenWRT Pantou firmware (without 
 flowvisor) and it worked like a charm. Now I'm testing my aplication in a 
 testbed of 5 NEC IP8800/S3640-24T2XW (with flowvisor) and the topology 
 detection isn't working at all (the data struct is empty).
 
 Since OpenFlow allows an application to run in different devices I've 
 discarded the fact of using new switches as the cause of the error. 
 Therefore I think flowvisor is causing the topology component not to run 
 properly. Is this possible? Have you experienced any problems with 
 flowvisor and NOX?
 
 Thank you.
 
 http://homestore.cisco.eu/store/ciscoeu/en_IE/pd/productID.241269400
 http://www.openflow.org/wk/index.php/Pantou_:_OpenFlow_1.0_for_OpenWRT
 http://yub

Re: [nox-dev] features-reply without features-request

2012-01-11 Thread Murphy McCauley
I can't speak as to the particulars of the reference switch (you might try one 
of the OpenFlow mailing lists).

However, the spec does state that part of the handshake sequence is that the 
controller sends a features request when a connection is established.  I don't 
see this in your sequences of messages below.  NOX should do this.  Are you 
using NOX?  If so, is it possible you missed this message (remember that 
multiple OpenFlow messages can be in the same packet, so it is possible it's in 
packet #4 along with the HELLO or something -- you'll have to look at the 
detail view of the packet, not just the summary line)?

If the message really isn't there, I suppose it's possible that ofprotocol does 
this proactively, but in this case I believe your controller is out of spec.

-- Murphy

On Jan 11, 2012, at 6:00 AM, Cayle Spandon wrote:

> Are OpenFlow controllers expected to process unsolicited feature-reply 
> messages?
> 
> I am running the following setup:
> 
> controller - ofprotocol - ofdatapath
> 
> Using wireshark I see the following sequence of messages:
> 
> #1 ofprotocol -> ofdatapath : hello
> #2 ofprotocol -> controller : hello
> #3 ofdatapath -> ofprotocol : hello
> #4 controller -> ofprotocol : hello
> #5 ofprotocol -> ofdatapath : features-request
> #6 ofdatapath -> ofprotocol : features-reply
> #7 ofprotocol -> controller : features-reply
> 
> This means that the controller gets a features-reply even though it
> never sent a features-request.
> 
> It appears that ofprotocol originates the features-request to the
> switch (which is somewhat surprising because I thought it was supposed
> to be a dumb pass-through) and the forwards the features-reply to the
> controller.
> ___
> 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


Re: [nox-dev] Nox messenger example for external c++ and nox python

2012-01-10 Thread Murphy McCauley
Actually, no.  The version I posted has Python support for the plain messenger 
too, not just the JSON messenger.  But it sounds like you're satisfied with 
using the JSON messenger.

See the channel.receive() method in nox/coreapps/messenger/messenger.py.  But 
really this is just simple socket IO.

Hope that helps.

-- Murphy

On Jan 9, 2012, at 11:00 PM, Harshil Anil Kumar Shah wrote:

> Hi Murphy,
> Thanks for the reply.
> I am using the Zaku beta version. I guess it is the same library that you 
> sent.
> But one question I have is, I got some working example of send() function 
> from nox-send-cmd.py but for recv() function, I can’t find example. How can I 
> use recv() functionof messenger.py??
>  
> Thanks,
> Harshil
>  
>  
> From: Murphy McCauley [mailto:jam...@nau.edu] 
> Sent: Wednesday, December 21, 2011 4:47 PM
> To: Harshil Anil Kumar Shah
> Cc: Kyriakos Zarifis; nox-dev@noxrepo.org
> Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python
>  
> No, the plain messenger is not exposed to Python.  Kyriakos and I did enough 
> of the JSON messenger to get monitoring working, but never did the normal 
> messenger.  The messenger.py should really be named messenger_client.py, and 
> maybe shouldn't even be in that directory -- it's a library for writing 
> messenger clients, and not a NOX component.
>  
> I've taken a quick stab at exposing the plain messenger to Python.  You can 
> grab my current messenger directory from:
> http://www.noxathome.org/x/Murphy/messenger/messenger.zip
>  
> Using it is very much like using jsonmessenger (as monitoring does).  
> Something like:
>  
> 1) In your component's install function:
> from nox.coreapps.messenger.pymsgevent import Msg_event
> self.register_handler(Msg_event.static_get_name(), myHandler)
>  
> 2) Implement a handler:
> def myHandler (e):
>   print e.type, e.body
>  
> 3) Include pymessenger on the commandline or as a dependency
>  
> Messages for messenger are prefixed with a three byte header:
> 2 Byte Network Order Unsigned Integer:
>   Message length (including header)
> 1 Byte:
>   Message type (can be anything, but I think 0-9 are reserved -- see 
> messenger.hh)
>  
>  
> Hope that's useful.
>  
> -- Murphy
>  
> On Dec 21, 2011, at 2:46 AM, Harshil Anil Kumar Shah wrote:
> 
> 
> Thanks Murphy.
> I guess 2nd option is the better to go with.
> Can I use boost.python for that?
> And I guess plain messenger is exposed to python. There are messenger.py  and 
> messenger.cpp/hh files corresponding to plain messenger.
>  
> -Harshil
>  
> From: Murphy McCauley [mailto:jam...@nau.edu] 
> Sent: Wednesday, December 21, 2011 2:33 PM
> To: Harshil Anil Kumar Shah
> Cc: Kyriakos Zarifis; nox-dev@noxrepo.org
> Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python
>  
> So NOX's messenger is a fairly generic method for communicating with external 
> applications over a socket.  Built on top of this is jsonmessenger which 
> communicates JSON messages over a socket.
>  
> If you specifically want to use protobufs (and not JSON messages), then you'd 
> want to use the plain messenger.  However, the plain messenger is not exposed 
> to Python -- only jsonmessenger is.
>  
> So I think your options are:
> 1) Use JSON messages instead of protobufs, and just use jsonmessenger
> 2) Expose messenger to Python, and then use this to send/receive protobufs
> 3) Use protobufs and roll your own method for communicating with your 
> external application (probably using Twisted)
>  
> -- Murphy
>  
> On Dec 20, 2011, at 11:02 PM, Harshil Anil Kumar Shah wrote:
> 
> 
> 
> Hi Murphy.
> Yes, I have external C++ module which I want to communicate with Nox python 
> module using protobuf. I am using libjson library at C++ module.
>  
> -Harshil.
>  
> From: Murphy McCauley [mailto:jam...@nau.edu] 
> Sent: Wednesday, December 21, 2011 1:38 AM
> To: Harshil Anil Kumar Shah
> Cc: Kyriakos Zarifis; nox-dev@noxrepo.org
> Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python
>  
> Do you mean that you have some external program (written in C++) that you 
> want to communicate with a NOX component (written in Python)?
>  
> jsonmessenger works by sending and receiving JSON (http://json.org) messages. 
>  So on the NOX side, you use jsonmessenger.  In the external program, you can 
> use any of several libraries for doing JSON encoding/decoding.
>  
> -- Murphy
>  
> On Dec 20, 2011, at 1:09 AM, Harshil Anil Kumar Shah wrote:
> 
> 
> 
> 
> Hi,
> In my case where external module is C++ then can I use “pyobject” to interact

Re: [nox-dev] nox api support for openflow 1.0 spec operation

2012-01-09 Thread Murphy McCauley
Item #1:
flowtracer and monitoring both do per flow statistics.  You might want to 
examine how they do it (they use pylibopenflow to craft an OpenFlow message).

Item #2:
As I mentioned in response to your previous message, you must be using the 
destiny branch of NOX (not zaku) to use OFPAT_ENQUEUE.  Please upgrade.

-- Murphy

On Jan 9, 2012, at 9:45 PM, Amit Tewari wrote:

> Hi,
>  
> I am currently using NOX 0.9.0(zaku)~full~beta  contrlooer for my openvswitch 
> 1.2.2 on openflow 1.0
>  
> I have developed certain api’s using /lib/core.py file .
> I am able to get table statictics and port statistics of switch on nox.
>  
> ISSUE:
> I want to extract per flow statistics , queue statistics on nox . but I am 
> unable to find api’s and handlers for it.
> I want to support ENQUEUE action also, but when I use send_flow_command  api 
> it returns error.
> Self.ctxt.send_flow_command with action argument as OFPAT_ENQUEUE  then 
> make_actions_array routine returns error “action not supported”
>  
> In make_actions_array routine only testing is for OFPAT_OUTPUT action type.
>  
> Although lib/openflow.py contains all flags and operations as per openflow 
> 1.0 spec.
>  
> Please let me know how I can meet support these features using nox, or I need 
> to use different nox version ?
>  
> Regards
> Amit Tewari
> NHST
>  
> DISCLAIMER: 
> ---
>  
> The contents of this e-mail and any attachment(s) are confidential and
> intended 
> for the named recipient(s) only.  
> It shall not attach any liability on the originator or NECHCL or its 
> affiliates. Any views or opinions presented in  
> this email are solely those of the author and may not necessarily reflect the 
> opinions of NECHCL or its affiliates.  
> Any form of reproduction, dissemination, copying, disclosure, modification, 
> distribution and / or publication of  
> this message without the prior written consent of the author of this e-mail 
> is 
> strictly prohibited. If you have  
> received this email in error please delete it and notify the sender 
> immediately. . 
> ---
> ___
> 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


Re: [nox-dev] IP address prefixing

2012-01-09 Thread Murphy McCauley
I am assuming that by 10.10.23.40/2, you don't intend the CIDR meaning, and in 
fact mean that you want two bits to be wildcarded.

Try this:
wildcard = (wildcard & ~OFPFW_NW_DST_MASK) | (wild_bits << OFPFW_NW_DST_SHIFT);

.. where wild_bits is between 0 and 32 inclusive (in your case, it should be 2).

Hope that helps.

-- Murphy

On Jan 9, 2012, at 10:24 AM, Theophlius Benson wrote:

> Good Morning,
> 
> I am trying to install rules into switches to match ip prefixes. For example 
> 10.10.23.40/2.  However, the rules i install endup looking like this: 
> 0.0.0.0/2.  I'm sure that I'm installing these rules incorrectly.  Here is a 
> fragment of the code that sets the matching criteria.
> 
> wildcard = (~OFPFW_NW_DST_ALL & (OFPFW_NW_DST_MASK << dstmask)) | 
> wildcard;
>ofm->match.wildcards = htonl(wildcard);
>ofm->match.nw_dst=htonl(dstip);
> 
> I Can include more fragments of the code if you will find it helpful.
> Theo
> ___
> 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


Re: [nox-dev] extract_flow not consistent with install_datapath_flow?

2012-01-09 Thread Murphy McCauley
Thanks for the report.

Since matching on IP addresses in ARPs is an optional switch feature, I don't 
think it's 100% clear what the function should do, but I don't object to the 
idea that it should probably just extract the addresses.  I'll add it to my 
queue.

-- Murphy

On Jan 9, 2012, at 6:28 AM, Peter Peresini wrote:

> Hi,
> it seems that util.py extract_flow in destiny branch is not
> consistent with install_datapath_flow. I tried to install a flow
> extracted from a packet and the resulting match failed to capture the
> same packet stream.
> More precisely, if a packet is an ARP packet, extract_flow returns
> following attributes:
> 
> {'dl_type': 2054, 'nw_dst': 0, 'dl_vlan_pcp': 0, 'dl_src': array('B',
> [0, 0, 0, 0, 0, 11]), 'nw_proto': 1, 'nw_tos': 0, 'tp_dst': 0,
> 'tp_src': 0, 'dl_dst': array('B', [255, 255, 255, 255, 255, 255]),
> 'dl_vlan': 65535, 'nw_src': 0}
> 
> Now If I install the flow using these attributes, the switch still
> forwards the packets to the controller. I experimentally found that
> 
> del match[core.NW_DST]
> del match[core.NW_SRC]
> 
> solves the problem. According to the
> http://www.openflow.org/wk/index.php/OpenFlow_1.0_release_notes#Match_on_IP_fields_in_ARP_packets
> it seems that nw_src and nw_dst should contain actual IPs from ARP and
> not zeroes.
> 
> Kind regards
>  Peter Peresini
> ___
> 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


Re: [nox-dev] How can I update the IP checksum?

2012-01-09 Thread Murphy McCauley
OFPAT_SET_NW_DST should update the IP checksum.  Are you sure that a bad 
checksum is the problem?

Remember that if you rewrite the DST when sending from A to B, you'll also need 
to rewrite the SRC when sending from B back to A.  Host A doesn't know that 
you've rewritten the address and will have no idea that a message from some 
arbitrary address is supposed to be from B!

As a sidenote, you seem to be reading from the OpenFlow 1.1 spec, but NOX 
currently only supports OpenFlow 1.0.

-- Murphy

On Jan 9, 2012, at 4:08 AM, Hyogi Jung wrote:

> Hi,
> 
> I want to change the destination address.
> So I use these actions. And add output action.
> 
> OFPAT_SET_DL_DST, /* Ethernet destination address. */
> OFPAT_SET_NW_DST, /* IP destination address. */
> 
> Finally destination node could receive the changed packet.
> 
> But there is a problem.
> I snoop the packets using wireshark. After 3-handshaking (SYN, SYN+ACK), the 
> sender node send "RST" packet.
> I think it is occured by reason of "I didn't update the IP checksum."
> 
> Openflow-spec describe below.
> 
> Action : Set IPv4 destination address
> Description : Replace the existing IP destination address with and update the 
> IP checksum (and TCP/UDP/SCTP checksum if applicable).
>This action is only applied to IPv4 packets.
> 
> But How can I update the IP checksum?
> I use C/C++ languge.  I try to find updating IP checksum problem in 
> nox-mailing list.
> But I couldn't find it.
> 
> Is it a possible using "send_openflow_command()"  fuction or 
> "send_openflow_packet()" fuction?
> 
> send_openflow_command() function = change original packet in switch using 
> flow action.
> however, send_openflow_packet() = send new packet instructed by controller.
> 
> Could you give some advice or reference source?
> 
> Thank you.
> 
> - Hyogi
> ___
> 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


Re: [nox-dev] nox-gui flowtracer problem

2012-01-09 Thread Murphy McCauley
Right; I was unclear earlier.  This bug should only appear on 32 bit Pythons.  
On Pythons with 64 bit integers, these are not long integers and have no L 
suffix.

This is basically a bad behavior for the hex() function, and I believe this was 
*intended* to be fixed in Python 2.x, but was accidentally missed and now is 
only fixed in Python 3.  The solution for us is to use "0x%x" % (n,)) or 
hex(n).rstrip("L") or something instead of the plain hex(n).  We'll push a fix 
for this at some point.

Thanks again for pointing out the problem.

-- Murphy

On Jan 8, 2012, at 11:04 PM, wunyuan wrote:

> Dear Murphy,
> 
> My NOX controller is 32 bit and two clients are 32 bit. When the two clients 
> ping each other, this problem still occur.
> 
> Wun-Yuan
> 
> 於 2012/1/6 上午 09:39, wunyuan 提到:
>> 
>> Dear Murphy,
>> 
>> I forgot that our client are 64 bit version.Thanks for your reminding me.
>> 
>> 
>> 於 2012/1/5 下午 06:11, Murphy McCauley 提到:
>>> 
>>> Ah, of course, you must be running a 32 bit version.
>>> 
>>> We should fix this (maybe by replacing hex(n) with "0x%x" % (n,)).
>>> 
>>> Thanks for humoring me.
>>> 
>>> -- Murphy
>>> 
>>> On Jan 5, 2012, at 2:03 AM, wunyuan wrote:
>>> 
>>>> 
>>>> Hi,
>>>> 
>>>> The answers are as follows:
>>>> 
>>>> 於 2012/1/5 下午 05:46, Murphy McCauley 提到:
>>>>> 
>>>>> I'm a bit surprised.  Can you try "/usr/bin/python -V"?
>>>> 
>>>> Yes
>>>> nchc@NCHC:/usr/bin$ ./python -V
>>>> Python 2.7.1+
>>>> 
>>>>> 
>>>>> What OS / distro are you using?
>>>> 
>>>> nchc@NCHC:/usr/bin$ lsb_release -a
>>>> No LSB modules are available.
>>>> Distributor ID: Ubuntu
>>>> Description:Ubuntu 11.04
>>>> Release:11.04
>>>> Codename:   natty
>>>> 
>>>> 
>>>>> 
>>>>> -- Murphy
>>>>> 
>>>>> On Jan 5, 2012, at 1:35 AM, wunyuan wrote:
>>>>> 
>>>>>> Hi, 
>>>>>> 
>>>>>> My python version is 2.7.1+.
>>>>>> 
>>>>>> $~/wunyuan/oringinal_nox/destiny/nox/src$ python -V
>>>>>> Python 2.7.1+
>>>>>> 
>>>>>> Thanks!
>>>>>> 
>>>>>> 於 2012/1/5 下午 05:26, Murphy McCauley 提到:
>>>>>>> 
>>>>>>> Are you using Python 2.5?  I am guessing this bug doesn't exist with 
>>>>>>> Python 2.6+...
>>>>>>> 
>>>>>>> -- Murphy
>>>>>>> 
>>>>>>> On Jan 4, 2012, at 11:52 PM, wunyuan wrote:
>>>>>>> 
>>>>>>>> Hi,
>>>>>>>> 
>>>>>>>> The "0xe4115b1251b4L" string is our client internet iterface mac. Our 
>>>>>>>> client are HP DL380 G7.
>>>>>>>> Our Openflow are installed in Desktop PC with NetFPGA card.
>>>>>>>> 
>>>>>>>> Thanks.
>>>>>>>> 
>>>>>>>> 於 2012/1/5 下午 03:33, Kyriakos Zarifis 提到:
>>>>>>>>> 
>>>>>>>>> This seems to be a bug where the component was expecting a hex 
>>>>>>>>> string, but the "L" in the end of the long int messes things. Thanks 
>>>>>>>>> for reporting.
>>>>>>>>> What kind of switch are you using?
>>>>>>>>> 
>>>>>>>>> For a temporary fix in your case, try replacing line 95 with:
>>>>>>>>>value = int(value[:-1],16)
>>>>>>>>> 
>>>>>>>>> On Wed, Jan 4, 2012 at 11:07 PM, wunyuan  
>>>>>>>>> wrote:
>>>>>>>>> Dear all,
>>>>>>>>> 
>>>>>>>>> I build a testbed as follows:
>>>>>>>>> 
>>>>>>>>>   NOX
>>>>>>>>>   /  \
>>>>>>>>>of1of2
>>>>>>>>> /\
>>>>>>>>>ab
>>>>>>>&

Re: [nox-dev] Where is the repository in development?

2012-01-08 Thread Murphy McCauley
You're in the right repository but the wrong branch -- the current development 
branch is in the destiny branch (last updated within the past couple months).  
To get this, after you clone the repository, use "git checkout destiny".

I have a number of patches pending for this branch, after which it will become 
the new stable branch, and we'll be introducing a new development branch (a lot 
of work has already been done on this).

-- Murphy

On Jan 8, 2012, at 9:16 AM, Hiroyasu Ohyama wrote:

> Hello,
> I'm also beholden to NOX, and I have just simple questions about the
> activity of this community.
> 
> I know it that NOX is one of the most famous program as OpenFlow
> controller, and discussed actively in here.
> But I wonder why this git repository (git://noxrepo.org/nox) which is
> introduced at following pages has never commited for a half of year or
> more.
> 
> http://noxrepo.org/wp/?p=55
> http://noxrepo.org/noxwiki/index.php/NOX_Installation#Installation
> 
> The last commit of this repository is on Mar 1, 2011.
> Before that, this repository has been commited frequently by the
> people who is in here.
> 
> Had already stopped for maintenance?
> Where is the repository in development, that is heavily maintained?
> 
> I really want to use the latest one.
> Thanks.
> ___
> 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


Re: [nox-dev] NOX API development

2012-01-05 Thread Murphy McCauley
Responses inline.

On Jan 5, 2012, at 5:10 AM, Amit Tewari wrote:
 
> If I use openflow.OFPFC_MODIFY flag in send_flow_command, it gives me 
> error-“invalid action type”

Something like the following should let you modify flows:

from util import set_match
from nox.coreapps.pyrt.pycomponent import UINT32_MAX

self.ctxt.send_flow_command(dpid,
openflow.OFPFC_MODIFY,
set_match(attrs),
idle_timeout, # timeouts only used if flow
hard_timeout, # didn't exist
self.make_action_array(actions),
UINT32_MAX, # No buffer ID
priority)

attrs and actions are as described in install_datapath_flow()'s documentation.

> Also if I give flag as OFPAT_ENQUEUE it gives me error.

Where are you trying to put that?  It belongs in the actions list.

Also, it is one of the newer actions and it won't be available on older 
versions of NOX.  Are you using the destiny branch?

> I wanted to know Are there any other library files in nox whose functions I 
> can use for developing my api or nox dosent support it ?


send_openflow_command() pretty much sends a raw buffer to a datapath, so you 
can craft pretty much any OpenFlow command you want (often using 
pyopenflow.py), and send it.

The monitoring component uses this technique, so you can look at it as an 
example.  Among other things, it uses it to get flow stats.

Hope that helps.

Murphy___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] nox-gui flowtracer problem

2012-01-05 Thread Murphy McCauley
Ah, of course, you must be running a 32 bit version.

We should fix this (maybe by replacing hex(n) with "0x%x" % (n,)).

Thanks for humoring me.

-- Murphy

On Jan 5, 2012, at 2:03 AM, wunyuan wrote:

> 
> Hi,
> 
> The answers are as follows:
> 
> 於 2012/1/5 下午 05:46, Murphy McCauley 提到:
>> 
>> I'm a bit surprised.  Can you try "/usr/bin/python -V"?
> 
> Yes
> nchc@NCHC:/usr/bin$ ./python -V
> Python 2.7.1+
> 
>> 
>> What OS / distro are you using?
> 
> nchc@NCHC:/usr/bin$ lsb_release -a
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description:Ubuntu 11.04
> Release:11.04
> Codename:   natty
> 
> 
>> 
>> -- Murphy
>> 
>> On Jan 5, 2012, at 1:35 AM, wunyuan wrote:
>> 
>>> Hi, 
>>> 
>>> My python version is 2.7.1+.
>>> 
>>> $~/wunyuan/oringinal_nox/destiny/nox/src$ python -V
>>> Python 2.7.1+
>>> 
>>> Thanks!
>>> 
>>> 於 2012/1/5 下午 05:26, Murphy McCauley 提到:
>>>> 
>>>> Are you using Python 2.5?  I am guessing this bug doesn't exist with 
>>>> Python 2.6+...
>>>> 
>>>> -- Murphy
>>>> 
>>>> On Jan 4, 2012, at 11:52 PM, wunyuan wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> The "0xe4115b1251b4L" string is our client internet iterface mac. Our 
>>>>> client are HP DL380 G7.
>>>>> Our Openflow are installed in Desktop PC with NetFPGA card.
>>>>> 
>>>>> Thanks.
>>>>> 
>>>>> 於 2012/1/5 下午 03:33, Kyriakos Zarifis 提到:
>>>>>> 
>>>>>> This seems to be a bug where the component was expecting a hex string, 
>>>>>> but the "L" in the end of the long int messes things. Thanks for 
>>>>>> reporting.
>>>>>> What kind of switch are you using?
>>>>>> 
>>>>>> For a temporary fix in your case, try replacing line 95 with:
>>>>>>value = int(value[:-1],16)
>>>>>> 
>>>>>> On Wed, Jan 4, 2012 at 11:07 PM, wunyuan  
>>>>>> wrote:
>>>>>> Dear all,
>>>>>> 
>>>>>> I build a testbed as follows:
>>>>>> 
>>>>>>   NOX
>>>>>>   /  \
>>>>>>of1of2
>>>>>> /\
>>>>>>ab
>>>>>> Firstly, I set a and b to ping each other. Secondly, I input "./nox_core 
>>>>>> -v -v -i ptcp:9550 routing lavi monitoring trackhost_pktin" to run the 
>>>>>> NOX. and then start nox-gui. Thirdly, I click "FlowTracer" botton and 
>>>>>> then double click of1 node on nox-gui to show its flow entries. Finally, 
>>>>>> I highlight one entry and click "Trace!" botton. However,I cannot find 
>>>>>> any flows on nox-gui and I find one error message. this error message is 
>>>>>> as follows:
>>>>>> 
>>>>>> File "~/nox/src/gui/views/flowtracer.py", line 95, in trace_flow
>>>>>>value = int(value,16)
>>>>>> ValueError: invalid literal for int() with base 16: '0xe4115b1251b4L'
>>>>>> 
>>>>>> How could I fix it?
>>>>>> 
>>>>>> -- 
>>>>>> 
>>>>>> ===
>>>>>> 系統與網路技術組-黃文源(Wun-Yuan Huang)
>>>>>> 財團法人國家實驗研究院
>>>>>> 國家高速網路與計算中心南部事業群
>>>>>> National Center for High-Performance Computing South Region Office
>>>>>> 台南縣台南科學園區南科三路28號
>>>>>> No.28, Nan-Ke 3rd. Rd., Science-based Industrial Park, Tainan 744, 
>>>>>> Taiwan, R.O.C.
>>>>>> TEL:06-5050940 ext.751
>>>>>> FAX:06-5050945
>>>>>> E-Mail:wuny...@nchc.narl.org.tw
>>>>>> ===
>>>>>> 
>>>>>> ___
>>>>>> nox-dev mailing list
>>>>>> nox-dev@noxrepo.org
>>>>>> http://noxrepo.org/mailman/listinfo/nox-dev
>>>>>> 
>>>>> 
>&g

Re: [nox-dev] nox-gui flowtracer problem

2012-01-05 Thread Murphy McCauley
I'm a bit surprised.  Can you try "/usr/bin/python -V"?

What OS / distro are you using?

-- Murphy

On Jan 5, 2012, at 1:35 AM, wunyuan wrote:

> Hi, 
> 
> My python version is 2.7.1+.
> 
> $~/wunyuan/oringinal_nox/destiny/nox/src$ python -V
> Python 2.7.1+
> 
> Thanks!
> 
> 於 2012/1/5 下午 05:26, Murphy McCauley 提到:
>> 
>> Are you using Python 2.5?  I am guessing this bug doesn't exist with Python 
>> 2.6+...
>> 
>> -- Murphy
>> 
>> On Jan 4, 2012, at 11:52 PM, wunyuan wrote:
>> 
>>> Hi,
>>> 
>>> The "0xe4115b1251b4L" string is our client internet iterface mac. Our 
>>> client are HP DL380 G7.
>>> Our Openflow are installed in Desktop PC with NetFPGA card.
>>> 
>>> Thanks.
>>> 
>>> 於 2012/1/5 下午 03:33, Kyriakos Zarifis 提到:
>>>> 
>>>> This seems to be a bug where the component was expecting a hex string, but 
>>>> the "L" in the end of the long int messes things. Thanks for reporting.
>>>> What kind of switch are you using?
>>>> 
>>>> For a temporary fix in your case, try replacing line 95 with:
>>>>value = int(value[:-1],16)
>>>> 
>>>> On Wed, Jan 4, 2012 at 11:07 PM, wunyuan  wrote:
>>>> Dear all,
>>>> 
>>>> I build a testbed as follows:
>>>> 
>>>>   NOX
>>>>   /  \
>>>>of1of2
>>>> /\
>>>>ab
>>>> Firstly, I set a and b to ping each other. Secondly, I input "./nox_core 
>>>> -v -v -i ptcp:9550 routing lavi monitoring trackhost_pktin" to run the 
>>>> NOX. and then start nox-gui. Thirdly, I click "FlowTracer" botton and then 
>>>> double click of1 node on nox-gui to show its flow entries. Finally, I 
>>>> highlight one entry and click "Trace!" botton. However,I cannot find any 
>>>> flows on nox-gui and I find one error message. this error message is as 
>>>> follows:
>>>> 
>>>> File "~/nox/src/gui/views/flowtracer.py", line 95, in trace_flow
>>>>value = int(value,16)
>>>> ValueError: invalid literal for int() with base 16: '0xe4115b1251b4L'
>>>> 
>>>> How could I fix it?
>>>> 
>>>> -- 
>>>> 
>>>> ===
>>>> 系統與網路技術組-黃文源(Wun-Yuan Huang)
>>>> 財團法人國家實驗研究院
>>>> 國家高速網路與計算中心南部事業群
>>>> National Center for High-Performance Computing South Region Office
>>>> 台南縣台南科學園區南科三路28號
>>>> No.28, Nan-Ke 3rd. Rd., Science-based Industrial Park, Tainan 744, Taiwan, 
>>>> R.O.C.
>>>> TEL:06-5050940 ext.751
>>>> FAX:06-5050945
>>>> E-Mail:wuny...@nchc.narl.org.tw
>>>> ===
>>>> 
>>>> ___
>>>> nox-dev mailing list
>>>> nox-dev@noxrepo.org
>>>> http://noxrepo.org/mailman/listinfo/nox-dev
>>>> 
>>> 
>>> 
>>> -- 
>>> 
>>> ===
>>> 系統與網路技術組-黃文源(Wun-Yuan Huang)
>>> 財團法人國家實驗研究院
>>> 國家高速網路與計算中心南部事業群
>>> National Center for High-Performance Computing South Region Office
>>> 台南縣台南科學園區南科三路28號
>>> No.28, Nan-Ke 3rd. Rd., Science-based Industrial Park, Tainan 744, Taiwan, 
>>> R.O.C.
>>> TEL:06-5050940 ext.751 
>>> FAX:06-5050945
>>> E-Mail:wuny...@nchc.narl.org.tw
>>> ===
>>> ___
>>> nox-dev mailing list
>>> nox-dev@noxrepo.org
>>> http://noxrepo.org/mailman/listinfo/nox-dev
>> 
> 
> 
> -- 
> 
> ===
> 系統與網路技術組-黃文源(Wun-Yuan Huang)
> 財團法人國家實驗研究院
> 國家高速網路與計算中心南部事業群
> National Center for High-Performance Computing South Region Office
> 台南縣台南科學園區南科三路28號
> No.28, Nan-Ke 3rd. Rd., Science-based Industrial Park, Tainan 744, Taiwan, 
> R.O.C.
> TEL:06-5050940 ext.751 
> FAX:06-5050945
> E-Mail:wuny...@nchc.narl.org.tw
> ===

___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] nox-gui flowtracer problem

2012-01-05 Thread Murphy McCauley
Are you using Python 2.5?  I am guessing this bug doesn't exist with Python 
2.6+...

-- Murphy

On Jan 4, 2012, at 11:52 PM, wunyuan wrote:

> Hi,
> 
> The "0xe4115b1251b4L" string is our client internet iterface mac. Our client 
> are HP DL380 G7.
> Our Openflow are installed in Desktop PC with NetFPGA card.
> 
> Thanks.
> 
> 於 2012/1/5 下午 03:33, Kyriakos Zarifis 提到:
>> 
>> This seems to be a bug where the component was expecting a hex string, but 
>> the "L" in the end of the long int messes things. Thanks for reporting.
>> What kind of switch are you using?
>> 
>> For a temporary fix in your case, try replacing line 95 with:
>>value = int(value[:-1],16)
>> 
>> On Wed, Jan 4, 2012 at 11:07 PM, wunyuan  wrote:
>> Dear all,
>> 
>> I build a testbed as follows:
>> 
>>   NOX
>>   /  \
>>of1of2
>> /\
>>ab
>> Firstly, I set a and b to ping each other. Secondly, I input "./nox_core -v 
>> -v -i ptcp:9550 routing lavi monitoring trackhost_pktin" to run the NOX. and 
>> then start nox-gui. Thirdly, I click "FlowTracer" botton and then double 
>> click of1 node on nox-gui to show its flow entries. Finally, I highlight one 
>> entry and click "Trace!" botton. However,I cannot find any flows on nox-gui 
>> and I find one error message. this error message is as follows:
>> 
>> File "~/nox/src/gui/views/flowtracer.py", line 95, in trace_flow
>>value = int(value,16)
>> ValueError: invalid literal for int() with base 16: '0xe4115b1251b4L'
>> 
>> How could I fix it?
>> 
>> -- 
>> 
>> ===
>> 系統與網路技術組-黃文源(Wun-Yuan Huang)
>> 財團法人國家實驗研究院
>> 國家高速網路與計算中心南部事業群
>> National Center for High-Performance Computing South Region Office
>> 台南縣台南科學園區南科三路28號
>> No.28, Nan-Ke 3rd. Rd., Science-based Industrial Park, Tainan 744, Taiwan, 
>> R.O.C.
>> TEL:06-5050940 ext.751
>> FAX:06-5050945
>> E-Mail:wuny...@nchc.narl.org.tw
>> ===
>> 
>> ___
>> nox-dev mailing list
>> nox-dev@noxrepo.org
>> http://noxrepo.org/mailman/listinfo/nox-dev
>> 
> 
> 
> -- 
> 
> ===
> 系統與網路技術組-黃文源(Wun-Yuan Huang)
> 財團法人國家實驗研究院
> 國家高速網路與計算中心南部事業群
> National Center for High-Performance Computing South Region Office
> 台南縣台南科學園區南科三路28號
> No.28, Nan-Ke 3rd. Rd., Science-based Industrial Park, Tainan 744, Taiwan, 
> R.O.C.
> TEL:06-5050940 ext.751 
> FAX:06-5050945
> E-Mail:wuny...@nchc.narl.org.tw
> ===
> ___
> 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


Re: [nox-dev] something about the working mechanism of NOX

2012-01-04 Thread Murphy McCauley
#1:
When a switch gets a packet that doesn't correspond to an entry in the flow 
tables, it will generally buffer it and associate this buffer with an opaque 
buffer identifier.  It will then send a packet_in message to the controller 
that includes the buffer ID and *part* of the packet data itself (usually not 
all of it).

However, if the switch runs out of buffer space, it is supposed to send a 
buffer ID of all-bits-on (UNIT32_MAX) along with *all* of the packet data.

The code you posted checks to see which of these cases is being handled.  If 
buffer_id == UINT32_MAX, then the controller didn't buffer the packet.  So it 
should have sent the entire payload.  The second if statement checks to make 
sure this is actually the case.

If you remove this code, it will continue to operate the same unless the switch 
decides not to buffer packets (because it ran out of buffers or for some other 
reason).

#2:
send_openflow_command() sends any OpenFlow command (anything that starts with 
an OpenFlow header).  send_openflow_packet(), on the other hand, is a shortcut 
specifically for sending ofp_packet_out messages.

#3:
You are mistaken about OFPT_PACKET_OUT -- it does not modify the flow table.  
OFPT_FLOW_MOD does.

OFPT_PACKET_OUT is used to immediately send some piece of data (that has either 
already been buffered in the switch or that the controller provides).


Hope that clears things up.

-- Murphy

On Dec 30, 2011, at 8:10 PM, 王健 wrote:

>  Hi all:
>I'm a new comer of NOX, and want to know the mechanism of NOX, so i 
> see the codes of hub.cc at the beginning. There are some questions that  
> perplex me for a long time which i list as follows.
>   1)  if (buffer_id == UINT32_MAX) {   
> size_t data_len = pi.get_buffer()->size();
> size_t total_len = pi.total_len;
> if (total_len == data_len) {
> send_openflow_packe t(pi.datapath_id, *pi.get_buffer(), 
> OFPP_FLOOD, pi.in_port, true);
> } else {
> /* Control path didn't buffer the packet and didn't send us
>  * the whole thing--what gives? */
> lg.dbg("total_len=%zu data_len=%zu\n", total_len, data_len); 
> }tion
>   There codes are in src/nox/coreapps/hub/hub.cc file. what is the function 
> of them?do they effect the function of hub.cc if remove ?
>2) what is the differe nce between "int send_openflow_command()" and "int 
> send_openflow_packet()" which defined in src/nox/component.hh. I know both 
> are used for interacting with OF switch.
> 3)The type of controller/switch message contains OFPT_PACKET_OUT and 
> OFPT_FLOW_MOD. I think both of them are used to add/delete/modify flow table 
> entry in OF switch, am i right? I don't know what is the difference even if 
> refer to openflow-spec-1.0.0
>would you like to tell me? Thank you very much, look forward to hear from 
> you~
>  Best Wishes
>&nbs 
> p;  
> Wang Jian
>   
>& nbsp;   Saturday, 
> December 31, 2011
> 
> 
> 
> ___
> 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


Re: [nox-dev] Must each switch connect to nox controller?

2012-01-04 Thread Murphy McCauley
The machine running NOX does not need to be *directly* connected to the 
switches; it just needs to be able to reach them.  So you could build a 
separate control network out of standard L2 switches or routers or whatever 
which allows all OpenFlow switches to be accessed from a single port.  
Alternately, you can do what you suggest where NOX directly connects to one or 
more OpenFlow switches and then communicates with other OpenFlow switches 
through those ("in-band control").

As for how many switches NOX can support... I don't think there's an easy 
answer here.  I think this will vary hugely depending on exactly what your 
control program and network are doing.

-- Murphy

On Jan 4, 2012, at 4:41 AM, 陈阳 wrote:

> Hi,
> I have read some papers about OpenFlow and NOX like 'NOX:Towards an 
> Operationg System for Networks'. As the papers presented that each switch is 
> connected to  NOX.I wonder what if NOX only has a few network interface but 
> there are many OpenFlow switches? How can it connect to all the switches?Or 
> that the controller like NOX only  connects to a few switches  directly and 
> the other swiches are connected to them? And I also want to know how many 
> switched that NOX can support? 
> 
> Chenyang
> 
> 
> ___
> 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


Re: [nox-dev] Error on importing nox/netapps/monitoring.py

2011-12-29 Thread Murphy McCauley
You should.  If your component interacts with the monitoring component, you 
should be running the monitoring component -- your component is dependent on it.

The proper way to do this is to add "monitoring" to the list of dependencies in 
your component's meta.json.  As a shortcut, you can just specify monitoring on 
the commandline along the lines of:  ./nox_core monitoring NOXSwitch

Hope that helps.

-- Murphy

On Dec 29, 2011, at 11:18 PM, Dushyant Arora wrote:

> No.
> 
> On Fri, Dec 30, 2011 at 2:16 AM, Murphy McCauley  wrote:
> Are you also running the monitoring component, either on the commandline 
> before your component or by adding it as a dependency in your component's 
> meta.json?
> 
> -- Murphy
> 
> On Dec 29, 2011, at 10:25 PM, Dushyant Arora wrote:
> 
> > Hello,
> >
> > I have created a NOX application NOXSwitch.py which calls 
> > send_flow_stats_request() from the module monitoring.py. However I get the 
> > following ImportError:
> >
> > 1|nox|INFO:Starting nox_core 
> > (/home/openflow/noxcore/build/src/.libs/lt-nox_core)
> > 2|nox|ERR:Cannot change the state of 'NOXSwitch' to INSTALLED:
> > 'NOXSwitch' ran into an error:
> > cannot import a Python module 'nox.coreapps.examples.NOXSwitch':
> > Traceback (most recent call last):
> >   File "./nox/coreapps/examples/NOXSwitch.py", line 37, in 
> > from nox.netapps.monitoring.monitoring import Monitoring
> >   File "./nox/netapps/monitoring/monitoring.py", line 33, in 
> > 
> > from nox.coreapps.messenger.pyjsonmsgevent import JSONMsg_event
> >   File "./nox/coreapps/messenger/pyjsonmsgevent.py", line 25, in 
> > 
> > _pyjsonmsgevent = swig_import_helper()
> >   File "./nox/coreapps/messenger/pyjsonmsgevent.py", line 21, in 
> > swig_import_helper
> > _mod = imp.load_module('_pyjsonmsgevent', fp, pathname, 
> > description)
> > ImportError: ./nox/coreapps/messenger/_pyjsonmsgevent.so: undefined 
> > symbol: vigil::JSONMsg_event::JSONMsg_event(vigil::core_message const*)
> >
> > How do I correct this?
> >
> > I am trying to follow this earlier thread: 
> > http://noxrepo.org/pipermail/nox-dev/2011-November/008246.html
> >
> > Thanks,
> >
> > Dushyant
> > ___
> > 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


Re: [nox-dev] Error on importing nox/netapps/monitoring.py

2011-12-29 Thread Murphy McCauley
Are you also running the monitoring component, either on the commandline before 
your component or by adding it as a dependency in your component's meta.json?

-- Murphy

On Dec 29, 2011, at 10:25 PM, Dushyant Arora wrote:

> Hello, 
> 
> I have created a NOX application NOXSwitch.py which calls 
> send_flow_stats_request() from the module monitoring.py. However I get the 
> following ImportError:
> 
> 1|nox|INFO:Starting nox_core 
> (/home/openflow/noxcore/build/src/.libs/lt-nox_core)
> 2|nox|ERR:Cannot change the state of 'NOXSwitch' to INSTALLED:
> 'NOXSwitch' ran into an error:
> cannot import a Python module 'nox.coreapps.examples.NOXSwitch':
> Traceback (most recent call last):
>   File "./nox/coreapps/examples/NOXSwitch.py", line 37, in 
> from nox.netapps.monitoring.monitoring import Monitoring
>   File "./nox/netapps/monitoring/monitoring.py", line 33, in 
> from nox.coreapps.messenger.pyjsonmsgevent import JSONMsg_event
>   File "./nox/coreapps/messenger/pyjsonmsgevent.py", line 25, in 
> 
> _pyjsonmsgevent = swig_import_helper()
>   File "./nox/coreapps/messenger/pyjsonmsgevent.py", line 21, in 
> swig_import_helper
> _mod = imp.load_module('_pyjsonmsgevent', fp, pathname, 
> description)
> ImportError: ./nox/coreapps/messenger/_pyjsonmsgevent.so: undefined 
> symbol: vigil::JSONMsg_event::JSONMsg_event(vigil::core_message const*)
> 
> How do I correct this?
> 
> I am trying to follow this earlier thread: 
> http://noxrepo.org/pipermail/nox-dev/2011-November/008246.html
> 
> Thanks,
> 
> Dushyant
> ___
> 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


Re: [nox-dev] Regarding dpctl command and python scripts

2011-12-28 Thread Murphy McCauley
There are... I think at least three different dpctl programs (if you count 
ovs-dpctl), and I don't know which you're talking about.  These commands 
generally go with a specific OpenFlow switch (the reference OpenFlow 
implementation, Open vSwitch, etc.), so they aren't particularly related to 
NOX.  You might want to ask about them on the appropriate mailing list or 
whatever (maybe openflow-discuss?).

But at least in general, I think it's fair to say... dpctl is a command that 
works with a particular switch.  I don't think any of them actually *use 
OpenFlow* to configure the switch -- they use some other switch-specific 
method, and probably can't even administer a remote switch.

This contrasts with controllers that actually use OpenFlow to control a switch, 
like NOX.  Since OpenFlow is a standardized protocol, NOX can control any 
switch that implements OpenFlow.  Additionally, since OpenFlow works over TCP, 
NOX can control remote switches.  And finally... NOX is a platform for writing 
programs that communicate with switches bidirectionally and can implement 
relatively complex behaviors, not just execute simple commands like you would 
do with dpctl.

There is also at least one program which sort of straddles the line -- 
ovs-ofctl.  This tool is part of Open vSwitch, and uses OpenFlow to send 
commands, receive statistics, etc.  It is basically a very simple OpenFlow 
controller.  I don't have much experience with it, but it should be possible to 
use it to do simple configuration of any OpenFlow-compliant switch.

I hope that clears things up a bit.

-- Murphy

On Dec 28, 2011, at 4:45 PM, Vijay wrote:

> Hi, 
> 
> I am new to the openflow protocol and trying to learn. From the previous 
> posts, I get that to install a flow on to a openflow switch we can use our 
> own python scripts on NOX and do it. But, I also find there is dpctl command 
> to do it. If I want to install a flow from controller remotely, I can do it 
> using python scripts. Can I do the same using the dpctl command ?? If yes, 
> how ? What is the difference between doing it using dpctl and using scripts 
> on NOX ??
> 
> I would really appreciate any help.
> 
> Thanks,
> Vijay 
> ___
> 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


Re: [nox-dev] Openflow flowtable Cross comparsion

2011-12-23 Thread Murphy McCauley
Yes, you can do this.  Take a look at the OpenFlow 1.0 specification; 
specifically the ofp_stats_request message.

Basically, you send a stats request with the type set to OFPST_FLOW and the 
body as an ofp_flow_stats_request.  For the ofp_flow_stats_request, set the 
match to have all fields wildcarded.  The response will be an array of 
ofp_flow_stats messages describing all the flows in the table.

In Python, I think you can do this using your component's 
self.ctxt.send_stats_request() (see pycontext.cc) after using 
self.register_for_flow_stats_in() to register a handler.

Hope that helps.

-- Murphy

On Dec 23, 2011, at 2:39 AM, ali ahmad wrote:

> Hi, I am working on a topology in which multiple open-flow switches are 
> connected to a centralized NOX controller. I wish to cross compare flow table 
> from multiples open flow switches. Do openflow switch has the ability to send 
> its flowtable to controller or there is some easier way to do it .
> 
> Regards,
> Ali Ahmad
> ___
> 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


Re: [nox-dev] Running nox with a pcap file as input

2011-12-21 Thread Murphy McCauley
If I recall correctly, this is enabled or disabled automatically during 
configure based on whether the pcap header and/or library can be found.

On Ubuntu, you should be good if you have... I think it's libpcap-dev 
installed.  If you don't, please install it and then re-run configure.

If you have the appropriate package installed and it still doesn't work, check 
the output of configure to see if there's anything useful about pcap in there.

Hope that helps.

-- Murphy

On Dec 21, 2011, at 1:18 PM, Bharath Madhusudan wrote:

> I am just getting started with nox and before I throw real traffic at
> my setup, I would like to be able to use a pcap file as input.
> 
> When I try:
> 
> ./nox_core -i pcap:162.pcap:162.out
> 
> I get:
> 
> 1|openflow|ERR:pcap support not built in.  Ensure you have pcap
> installed and rebuild
> 
> Looking at the nox config files, its non-obvious to me how I would go
> about doing this
> 
> Thanks a lot in advance for anything anyone might have to say about this.
> 
> Regards, Bharath
> ___
> 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


Re: [nox-dev] Nox messenger example for external c++ and nox python

2011-12-21 Thread Murphy McCauley
No, the plain messenger is not exposed to Python.  Kyriakos and I did enough of 
the JSON messenger to get monitoring working, but never did the normal 
messenger.  The messenger.py should really be named messenger_client.py, and 
maybe shouldn't even be in that directory -- it's a library for writing 
messenger clients, and not a NOX component.

I've taken a quick stab at exposing the plain messenger to Python.  You can 
grab my current messenger directory from:
http://www.noxathome.org/x/Murphy/messenger/messenger.zip

Using it is very much like using jsonmessenger (as monitoring does).  Something 
like:

1) In your component's install function:
from nox.coreapps.messenger.pymsgevent import Msg_event
self.register_handler(Msg_event.static_get_name(), myHandler)

2) Implement a handler:
def myHandler (e):
  print e.type, e.body

3) Include pymessenger on the commandline or as a dependency

Messages for messenger are prefixed with a three byte header:
2 Byte Network Order Unsigned Integer:
  Message length (including header)
1 Byte:
  Message type (can be anything, but I think 0-9 are reserved -- see 
messenger.hh)


Hope that's useful.

-- Murphy

On Dec 21, 2011, at 2:46 AM, Harshil Anil Kumar Shah wrote:

> Thanks Murphy.
> I guess 2nd option is the better to go with.
> Can I use boost.python for that?
> And I guess plain messenger is exposed to python. There are messenger.py  and 
> messenger.cpp/hh files corresponding to plain messenger.
>  
> -Harshil
>  
> From: Murphy McCauley [mailto:jam...@nau.edu] 
> Sent: Wednesday, December 21, 2011 2:33 PM
> To: Harshil Anil Kumar Shah
> Cc: Kyriakos Zarifis; nox-dev@noxrepo.org
> Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python
>  
> So NOX's messenger is a fairly generic method for communicating with external 
> applications over a socket.  Built on top of this is jsonmessenger which 
> communicates JSON messages over a socket.
>  
> If you specifically want to use protobufs (and not JSON messages), then you'd 
> want to use the plain messenger.  However, the plain messenger is not exposed 
> to Python -- only jsonmessenger is.
>  
> So I think your options are:
> 1) Use JSON messages instead of protobufs, and just use jsonmessenger
> 2) Expose messenger to Python, and then use this to send/receive protobufs
> 3) Use protobufs and roll your own method for communicating with your 
> external application (probably using Twisted)
>  
> -- Murphy
>  
> On Dec 20, 2011, at 11:02 PM, Harshil Anil Kumar Shah wrote:
> 
> 
> Hi Murphy.
> Yes, I have external C++ module which I want to communicate with Nox python 
> module using protobuf. I am using libjson library at C++ module.
>  
> -Harshil.
>  
> From: Murphy McCauley [mailto:jam...@nau.edu] 
> Sent: Wednesday, December 21, 2011 1:38 AM
> To: Harshil Anil Kumar Shah
> Cc: Kyriakos Zarifis; nox-dev@noxrepo.org
> Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python
>  
> Do you mean that you have some external program (written in C++) that you 
> want to communicate with a NOX component (written in Python)?
>  
> jsonmessenger works by sending and receiving JSON (http://json.org) messages. 
>  So on the NOX side, you use jsonmessenger.  In the external program, you can 
> use any of several libraries for doing JSON encoding/decoding.
>  
> -- Murphy
>  
> On Dec 20, 2011, at 1:09 AM, Harshil Anil Kumar Shah wrote:
> 
> 
> 
> Hi,
> In my case where external module is C++ then can I use “pyobject” to interact 
> with python module?
>  
> From: Harshil Anil Kumar Shah 
> Sent: Monday, December 19, 2011 3:32 PM
> To: 'Kyriakos Zarifis'
> Cc: nox-dev@noxrepo.org
> Subject: RE: [nox-dev] Nox messenger example for external c++ and nox python
>  
> Thanks Zarifis…
>  
> I looked at GUI example. It seems very useful. But in my case, client is 
> external C++ module. So in that case do I have to use use messenger.cpp??
>  
> -Harshil.
>  
> From: nox-dev-boun...@noxrepo.org [mailto:nox-dev-boun...@noxrepo.org] On 
> Behalf Of Kyriakos Zarifis
> Sent: Monday, December 19, 2011 1:38 PM
> To: Harshil Anil Kumar Shah
> Cc: nox-dev@noxrepo.org
> Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python
>  
> Hi Harshil,
>  
> it might not be the simplest example, but the GUI communicates with NOX using 
> the messenger, so taking a look at that code might be a good starting point.
>  
> Specifically, the file communication.py is responsible on the GUI side. 
> Similarly on the NOX side, the code that uses the messenger to send messages 
> to the GUI is inside the respective component that talks to the GUI. The 
> component "monitoring&q

Re: [nox-dev] Nox messenger example for external c++ and nox python

2011-12-21 Thread Murphy McCauley
So NOX's messenger is a fairly generic method for communicating with external 
applications over a socket.  Built on top of this is jsonmessenger which 
communicates JSON messages over a socket.

If you specifically want to use protobufs (and not JSON messages), then you'd 
want to use the plain messenger.  However, the plain messenger is not exposed 
to Python -- only jsonmessenger is.

So I think your options are:
1) Use JSON messages instead of protobufs, and just use jsonmessenger
2) Expose messenger to Python, and then use this to send/receive protobufs
3) Use protobufs and roll your own method for communicating with your external 
application (probably using Twisted)

-- Murphy

On Dec 20, 2011, at 11:02 PM, Harshil Anil Kumar Shah wrote:

> Hi Murphy.
> Yes, I have external C++ module which I want to communicate with Nox python 
> module using protobuf. I am using libjson library at C++ module.
>  
> -Harshil.
>  
> From: Murphy McCauley [mailto:jam...@nau.edu] 
> Sent: Wednesday, December 21, 2011 1:38 AM
> To: Harshil Anil Kumar Shah
> Cc: Kyriakos Zarifis; nox-dev@noxrepo.org
> Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python
>  
> Do you mean that you have some external program (written in C++) that you 
> want to communicate with a NOX component (written in Python)?
>  
> jsonmessenger works by sending and receiving JSON (http://json.org) messages. 
>  So on the NOX side, you use jsonmessenger.  In the external program, you can 
> use any of several libraries for doing JSON encoding/decoding.
>  
> -- Murphy
>  
> On Dec 20, 2011, at 1:09 AM, Harshil Anil Kumar Shah wrote:
> 
> 
> Hi,
> In my case where external module is C++ then can I use “pyobject” to interact 
> with python module?
>  
> From: Harshil Anil Kumar Shah 
> Sent: Monday, December 19, 2011 3:32 PM
> To: 'Kyriakos Zarifis'
> Cc: nox-dev@noxrepo.org
> Subject: RE: [nox-dev] Nox messenger example for external c++ and nox python
>  
> Thanks Zarifis…
>  
> I looked at GUI example. It seems very useful. But in my case, client is 
> external C++ module. So in that case do I have to use use messenger.cpp??
>  
> -Harshil.
>  
> From: nox-dev-boun...@noxrepo.org [mailto:nox-dev-boun...@noxrepo.org] On 
> Behalf Of Kyriakos Zarifis
> Sent: Monday, December 19, 2011 1:38 PM
> To: Harshil Anil Kumar Shah
> Cc: nox-dev@noxrepo.org
> Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python
>  
> Hi Harshil,
>  
> it might not be the simplest example, but the GUI communicates with NOX using 
> the messenger, so taking a look at that code might be a good starting point.
>  
> Specifically, the file communication.py is responsible on the GUI side. 
> Similarly on the NOX side, the code that uses the messenger to send messages 
> to the GUI is inside the respective component that talks to the GUI. The 
> component "monitoring" is one of them.
> 
> Some of this is documented on the wiki here:
> http://noxrepo.org/noxwiki/index.php/NOX_GUI#Connecting_a_subview_to_a_NOX_component
> 
> On Sun, Dec 18, 2011 at 10:41 PM, Harshil Anil Kumar Shah 
>  wrote:
> Hi,
>  
> I want to exchange messages between external C++ module and python module  in 
> Nox using protobuf messages. I browsed through couple of posts, I figured out 
> I can  use coreapps/messenger. Can I get some working example how messenger 
> code can be used for message exchange between external c++ and nox python 
> module.
>  
> Regards,
> Harshil Shah,
> Convergence Lab, Infosys Labs
> Infosys | Bangalore
> Mob # : +91 97428 87966.
>  
>  CAUTION - Disclaimer *
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
> for the use of the addressee(s). If you are not the intended recipient, 
> please 
> notify the sender by e-mail and delete the original message. Further, you are 
> not 
> to copy, disclose, or distribute this e-mail or its contents to any other 
> person and 
> any such actions are unlawful. This e-mail may contain viruses. Infosys has 
> taken 
> every reasonable precaution to minimize this risk, but is not liable for any 
> damage 
> you may sustain as a result of any virus in this e-mail. You should carry out 
> your 
> own virus checks before opening the e-mail or attachment. Infosys reserves 
> the 
> right to monitor and review the content of all messages sent to or from this 
> e-mail 
> address. Messages sent to or from this e-mail address may be stored on the 
> Infosys e-mail system.
> ***INFOSYS End of Disclaimer INFOSYS***
> 
> ___
> nox-dev mailing list
> nox-dev@nox

Re: [nox-dev] NOX UnicodeDecodeError in nox/coreapps/pyrt/pyoxidereactor.py

2011-12-20 Thread Murphy McCauley
It looks like some Python component is trying to log something unprintable. Is 
your prrt module in Python?  Does it do any logging?

Is that the full stack trace that you pasted?  It'd be nice to see where emit() 
was being called from.

If you just want a quick fix, you could try just commenting out lines 337-339 
in pyrt.  But if this is happening because of something in monitoring or 
spanning_tree, I'd like to understand the problem better so that we could fix 
it.

-- Murphy

On Dec 20, 2011, at 4:50 AM, Bernd Wittefeld wrote:

> Hi,
> I have another problem with my NOX installation. When I start it using
> 
> ./nox_core -i ptcp:6633 spanning_tree switch prrt monitoring
> 
> it worked flawlessly all the time with the standard openflow switch from 
> openflow.org in my old environment. Now I have moved to a new environment 
> using an exact copy of the previous setup only with vmware installations, I 
> have the following problem appearing in the NOX logs:
> 
> Traceback (most recent call last):
>  File "./nox/coreapps/pyrt/pyoxidereactor.py", line 339, in emit
>msg = unicode(msg, 'utf-8')
> UnicodeDecodeError: 'utf8' codec can't decode bytes in position 127-129: 
> invalid data
> 
> prrt is a module that I am currently working on. It does nothing with pyrt 
> and stuff. Currently only gathering information from discovery and filling 
> some datastructures.
> Does anyone know where this can come from? Do I miss some dependencies upon 
> installation? It seems like NOX cannot understand the data it gets from a 
> switch?!
> I have checked the configure scripts for dependencies and searched the web 
> but could not find anything useful on this.
> 
> Thanks in advance!
> Bernd
> ___
> 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


Re: [nox-dev] Nox messenger example for external c++ and nox python

2011-12-20 Thread Murphy McCauley
Do you mean that you have some external program (written in C++) that you want 
to communicate with a NOX component (written in Python)?

jsonmessenger works by sending and receiving JSON (http://json.org) messages.  
So on the NOX side, you use jsonmessenger.  In the external program, you can 
use any of several libraries for doing JSON encoding/decoding.

-- Murphy

On Dec 20, 2011, at 1:09 AM, Harshil Anil Kumar Shah wrote:

> Hi,
> In my case where external module is C++ then can I use “pyobject” to interact 
> with python module?
>  
> From: Harshil Anil Kumar Shah 
> Sent: Monday, December 19, 2011 3:32 PM
> To: 'Kyriakos Zarifis'
> Cc: nox-dev@noxrepo.org
> Subject: RE: [nox-dev] Nox messenger example for external c++ and nox python
>  
> Thanks Zarifis…
>  
> I looked at GUI example. It seems very useful. But in my case, client is 
> external C++ module. So in that case do I have to use use messenger.cpp??
>  
> -Harshil.
>  
> From: nox-dev-boun...@noxrepo.org [mailto:nox-dev-boun...@noxrepo.org] On 
> Behalf Of Kyriakos Zarifis
> Sent: Monday, December 19, 2011 1:38 PM
> To: Harshil Anil Kumar Shah
> Cc: nox-dev@noxrepo.org
> Subject: Re: [nox-dev] Nox messenger example for external c++ and nox python
>  
> Hi Harshil,
>  
> it might not be the simplest example, but the GUI communicates with NOX using 
> the messenger, so taking a look at that code might be a good starting point.
>  
> Specifically, the file communication.py is responsible on the GUI side. 
> Similarly on the NOX side, the code that uses the messenger to send messages 
> to the GUI is inside the respective component that talks to the GUI. The 
> component "monitoring" is one of them.
> 
> Some of this is documented on the wiki here:
> http://noxrepo.org/noxwiki/index.php/NOX_GUI#Connecting_a_subview_to_a_NOX_component
> 
> On Sun, Dec 18, 2011 at 10:41 PM, Harshil Anil Kumar Shah 
>  wrote:
> Hi,
>  
> I want to exchange messages between external C++ module and python module  in 
> Nox using protobuf messages. I browsed through couple of posts, I figured out 
> I can  use coreapps/messenger. Can I get some working example how messenger 
> code can be used for message exchange between external c++ and nox python 
> module.
>  
> Regards,
> Harshil Shah,
> Convergence Lab, Infosys Labs
> Infosys | Bangalore
> Mob # : +91 97428 87966.
>  
>  CAUTION - Disclaimer *
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
> for the use of the addressee(s). If you are not the intended recipient, 
> please 
> notify the sender by e-mail and delete the original message. Further, you are 
> not 
> to copy, disclose, or distribute this e-mail or its contents to any other 
> person and 
> any such actions are unlawful. This e-mail may contain viruses. Infosys has 
> taken 
> every reasonable precaution to minimize this risk, but is not liable for any 
> damage 
> you may sustain as a result of any virus in this e-mail. You should carry out 
> your 
> own virus checks before opening the e-mail or attachment. Infosys reserves 
> the 
> right to monitor and review the content of all messages sent to or from this 
> e-mail 
> address. Messages sent to or from this e-mail address may be stored on the 
> Infosys e-mail system.
> ***INFOSYS End of Disclaimer INFOSYS***
> 
> ___
> 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


Re: [nox-dev] NOX for windows

2011-12-20 Thread Murphy McCauley
Sorry, but I'm not aware of anyone ever trying to get NOX running on Windows.  
I wouldn't take a guess at how much work might be involved.

-- Murphy

On Dec 20, 2011, at 5:00 AM, Sheili Mittal wrote:

> Hi,
>  
> I am new to NOX. Anyone confirm me whether NOX supported Windows also?
> From where I can download NOX for Window 7
>  
> Regards,
> Sheili
> DISCLAIMER: 
> ---
>  
> The contents of this e-mail and any attachment(s) are confidential and
> intended 
> for the named recipient(s) only.  
> It shall not attach any liability on the originator or NECHCL or its 
> affiliates. Any views or opinions presented in  
> this email are solely those of the author and may not necessarily reflect the 
> opinions of NECHCL or its affiliates.  
> Any form of reproduction, dissemination, copying, disclosure, modification, 
> distribution and / or publication of  
> this message without the prior written consent of the author of this e-mail 
> is 
> strictly prohibited. If you have  
> received this email in error please delete it and notify the sender 
> immediately. . 
> ---
> ___
> 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


Re: [nox-dev] error in "flowtracer" component

2011-12-20 Thread Murphy McCauley
flowtracer should have jsonmessenger as a dependency, but doesn't.

Either edit flowtracer's meta.json file to add jsonmessenger as a dependency, 
or simply specify jsonmessenger on the commandline before flowtracer (e.g., 
nox_core jsonmessenger flowtracer).

Hope that helps.

-- Murphy

On Dec 20, 2011, at 1:40 AM, Siddharth Sharma wrote:

> Hi,
> 
> The flowtracer component in NOX controller is not working. When I try to 
> run the component, it shows me the following error : 
> 
> 
> 
> 00073|nox|ERR:Cannot change the state of 'flowtracer' to INSTALLED:
> 'flowtracer' ran into an error: 
> cannot import a Python module 'nox.netapps.flowtracer.flowtracer':
> Traceback (most recent call last):
>   File "./nox/netapps/flowtracer/flowtracer.py", line 12, in 
> from nox.coreapps.messenger.pyjsonmsgevent import JSONMsg_event
>   File "./nox/coreapps/messenger/pyjsonmsgevent.py", line 25, in 
> _pyjsonmsgevent = swig_import_helper()
>   File "./nox/coreapps/messenger/pyjsonmsgevent.py", line 21, in 
> swig_import_helper
> _mod = imp.load_module('_pyjsonmsgevent', fp, pathname, description)
> ImportError: ./nox/coreapps/messenger/_pyjsonmsgevent.so: undefined 
> symbol: vigil::JSONMsg_event::JSONMsg_event(vigil::core_message const*)
> 
> 
> 
> 
> Please rectify the problem.
> 
> Thank You
> 
> Regards
> Siddharth
> ___
> 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


Re: [nox-dev] Generating doxygen documentation

2011-12-19 Thread Murphy McCauley
Are you sure you're in build/doc/doxygen and not just doc/doxygen?

-- Murphy

On Dec 19, 2011, at 12:28 PM, Guy A wrote:

> Thanks for replying. I tried those steps but after make html I get error:
> make: *** No rule to make target 'html'. Stop.
> 
> I don't think it should affect anything but I'm using the NOX installation 
> provided in the OpenFlow tutorial.
> 
> Thanks,
> Guy
> 
> Subject: Re: [nox-dev] Generating doxygen documentation
> From: jam...@nau.edu
> Date: Sat, 17 Dec 2011 13:19:57 -0800
> CC: nox-dev@noxrepo.org
> To: guy_...@hotmail.com
> 
> This is from memory, but it should be more or less...
> 
> Start as usual:
> ./boot.sh
> mkdir build
> cd build
> ../configure
> 
> And now to build the HTML docs:
> cd doc/doxygen
> make html
> 
> Give that a shot. :)
> 
> -- Murphy
> 
> On Dec 16, 2011, at 4:42 PM, Guy A wrote:
> 
> Hi,
>  
> I'm have problems generating the doxygen documentation. I've searched around 
> for the proper steps but couldn't find anything.
>  
> I tried:
> cd doc/doxygen
> make html
>  
> But get error:
> make: *** No rule to make target 'html'. Stop.
> 
> I also tried editing nox/build/doc/doxygen/doxygen.conf.in and changed line
> GENERATE_HTML  = NO
> to
> GENERATE_HTML  = YES
> Then, in the same folder ran 'doxygen doxygen.conf.in'
>  
> But get error:
> error: tag HTML_HEADER: header file '@srcdir@/header.html' does not exist
>  
> How do I set @srcdir@? Am I missing a step here?
> 
> So far I have been using http://noxrepo.org/~yapkke/doc/index.html but this 
> may be out dated.
> 
> Thanks,
> Guy
> ___
> 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


Re: [nox-dev] Generate traffic

2011-12-18 Thread Murphy McCauley
On Dec 18, 2011, at 11:52 AM, Walid van Boetzelaer wrote:

> Openflow does maintain counters for each flow table, and these counters have 
> the number of received packets per port, etc... How can I retrieve these?

At the OpenFlow level, you do this by sending an ofp_port_stats_request asking 
for stats of type OFPST_PORT.  You'll get back a response of ofp_port_stats 
which contains byte and packet counters for the port.

The easiest way to do this from Python in NOX is using component's 
register_for_port_stats_in() to set a callback for port stats messages, and 
then using pycontext's send_port_stats_request() to send an actual request.  
(From inside your component, I think these are 
self.register_for_port_stats_in() and self.ctxt.send_port_stats_request().)

Alternatively, the switchstats or monitoring components may do what you need.

Hope that helps.

-- Murphy
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] Getting switch statistics

2011-12-18 Thread Murphy McCauley
resolve(switchstats) is probably failing because the switchstats component is 
not loaded.  You should either put "switchstats" on the commandline *before* 
your component, or (better yet) add switchstats as a dependency of your 
component in your component's meta.json.

Hopefully that will fix it for you.

-- Murphy

On Dec 17, 2011, at 5:19 PM, Walid van Boetzelaer wrote:

> Hello,
> 
> I am trying to pass switch statistics to another component. The final goal is 
> to be able to use the bandwidth and latency between two switches. I would 
> like to use switchstats, which, as far as I understand delivers the functions 
> closest to what I need.
> 
> I am however not sure how to add a port listener. I tried to have 
> 
> add_port_listener() in the install() function of my component, but it says it 
> is not defined(i do import * from nox.netapps.switchstats .)
> 
> I tried to use resolve(switchstats), no chance at that either.
> 
> One error i got is the following:
> 
>   cannot import a Python module 'nox.coreapps.examples.stats':
>   Traceback (most recent call last):
> File "./nox/coreapps/examples/stats.py", line 22, in 
>   from nox.netapps.switchstats.switchstats import *
> File "./nox/netapps/switchstats/switchstats.py", line 27, in 
> 
>   from nox.netapps.switchstats.pycswitchstats import 
> pycswitchstats
> File "./nox/netapps/switchstats/pycswitchstats.py", line 25, 
> in 
>   _pycswitchstats = swig_import_helper()
> File "./nox/netapps/switchstats/pycswitchstats.py", line 21, 
> in swig_import_helper
>   _mod = imp.load_module('_pycswitchstats', fp, pathname, 
> description)
>   ImportError: ./nox/netapps/switchstats/_pycswitchstats.so: 
> undefined symbol: 
> vigil::applications::CSwitchStats::get_loc_conn_p_s(unsigned long long)
>   
> 
> 
> I would be very grateful if someone would point me in the right direction. 
> I'm not too experienced in this kind of coding, i need to get something done 
> soon, and i'm struggling, to be honest.
> 
> Thank you in advance for your help and best regards,
> 
> Walid van Boetzelaer
> 
> 
> 
> ___
> 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


Re: [nox-dev] Generating doxygen documentation

2011-12-17 Thread Murphy McCauley
This is from memory, but it should be more or less...

Start as usual:
./boot.sh
mkdir build
cd build
../configure

And now to build the HTML docs:
cd doc/doxygen
make html

Give that a shot. :)

-- Murphy

On Dec 16, 2011, at 4:42 PM, Guy A wrote:

> Hi,
>  
> I'm have problems generating the doxygen documentation. I've searched around 
> for the proper steps but couldn't find anything.
>  
> I tried:
> cd doc/doxygen
> make html
>  
> But get error:
> make: *** No rule to make target 'html'. Stop.
> 
> I also tried editing nox/build/doc/doxygen/doxygen.conf.in and changed line
> GENERATE_HTML  = NO
> to
> GENERATE_HTML  = YES
> Then, in the same folder ran 'doxygen doxygen.conf.in'
>  
> But get error:
> error: tag HTML_HEADER: header file '@srcdir@/header.html' does not exist
>  
> How do I set @srcdir@? Am I missing a step here?
> 
> So far I have been using http://noxrepo.org/~yapkke/doc/index.html but this 
> may be out dated.
> 
> Thanks,
> Guy
> ___
> 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


Re: [nox-dev] meta.json syntax and importing files in Python

2011-12-16 Thread Murphy McCauley
Some of this is at least lightly documented on the wiki:
http://noxrepo.org/noxwiki/index.php/Developing_in_NOX

(Please feel free to extend it!)


There's a bit more info about the meta files in the FAQ:
http://noxrepo.org/noxwiki/index.php/FAQ#Where_can_I_see_and_edit_the_code_that_corresponds_to_different_NOX_components.3F


Really quickly and informally, the meta files (formerly meta.xml, now 
meta.json) are what really specify a NOX component.  Specifically, they:
1. Define a component name ("name" key).  These are the names that, for 
example, can be specified on the nox_core commandline.
2. Specify which code corresponds to a component ("library" and "python" keys). 
 A component may be a shared library or a Python module or both.  NOX will load 
the specified library/module, and execute a factory in order to get an actual 
component instance (the mechanism for this is somewhat different in Python and 
in C++).  You only need to specify the library/module where this factory comes 
from.
3. Specify dependencies ("dependencies" key).  This is a list of other 
components which this component relies on.  NOX will attempt to load these 
automatically.


Hope that helps.

-- Murphy

On Dec 16, 2011, at 7:40 AM, Bernd Wittefeld wrote:

> Hi,
> it's me again :)
> I was able to import my python files. They needed to be added to the 
> NOX_RUNTIMEFILES and EXTRA_DIST in my Makefile.am, so that the links from the 
> build directory were established.
> So that problem is solved, but I would love to have some docs about those 
> meta.json files.
> 
> Greetings
> Bernd
> 
> 
> On 16.12.2011 16:03, Bernd Wittefeld wrote:
>> Hi,
>> I'm am wondering about the syntax and sematic of the meta.json files. I 
>> cannot find anything about it in the wiki and the mailinglists.
>> 
>> The problem is a fairly easy one: I have written a python component and 
>> splitted it up in several files, but I cannot import those files. I tried 
>> various permutations of the import statement and nothing worked.
>> Can you give me a hint where I can find valuable information about the NOX 
>> build system? Do I have to add my *.py files (which I only want to use in my 
>> component) to Makefile.am and meta.json?
>> 
>> Thanks in advance
>> 
>> Bernd
>> ___
>> 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


Re: [nox-dev] Not able to send ARP Reply in C++

2011-12-15 Thread Murphy McCauley
Glad you got it working; I had missed yeffri's reply.

-- Murphy

On Dec 15, 2011, at 8:26 PM, Kimihiko FUKAMI wrote:

> I am sorry for replying this thread late.
> 
> And I sent a reply only to yeffri.
> 
> At first, I successed to send an ARP reply in C++. yeffri's code 
> helps me very much!
> 
> But yeffri's code can send an ARP request, so I wrote the code 
> to send an ARP reply. The code is below.
> 
> To yeffri and Murphy, thank you very much !!
> 
> Kimihiko FUKAMI
> 
> === code 1 ===
> 
> Disposition Switch::handle(const Event& e){
>const Packet_in_event& pi = assert_cast(e);
>uint32_t buffer_id = pi.buffer_id;
>Flow flow(pi.in_port, *pi.get_buffer());
>stringstream out, out2;
>ipaddr ipsrc(ntohl(flow.nw_src));
>ipaddr ipdst(ntohl(flow.nw_dst));
>string tp_src;
>string tp_dst;
>ipaddr globalgwaddr(LB_IP);
>ipaddr privategwaddr(GATEWAY_IP);
> 
>if (flow.dl_type == ethernet::ARP){
>  Nonowning_buffer b(*pi.get_buffer());
>  const arp_eth_header* arp = NULL;
>  const eth_header* eth = b.try_pull();
> 
>  if (b.size() >= ARP_ETH_HEADER_LEN) {
>arp = reinterpret_cast arp_eth_header*>(b.try_pull(ARP_ETH_HEADER_\
> LEN));
>  }else {
>return CONTINUE;
>  }
> 
>  if (arp->ar_op == arp::REQUEST){
>if (ipdst.string() == GATEWAY_IP){
>  ethernetaddr senderMAC(arptable[GATEWAY_IP]);
>  ethernetaddr targetMAC(flow.dl_src.string().c_str());
> 
>  sendARPReply(pi.datapath_id, pi.in_port, senderMAC, 
> privategwaddr.addr\
> , targetMAC, ipsrc.addr);
>}
> }
> 
> =
> 
> sendARPReply function code is below.
> 
> ==
> void Switch::sendARPReply(datapathid dpid, int port, ethernetaddr senderMAC, 
> u\
> int32_t senderIP, ethernetaddr targetMAC, uint32_t targetIP)
>  {
>ethernet ethPacket;
>arp arpPacket;
> 
>ethPacket.daddr = targetMAC;
>ethPacket.saddr = senderMAC;
>ethPacket.type = ethernet::ARP;
> 
>arpPacket.hrd = arp::ETHER;
>arpPacket.pro = ethernet::IP;
>arpPacket.hln = ethernet::PAYLOAD_MIN;  //6 for ethernet
>arpPacket.pln = sizeof(targetIP);   //4 for IPV4
>arpPacket.sha = senderMAC;
>arpPacket.sip = senderIP;
>arpPacket.tha = targetMAC;
>arpPacket.tip = targetIP;
>arpPacket.op  = arp::REPLY;
> 
>int size = sizeof(ethernet) + sizeof(arp);
>uint8_t *data = new uint8_t[size];
> 
>memcpy(data, ðPacket, sizeof(ethPacket));
>memcpy(data + sizeof(ethPacket), &arpPacket, sizeof(arpPacket));
>Array_buffer buffer(data,size);  // data will be deleted automatically
> 
>send_openflow_packet(dpid, buffer, port, OFPP_LOCAL, true);  }
> }
> 
> === end ===
> 
> Murphy McCauley  wrote:
> 
>> First, I'd suggest that you install a flow to send all appropriate ARP 
>> messages to the controller.
>> 
>> Second, use the packet in event to examine the ARP request.  The data that 
>> you need is all on the event object (specifically, the "buf" field of the 
>> Ofp_msg_event class contains the raw packet data, which you can parse as an 
>> ARP request).
>> 
>> Third, build an ARP reply based on the request.  Send this data using one of 
>> the packet sending functions (e.g., send_openflow_packet()).
>> 
>> 
>> Have you considered writing this as a Python application first?
>> 
>> 
>> Hope that helps.
>> 
>> -- Murphy
>> 
>> On Nov 30, 2011, at 12:15 AM, Kimihiko FUKAMI wrote:
>> 
>>> Hi,Murphy!
>>> 
>>> Thank you for your reply!
>>> 
>>> I look at arp.hh source code. But, my question is not addressed.
>>> 
>>> I forgot to tell you the code I want to write...
>>> 
>>> The code is NAT program. In the NAT, the condition is that arp 
>>> reply should be addressed.
>>> 
>>> I examined which api to send arp reply by using of Nox(zaku) in 
>>> C++, and I get a hint from attached Nox sample code "switch.cc".
>>> The hint is Packet_in_event...
>>> 
>>> Then I want to tell you how to get packet data from Packet_in_event
>>> instance. Please give me a hint!
>>> 
>>> 
>>> Murphy McCauley  wrote:
>>> 
>>>> I don't think I've ever used it, but have you taken a look at 
>>>> include/netinet++/arp.hh?
>>>> 
>>>> -- Murphy
>>>> 
>>>> On Nov 25, 2011, at 1:54 AM, Kimihiko FUKAMI wrote:
>>>> 
&

Re: [nox-dev] Running Error on nox.json

2011-12-15 Thread Murphy McCauley
I suspect you're not running nox_core from the src directory (build/src).  Try 
that.

You can also run it by specifying a configuration file (src/nox_core -c 
src/etc/nox.json I think), but you'd also need to specify the directories for 
components.

Hope that helps.

-- Murphy

On Dec 15, 2011, at 4:39 PM, Peng Sun wrote:

> Hi Murphy, 
> 
> I followed the steps in NOX wiki. 
> 
> I installed NOX 0.9.0 (zaku) on a VM with Ubuntu 11.04  (Linux 2.6.38). 
> 
> I first installed the dependencies with apt-get, then took the steps:
> ./boot.sh
> mkdir build
> cd build
> ../configure
> make -j 5
> 
> The compilation finished successfully. But when I launched nox_core, it exits 
> with error:
> 
> NOX 0.9.0(zaku)~full~beta (nox_core), compiled Dec 16 2011 00:43:32
> Compiled with OpenFlow 0x01 
> ERR: Unable to find a configuration file. Checked the following locations:
>  -> /usr/local/etc/nox/nox.json
>  -> etc/nox.json
> 
> 
> 
> 
> Peng
> 
> 
> On Thu, Dec 15, 2011 at 5:50 PM, Murphy McCauley  wrote:
> Hi; maybe you can provide a bit more information.
> 
> What OS/version are you running on?  What steps did you use to configure, 
> build, and run NOX?
> 
> -- Murphy
> 
> On Dec 15, 2011, at 2:45 PM, Peng Sun wrote:
> 
> > Hi,
> >
> > I encountered an error when running NOX. The error is:
> >
> > ERR: Unable to find a configuration file. Checked the following locations:
> >  -> /usr/local/etc/nox/nox.json
> >  -> etc/nox.json
> >
> > The compilation is successful... Does anybody know how to solve the problem?
> >
> > Thanks.
> >
> >
> >
> >
> >
> > Peng
> > ___
> > 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


Re: [nox-dev] Not able to send ARP Reply in C++

2011-12-15 Thread Murphy McCauley
First, I'd suggest that you install a flow to send all appropriate ARP messages 
to the controller.

Second, use the packet in event to examine the ARP request.  The data that you 
need is all on the event object (specifically, the "buf" field of the 
Ofp_msg_event class contains the raw packet data, which you can parse as an ARP 
request).

Third, build an ARP reply based on the request.  Send this data using one of 
the packet sending functions (e.g., send_openflow_packet()).


Have you considered writing this as a Python application first?


Hope that helps.

-- Murphy

On Nov 30, 2011, at 12:15 AM, Kimihiko FUKAMI wrote:

> Hi,Murphy!
> 
> Thank you for your reply!
> 
> I look at arp.hh source code. But, my question is not addressed.
> 
> I forgot to tell you the code I want to write...
> 
> The code is NAT program. In the NAT, the condition is that arp 
> reply should be addressed.
> 
> I examined which api to send arp reply by using of Nox(zaku) in 
> C++, and I get a hint from attached Nox sample code "switch.cc".
> The hint is Packet_in_event...
> 
> Then I want to tell you how to get packet data from Packet_in_event
> instance. Please give me a hint!
> 
> 
> Murphy McCauley  wrote:
> 
>> I don't think I've ever used it, but have you taken a look at 
>> include/netinet++/arp.hh?
>> 
>> -- Murphy
>> 
>> On Nov 25, 2011, at 1:54 AM, Kimihiko FUKAMI wrote:
>> 
>>> Hi,
>>> 
>>> Currently, I can not send an ARP Reply by using of Nox(zaku) in 
>>> C++ code. 
>>> 
>>> # I can write a code to reply ARP in python. 
>>> 
>>> So, I want a code sample to send ARP Reply in C++.
>>> 
>>> Please teach me!
>>> 
>>> ---
>>> E-mail: fukami.kimih...@lab.ntt.co.jp
>>> 
>>> ___
>>> nox-dev mailing list
>>> nox-dev@noxrepo.org
>>> http://noxrepo.org/mailman/listinfo/nox-dev
> 
> 
> ---
> 深見 公彦 (Kimihiko FUKAMI)  TEL:0422-59-2475 
> NTT 情報流通プラットホーム研究所
> ネットワークセキュリティプロジェクト
> E-mail: fukami.kimih...@lab.ntt.co.jp
> 

___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] how to display network topology timely

2011-12-15 Thread Murphy McCauley
The fundamental problem here is that there's no always-applicable way to know 
when a host leaves.

The only mechanism used in NOX now is a timeout.  You could adjust this timeout 
-- the best value for it depends on how talkative your hosts are.

You might also extend the host tracker to watch the link state, but that only 
works in some scenarios.

I have also suggested that we track hosts by periodically ARP-pinging them, 
though I don't think anyone has ever actually implemented this.

Hope that helps.

-- Murphy

On Dec 1, 2011, at 11:29 PM, 王健 wrote:

> Hi all:
>   I have a question to consult you. The NOX GUI can display a whole 
> network topology when run the command: ./nox_core -v -v -i ptcp:6633 
> monitoring discovery topology trackhost_pktin. But it cann't update timely 
> when a host leave from network, in other words, the host is still in the 
> network topology which you can see in NOX GUI. I think it may be lack of some 
> component when run the command, am i right? Which one to be used and how to 
> get it? would you like to tell me, thank you very much~
> Best Wishes
>   
>  
>   
>   
> Wang Jian
>   
>Friday, 
> December 2,2011
> 
> 
> At 2011-11-29 03:01:56,"Murphy McCauley"  wrote:
> I think the attachment is being scrubbed. Maybe you can send an image?
> 
> Though offhand, I don't know what I can tell you.  What do mean by 
> unreachable?  Devices connected to the netfpga switch can't ping devices 
> connected to the openwrt switch?  What NOX components are you running?
> 
> -- Murphy
> 
> On Nov 25, 2011, at 12:09 AM, 王健 wrote:
> 
>> Hi Murphy:
>>  Thank you for your last reply , your suggest is right. Recently i built 
>> a openflow network,you can see the topology in the attachment. The 
>> connection between openflow switch(netfpga) and openwrt(openflow wireless) 
>> is unreachable, i mark it in blue. What's wrong with it, would you like to 
>> give me some advice for solving this problem,thank you very much! if there 
>> is something else you want to know, please tell me.
>> Best Wishes
>>  
>> &n bsp;Wang Jian
>>  
>> Friday, November 25, 2011   
>>  
>> 
>> 
>> 
> 
> 
> 
> ___
> 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


Re: [nox-dev] Watch inside the IP Option field with Openflow

2011-12-15 Thread Murphy McCauley
Well, this depends on what you mean.  There is no way in the OpenFlow 1.0 spec 
to have matches against an IP option.

However, if you are installing exact-match flows for TCP or UDP connections and 
the first packet of the connection will have the option set, then you may be 
able to do what you want.  The first packet of a connection will be sent up to 
the controller.  The controller can then inspect the header to see if your 
option is set, and can install an exact match flow that modifies the 
destination address.

If *only* the first packets of the connection will have the option set, then 
you will have to do a little extra work to deal with the case where the flow 
times out on the switch before the connection is actually dead.  (That is, the 
controller will need to remember the connections it wants rewritten.)

Hope that helps.

-- Murphy

On Dec 2, 2011, at 5:50 AM, Hyogi Jung wrote:

> Hi all.
> 
> I am trying to do some experiments with Openflow.
> And I would like to know 
> if it is possible to watch inside the IP Header Option field?
> 
> There is ip header length. So I can find that there is header option.
> But How do I watch inside the IP Header Option?
> If I read the IP option something like 'x.x.x.x', then I will modify 
> destination's address.
> Can I do this in nox controller?
> 
> Thank you! Hope you could help me
> 
> - Hyogi
> ___
> 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


Re: [nox-dev] Running Error on nox.json

2011-12-15 Thread Murphy McCauley
Hi; maybe you can provide a bit more information.

What OS/version are you running on?  What steps did you use to configure, 
build, and run NOX?

-- Murphy

On Dec 15, 2011, at 2:45 PM, Peng Sun wrote:

> Hi, 
> 
> I encountered an error when running NOX. The error is: 
> 
> ERR: Unable to find a configuration file. Checked the following locations:
>  -> /usr/local/etc/nox/nox.json
>  -> etc/nox.json
> 
> The compilation is successful... Does anybody know how to solve the problem? 
> 
> Thanks. 
> 
> 
> 
> 
> 
> Peng
> ___
> 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


Re: [nox-dev] what is the difference between pyswitch and routing module?

2011-12-15 Thread Murphy McCauley
No.  The situation is as I described -- the routing module is really more like 
a network-wide L2 switch than anything else.

It's possible to implement some L3 routing functionality in NOX as Srini 
mentions in the referenced email.  However, there's at least one thing that IP 
routers do which can't be done reasonably within the OpenFlow 1.0 specification 
-- decrement the TTL.

-- Murphy

On Dec 12, 2011, at 11:59 PM, linbo wrote:

> Hi,Murphy!
> I remember there was an earlier thread:
> http://noxrepo.org/pipermail/nox-dev/2011-April/007494.html
>  
> It said that nox couldn't support conventional IP routing before,so does the 
> routing module making nox as a IP router now?
> Thank you!
> linbo
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] how to add flow through NOX

2011-12-12 Thread Murphy McCauley
There's no simple "manual" way to add a flow using NOX -- you must write code 
in C++ or Python to add flows.  However, you could certainly write a NOX 
component that accepts user input and uses it to add flows.

Hope that helps.

-- Murphy

On Dec 12, 2011, at 10:48 AM, Shan Hu wrote:

> Hi All,
> 
> I want to ask if there is a way to manually add flow through NOX controller? 
> For now i only know that i can add flow with
> command "./ovs-ofctl add-flow ..." and apparently it runs on openvswitch and 
> has nothing to do with controller.
> 
> Regards,
> Shan
> ___
> 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


Re: [nox-dev] error in programming flow

2011-12-12 Thread Murphy McCauley
This is an error message from the switch.  I believe type 2 code 4 is from a 
bad output port on an action, but you can refer to the OpenFlow 1.0 
specification to be sure.

--  Murphy

On Dec 12, 2011, at 6:04 AM, Beeram, Suresh KumarReddy wrote:

> Hi all,
> I tried to program flow on switch using nox controller API 
> “send_openflow_command(…)” controller throws error code as
>  
> 00099|openflow-event|ERR:received Openflow error packet from 
> dpid=a0024a8d74840: type=2, code=4, 64 bytes of data
>  
> Can  anyone explain me how to debug this error?
>  
> Thanks
> -B Suresh Kumar Reddy
>  
> ___
> 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


Re: [nox-dev] error compiling...

2011-12-07 Thread Murphy McCauley
What platform are you trying to compile on, and which branch of NOX?  Have you 
tried the destiny branch?

-- Murphy

On Dec 7, 2011, at 1:39 AM, Prashanth Prahalad wrote:

> 
> Just getting started with nox controller.
> 
> During compilation (make -j 5) I'm seeing this error :
> 
> ../../src/nox_main.cc: In function ‘int::start_gui()’:
> ../../src/nox_main.cc:231: warning: deprecated conversion from string 
> constant to ‘char*’
> ../../src/nox_main.cc: In function ‘int main(int, char**)’:
> ../../src/nox_main.cc:532: error: ‘EventDispatcherComponentinstall’ was not 
> declared in this scope
> ../../src/nox_main.cc:532: error: expected ‘)’ before ‘;’ token
> ../../src/nox_main.cc:532: error: expected primary-expression before ‘)’ token
> ../../src/nox_main.cc:532: error: expected ‘;’ before ‘)’ token
> make[2]: *** [nox_main.o] Error 1
> 
> 
> Any ideas what's causing this ? 
> 
> Thanks !
> 
> 
> ___
> 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


Re: [nox-dev] does openflow dedicated switch surpport layer 3 processing

2011-12-05 Thread Murphy McCauley
Responses inline.

On Dec 5, 2011, at 6:42 PM, 王健 wrote:

> Hi Murphy:
> I am confused about a question about OpenFlow dedicated switch for a long 
> time.The following is my testing network topology:
>   <截图4.png>
> PC1 and PC2 can ping each other successfully if they have the same net id, 
> and can't ping successfully if they don't.

I assume you mean if they're on the same subnet?

> Does OpenFlow dedicated switch only surpport layer 2 processing when run the 
> command : nox_core -v -i ptcp:6633 discovery topology authenticator routing?

Well, routing tries to install exact match flows whenever possible, if I recall 
correctly.  This includes L3 headers too when possible.  But it's not exactly 
L3 *processing*.

> I think it has no ability of forwarding if disconnects to NOX.

There are things that can be done to help with communication when NOX is 
disconnected, but none of them are done here.  Certainly the usual model is 
that your controller stays connected to your switches.

> I just want to know how to achieve layer 3 processing with OpenFlow dedicated 
> switch and NOX. Would you please help me even some advice,thank you very much~

What kind of layer 3 processing are you talking about?

>Another question,how to make the topo update timely which you can see from 
> NOX GUI , the topo can display the whole network topo when run the command: 
> ./nox_core monitoring discovery topology trackhost_pktin. But it can't update 
> timely when a host leave from the network. How to solve this problem? I am 
> sorry to post it again as the question may be overloaded. Thank you~

Well, there's no real way to tell when a host leaves.  So right now, it's 
decided by timeout.  You could try reducing the timeout, but that increases the 
chance that a quiet host may be judged to be leaving when it's actually just 
quiet.

I have suggested that we ARP-ping hosts occasionally to see if they're still 
there or not.  If a host NEVER responds to an ARP-ping, fall back to the 
timeout behavior.  This hasn't yet been implemented, though, as far as I know.

> By the way, i have solved the disconnecting problem via adding a 1G 
> ethernet switch beween them yesterday.Because the netfpga only surpports 1G 
> transporting speed,but the max speed which the openwrt surpports is 100M.
> Best Wishes
>   
> Wang Jian
>   
>Tuesday, December 6,2011

-- Murphy

___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] unable to create new app in nox

2011-12-05 Thread Murphy McCauley
I'm not sure if this is a bug or a feature, but if you check try_newapp's 
meta.json file, you'll see that the actual component name is "try newapp" (with 
a space) and not "try_newapp" (with an underscore).

If you try running:
./nox_core -v -l ptcp:789 "try newapp"
.. it should work.

It might be a better idea to edit the meta.json so that the component name 
doesn't contain a space, though.  I am not sure if there are parts of NOX which 
will expect component names to not contain spaces...

Hope that helps.

-- Murphy

On Dec 5, 2011, at 7:00 AM, Beeram, Suresh KumarReddy wrote:

> Hi All,
> I am new to NOX source code. Today I tried to create new NOX app “try_newapp” 
> in netapps directory, it compiled  successfully but when I start executing 
> nox_core executable
> “./nox_core –v –I ptcp:789 try_newapp” it throws error 
> “00041|nox|ERR:Application 'try_newapp' description not found.”
>  
> Steps used to create new app:
> nox-new-c-app.py try_newapp
>  
> it created try_newapp dir .
> root@desktop:~/nox/src/nox/netapps/try_newapp# ls
> Makefile.am  Makefile.in  meta.json  try_newapp.cc  try_newapp.hh
>  
> Please find the attachment of error log and config log.
>  
> Correct me if I was wrong in creating new app..
>  
> Thanks
> -B Suresh Reddy
>  
> ___
> 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


Re: [nox-dev] Cannot find packages or modules imported in Graph_Topology.py (NOX destiny)

2011-12-05 Thread Murphy McCauley
This file is ancient and I don't think it has ever worked with a public release 
of NOX.  It is probably in there by mistake and we've never noticed.  I'd 
suggest you look at the existing GUI if you want a graph.  If you really want 
to get that thing going...

discovery is now nox.netapps.discovery if I recall correctly, and packet is 
nox.lib.packet.  I'm not sure what locator was, but I'd guess it's now part of 
either authenticator or routing.

Hope that helps.

-- Murphy

On Dec 5, 2011, at 12:02 AM, Patrick Yu ( 游昭霖) wrote:

> from pyapps import locator
> from pyapps import discovery
> from vigil.packet import *
> 
> cannot find files or directories with names containing "pyapps" or "locator"
> 
> Do the source code of these packages or modules exist?
> 
> Patrick Yu
> ___
> 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


Re: [nox-dev] "attempt to reuse the buffer"

2011-12-01 Thread Murphy McCauley
Your first call to install_datapath_flow() in the code below is wrong.  The 
last argument you're passing is priority.  But the parameter at that position 
is buffer_id.  So what you're actually doing is telling the switch to use 
buffer_id 5 over and over.

Either insert a "None" between actions and priority, or make the last argument 
use a keyword argument ("priority=priority").

Hope that helps.

-- Murphy

On Dec 1, 2011, at 1:52 AM, Giorgio Mazza wrote:

> Hello,
> I have a problem in the communication between an OpenFlow switch (I use 
> OpenVswitch) and my NOX controller, connected out-of-band.
> The two machines connects, but, after I install the first flow, I get the 
> following error message:
> *openflow-event|ERR:received Openflow error packet from dpid=XX:
> type=1, code=7, 24 bytes of data*
> 
> and the "*ovs-openflowd*" terminal showed following error
> 
> *"attempt to reuse the buffer"*
> 
> While discussing on ovs-discuss mailing list they suggest that "Send a given 
> buffer_id only in a single OpenFlow request".
> I have also seen that there was a guy who wrote here an email as he had the 
> same problem, so maybe you already solved this.
> 
> In my controller I want to install flows after a miss in the flow table. Here 
> is a part of the code.
> 
> def packet_in_callback(self, dp_id, inport, ofp_reason, 
> total_frame_len, buffer_id, packet):
> ethr_pkt = packet.find('ethernet')
> 
> if (ofp_reason == openflow.OFPR_NO_MATCH) :
> print "!!!  W A R N I N G 
> "
> print "No matching rule in the flow table."
> 
> if(ethr_pkt.type == ethernet.ARP_TYPE):
> m_arp = ethr_pkt.find('arp')
> src_ip = ip_to_str(m_arp.protosrc)
> dst_ip = ip_to_str(m_arp.protodst)
> print "Received an ARP packet with", "\n src_ip: ", 
> src_ip, "dst_ip: ", dst_ip
> arp_type = m_arp.opcode
> if (arp_type == 1): 
> print "This is an ARP REQUEST coming from port", 
> inport
> elif (arp_type == 2):
> print "This is an ARP REPLY coming from port", 
> inport
> attr = {}
> attr [core.IN_PORT] = inport
> attr [core.DL_TYPE] = ethr_pkt.type
> idle_timeout = openflow.OFP_FLOW_PERMANENT
> hard_timeout = openflow.OFP_FLOW_PERMANENT
> priority = 5
> if inport == 25:
> outport = 26
> elif inport == 26:
> outport = 25
> actions = [[openflow.OFPAT_OUTPUT, [0,outport]]]
> self.install_datapath_flow(dp_id,
>attr,
>
> idle_timeout,
>
> hard_timeout,
>actions,
>priority)
> 
> 
> elif(ethr_pkt.type == 0x0800):
> ip_pkt = packet.find('ipv4')
> src_ip = ip_to_str(ip_pkt.srcip)
> dst_ip = ip_to_str(ip_pkt.dstip)
> tos = ip_pkt.tos
> nw_proto = ip_pkt.protocol
>
> print "The incoming packet has the following 
> structure: ", "\n L3 Protocol: ", nw_proto, "\n src_ip: ", src_ip
> print  " dst_ip: ", dst_ip, "\n TOS: ", tos
>
> 
> if (ip_pkt.protocol == 1):
> attrs = {}
> attrs[core.IN_PORT] = inport
> attrs[core.DL_TYPE] = ethr_pkt.type
> attrs[core.NW_SRC] = ip_pkt.srcip
> attrs[core.NW_DST] = ip_pkt.dstip
> attrs[core.NW_PROTO] = nw_proto
> attrs[core.NW_TOS] = tos
> idle_timeout = openflow.OFP_FLOW_PERMANENT
> hard_timeout = openflow.OFP_FLOW_PERMANENT
> if inport == 26:
> outport = 25
> elif inport == 25:
> outport = 26
> actions = [[openflow.OFPAT_OUTPUT, [0, outport]]]
>   

Re: [nox-dev] help: link_type

2011-12-01 Thread Murphy McCauley
I'm not an LAVI expert, but I believe the only types are all, sw2sw and host2sw.

-- Murphy

On Dec 1, 2011, at 12:48 AM, ztom wrote:

> Hi~ alls,
> I need to get all link_types of topo's jsonmsg, but i just find two of them 
> ("all" & "sw2sw"). Is there some docs about it? I can't get any hint from 
> source code now ... Waiting for your help.
> 
> ---
> best regards  
> ___
> 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


Re: [nox-dev] Why does NOX Destiny version lack of SQLite3 database support??

2011-11-30 Thread Murphy McCauley
It was removed several years ago... I think just because nothing in NOX itself 
was using it.

What do you want to use it for?  If you just want to use sqlite for your own 
component to keep data, you can just include it yourself...

-- Murphy

On Nov 30, 2011, at 6:45 AM, dongxia pan wrote:

> hi, guys
>  I intend to develop programs based on destiny or latest source codes.
> Whereas, I find that the version of Destiny lack of SQLite3 database support.
> Destiny or latest codes only include codes of Dht storage, but Dht storage is 
> too complex for me.
>  Previously, I found that Nox-0.5.0~full~beta version has supported 
> SQLite3.
>  Are there any reasons to remove sqlite3 in the latest codes?
>  Looking  forward to your reply. 
> ___
> 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


Re: [nox-dev] Spanning Tree Module

2011-11-30 Thread Murphy McCauley
Glad you got it working, and thanks for the feedback. :)

-- Murphy

On Nov 30, 2011, at 7:38 AM, Bernd Wittefeld wrote:

> Hi,
> ok, I got it to work now. It was a problem on our side. In fact, the switches 
> in the lab are connected by an HP ProCurve switch, which i have configured to 
> use VLANs for every "link" between the OpenFlow switches.
> After configuring the HP switch in the correct way, everything worked :)
> So, I read in the wiki, that the Spanning Tree module was only tested with 
> three switches. I can confirm it works flawlessly with six switches.
> Thanks for your quick answer.
> 
> Best regards
> Bernd
> 
> 
> 
> Zitat von Murphy McCauley :
> 
>> AFAIK, this should work.  Have you actually inspected the switches?  Are the 
>> relevant ports actually getting NOFLOOD set?
>> 
>> -- Murphy
>> 
>> On Nov 29, 2011, at 7:54 AM, Bernd Wittefeld wrote:
>> 
>>> Hi,
>>> first of all: thanks for your great work and the really good support
>>> here. I have a small problem and I hope someone knows what to do :)
>>> 
>>> The situation is the following:
>>> I have a network with 6 OpenFlow switches in a mesh here. The software
>>> (switches and NOX) is working fine.
>>> I use the spanning_tree module in order to prevent loops in the network
>>> when flooding ARP-Requests and stuff.
>>> I got everything to work fine and even the NOX Gui (I'm on destiny)
>>> shows me a correct Spanning-Tree without loops.
>>> I have two hosts which are connected to two different switches. If I
>>> send an ICMP ping from one host to the other, I get the ARP requests in
>>> the Openflow network. They travel along the spanning tree which I
>>> checked by using wireshark and tcpdump. The other links don't show ARP
>>> requests.
>>> 
>>> Now the problem:
>>> The ARP requests are not forwarded out of the OpenFlow network. That
>>> means, they reach the switch that is connected to the destination host,
>>> but the host does not get the ARP request.
>>> 
>>> How can I solve this? Do I have to "manually" unset the NOFLOOD switch
>>> on that port in my controller or is there any other way, maybe to make
>>> the spanning_tree module more intelligent or am I doing something wrong?
>>> 
>>> Thanks in advance
>>> Bernd
>>> 
>>> ___
>>> 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


Re: [nox-dev] Spanning Tree Module

2011-11-29 Thread Murphy McCauley
AFAIK, this should work.  Have you actually inspected the switches?  Are the 
relevant ports actually getting NOFLOOD set?

-- Murphy

On Nov 29, 2011, at 7:54 AM, Bernd Wittefeld wrote:

> Hi,
> first of all: thanks for your great work and the really good support
> here. I have a small problem and I hope someone knows what to do :)
> 
> The situation is the following:
> I have a network with 6 OpenFlow switches in a mesh here. The software
> (switches and NOX) is working fine.
> I use the spanning_tree module in order to prevent loops in the network
> when flooding ARP-Requests and stuff.
> I got everything to work fine and even the NOX Gui (I'm on destiny)
> shows me a correct Spanning-Tree without loops.
> I have two hosts which are connected to two different switches. If I
> send an ICMP ping from one host to the other, I get the ARP requests in
> the Openflow network. They travel along the spanning tree which I
> checked by using wireshark and tcpdump. The other links don't show ARP
> requests.
> 
> Now the problem:
> The ARP requests are not forwarded out of the OpenFlow network. That
> means, they reach the switch that is connected to the destination host,
> but the host does not get the ARP request.
> 
> How can I solve this? Do I have to "manually" unset the NOFLOOD switch
> on that port in my controller or is there any other way, maybe to make
> the spanning_tree module more intelligent or am I doing something wrong?
> 
> Thanks in advance
> Bernd
> 
> ___
> 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


Re: [nox-dev] Modify the packet's header in Openflow Switch(Router)

2011-11-29 Thread Murphy McCauley
If you want to modify the OpenFlow reference switch, you may have better luck 
by contacting one of the OpenFlow mailing lists (maybe openflow-discuss ... 
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss ?).

But I'd suggest you consider carefully if there is a way to do what you want 
within the OpenFlow spec or a common extension.  Can you not install a flow 
that matches the packets you want to modify?  Or maybe you can accomplish what 
you want using multiple tables (though support for this is a bit sketchy... it 
exists in OpenFlow 1.1 and Open vSwitch though the two differ somewhat)?

Good luck!

-- Murphy

On Nov 29, 2011, at 6:48 AM, Hyogi Jung wrote:

> Hi Murphy
> 
> Thank you for reply. I understood your point.
> The actual work of rewriting the packet header happens on the switch.
> (I'm sorry, I omit carbon copy.)
> 
> And I want to modify packet in switch before checking  flow table.
> Is it possible in openflow switch?
> 
> Original openflow process : Receive packet -> Check flow table(Find 
> highest-priority matching flow entry) -> Apply instructions(Modify packet etc)
> I want to do this : 
> Receive packet -> Modify packet in each OF switch -> Check flow table(Find 
> highest-priority matching flow entry) -> Apply instructions(Modify packet etc)
> 
> So I search receiving callback in OF switch. I think it maybe relate with 
> hw_drv.c (openflow\hw-lib\skeleton\hw_drv.c) ?
> But I don't know exactly.
> 
> Could you give some advice or where is the packet receiving callback?
> 
> Thank you for your favor.
> 
> Best Regards
> 
> - Hyogi
> 
> 2011/11/29 Murphy McCauley 
> This depends on exactly what you mean, though I wonder if you are operating 
> under a misconception.
> 
> If you use NOX to install a flow with, for example, an OFPAT_SET_DL_DST 
> action to set the ethernet address... the actual work of rewriting the packet 
> header happens on the switch.  It's only the instruction to do so that comes 
> from the controller.
> 
> Hope that helps.
> 
> -- Murphy
> 
> On Nov 28, 2011, at 7:12 AM, Hyogi Jung wrote:
> 
>> I want to modify the packet's header in Openflow Switch(Router) not NOX 
>> controller.
>> 
>> Do you know where event handler is called?
>> 
>> I try to search google and mailinglist, but I coundn't search. There is no 
>> information.
>> 
>> Could you give some advice or reference site?
>> 
>> 
>> ___
>> nox-dev mailing list
>> nox-dev@noxrepo.org
>> http://noxrepo.org/mailman/listinfo/nox-dev
> 
> 
> 
> 
> -- 
> Hyogi Jung, MS Student
> Multimedia & Mobile Communications Lab
> School of Computer Science and Engineering
> Seoul National University, Korea
> Tel: +82-2-880-9147
> 

___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] the connection between OF switch and openwrt

2011-11-28 Thread Murphy McCauley
I think the attachment is being scrubbed. Maybe you can send an image?

Though offhand, I don't know what I can tell you.  What do mean by unreachable? 
 Devices connected to the netfpga switch can't ping devices connected to the 
openwrt switch?  What NOX components are you running?

-- Murphy

On Nov 25, 2011, at 12:09 AM, 王健 wrote:

> Hi Murphy:
>  Thank you for your last reply , your suggest is right. Recently i built 
> a openflow network,you can see the topology in the attachment. The connection 
> between openflow switch(netfpga) and openwrt(openflow wireless) is 
> unreachable, i mark it in blue. What's wrong with it, would you like to give 
> me some advice for solving this problem,thank you very much! if there is 
> something else you want to know, please tell me.
> Best Wishes
>   
>&n bsp;Wang Jian
>   
>Friday, November 25, 2011   
>  
> 
> 
> 

___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] Not able to send ARP Reply in C++

2011-11-28 Thread Murphy McCauley
I don't think I've ever used it, but have you taken a look at 
include/netinet++/arp.hh?

-- Murphy

On Nov 25, 2011, at 1:54 AM, Kimihiko FUKAMI wrote:

> Hi,
> 
> Currently, I can not send an ARP Reply by using of Nox(zaku) in 
> C++ code. 
> 
> # I can write a code to reply ARP in python. 
> 
> So, I want a code sample to send ARP Reply in C++.
> 
> Please teach me!
> 
> ---
> E-mail: fukami.kimih...@lab.ntt.co.jp
> 
> ___
> 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


Re: [nox-dev] Modify the packet's header in Openflow Switch(Router)

2011-11-28 Thread Murphy McCauley
This depends on exactly what you mean, though I wonder if you are operating 
under a misconception.

If you use NOX to install a flow with, for example, an OFPAT_SET_DL_DST action 
to set the ethernet address... the actual work of rewriting the packet header 
happens on the switch.  It's only the instruction to do so that comes from the 
controller.

Hope that helps.

-- Murphy

On Nov 28, 2011, at 7:12 AM, Hyogi Jung wrote:

> I want to modify the packet's header in Openflow Switch(Router) not NOX 
> controller.
> 
> Do you know where event handler is called?
> 
> I try to search google and mailinglist, but I coundn't search. There is no 
> information.
> 
> Could you give some advice or reference site?
> 
> 
> ___
> 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


Re: [nox-dev] Information on Controller Open Flow in general

2011-11-22 Thread Murphy McCauley
Maybe some of these resources will be useful?

Wiki:
http://noxrepo.org/noxwiki/index.php/Main_Page

Slightly dated NOX presentation:
https://docs.google.com/present/view?id=dfsbt2qf_327f9688ngr

Doxygen:
http://noxrepo.org/~yapkke/doc/

Hope that helps.

-- Murphy

On Nov 22, 2011, at 8:43 AM, Francesco Pocci wrote:

> hello all,
> 
> I would need some very important information regarding NOx. In practice, I 
> have to retrievesome documents regarding the Open Flow controllers in general 
> to see the differentinterfaces that each controller must have. (NOX is only 
> an implementation of Open FlowController).
> This information I need to make absolutely a mapping with the interfaces of a 
> protocol in my possession to make a comparison of the features in my Protocol 
> and to implement.
> 
> I really hope that I explained is that you know well and help me.
> 
> F.P.
> ___
> 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


Re: [nox-dev] Flow hard timeout

2011-11-19 Thread Murphy McCauley
Sorry, but it's in seconds.  (See ofp_flow_mod in the OpenFlow spec.)

-- Murphy

On Nov 19, 2011, at 6:30 AM, andrea simeoni wrote:

> Hi guys,
> 
> Does the flow hard timeout must be an integer number of seconds? I'm trying 
> to set it to 0.5 ms but i get that it is set to the default value.
> Thank you.
> 
> -- 
> Andrea Simeoni
> ___
> 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


Re: [nox-dev] import error

2011-11-16 Thread Murphy McCauley
I don't really know anything about mobilevms, and I suspect this may be one of 
the cases where SWIG is misleading about what's going on.  But for starters, 
why don't you try...

./nox_core -v -v -i ptcp:6633 spanning_tree mobilevms

-- Murphy

On Nov 16, 2011, at 4:37 AM, 王健 wrote:

> Hello everyone:
>  I am a newcomer of python, and encountered a import error recently. This 
> code is "from nox.netapps.spanning_tree import spanning_tree" in the  
> mobilevms.py file. when run the command : ./nox_core -v -v -i ptcp:6633 
> mobilevms
> the error is:00081|nox|ERR:Cannot change the state of 'mobilevms' to 
> INSTALLED:
> 'mobilevms' ran into an error: 
> cannot import a Python module 'nox.netapps.mobilevms.mobilevms':
> Traceback (most recent call last):
>   File "./nox/netapps/mobilevms/mobilevms.py", line 46, in 
> from nox.netapps.spanning_tree.spanning_tree import*
>   File "./nox/netapps/spanning_tree/spanning_tree.py", line 27, i n 
> 
> from nox.coreapps.messenger.pyjsonmsgevent import JSONMsg_event
>   File "./nox/coreapps/messenger/pyjsonmsgevent.py", line 25, in 
> _pyjsonmsgevent = swig_import_helper()
>   File "./nox/coreapps/messenger/pyjsonmsgevent.py", line 21, in 
> swig_import_helper
> _mod = imp.load_module('_pyjsonmsgevent', fp, pathname, description)
> ImportError: ./nox/coreapps/messenger/_pyjsonmsgevent.so: undefined 
> symbol: vigil::JSONMsg_event::JSONMsg_event(vigil::core_message const*)
> 
> I  try to use "from nox.netapps.spanning_tree.spaning_tree   import*"  
> instead of the previous code, but also the same error. What's wrong with it, 
> would you like to tell me, thank you very much~
> additionally, the component of spanning_tree is normal when run the command: 
> ./nox_core -v -v -i ptcp:6633 spanning_tree and the "JSONMsg_event" is really 
> in the file of pyjsonmsgevent.py.
> best wishes
>   
>   ; wang 
> jian
>   
>   Wednesday ,November 
> 16,2011
> 
> 
> 
> 
> ___
> 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


Re: [nox-dev] what is the difference between pyswitch and routing module?

2011-11-11 Thread Murphy McCauley
You're using ovs-ofctl to add a flow to a switch.  In general, this isn't how 
NOX is intended to be used.  The pyswitch and routing applications in NOX (and 
this is probably true for pretty much all NOX applications) assume that they 
are the only things installing flows.  If you are manually adding flows 
externally, there is no telling what the results might be.  In your case, I 
guess it seems to work for pyswitch and not for routing, but the opposite could 
easily have been true instead.

The expected way to do this is to modify the NOX applications so that they 
install the rules you want (e.g., using enqueue instead of a simple output 
action) -- NOT to try to override NOX's behavior by manually installing flows.

Hope that helps.
-- Murphy

On Nov 10, 2011, at 5:16 PM, Shan Hu wrote:

> I has this topology as follows:
> 
>host2
> |
>   [eth2] 
>ovs2
>   /\
>  /  \
> host1--ovs1 ovs3--host3
> 
> i set queue tables on ovs2,created two queues,assigned queue0 with rate 
> 400mbps~500mbps,and queue1 with rate 600mbps~700mbps.
> 
> Then on controller i run command: ./nox_core -ptcp:6633 pyswitch
> 
> At last on ovs2 i run command: ./ovs-ofctl add flow br0 "in_port=1(note:ovs1) 
> ip nw_dst=xx.xx.xx.xx(note:host2 ip) idle_timeout=0 
> actions=enqueue:4:0(note:to make flows from port1 follow queue0 rule)"
> 
> Then i push data from host1 to host2, the rate is limited to 400mbps~500mbps.
> 
> However,i do the same as above except that i changed command on controller 
> to: ./nox_core -ptcp:6633 routing, the rate is not limited at all.
> 
> I thought it might be the routing module problem since the rate is limited 
> with pyswitch.
> 
> Shan 
> 
> - Original Message -
> From: "Murphy McCauley" 
> To: "Shan Hu" 
> Cc: "nox-dev" 
> Sent: Thursday, November 10, 2011 3:41:04 PM
> Subject: Re: [nox-dev] what is the difference between pyswitch and routing 
> module?
> 
> How did you implement rate limiting with pyswitch, and how are you trying to 
> do it with routing?
> 
> I'm not sure exactly what you mean about the modules of NOX.  They're all in 
> the various coreapps/netapps/webapps directories in the NOX source 
> repository.  Not all of them are documented on the wiki (or anywhere, 
> necessarily, except maybe the doxygen).
> 
> -- Murphy
> 
> On Nov 10, 2011, at 1:35 PM, Shan Hu wrote:
> 
>> Thank you very much for the explanation, Murphy.
>> 
>> Right now,I try to reserve bandwidth and limit rate with the queue table, it 
>> works great with pyswitch component,but it doesnt work with routing 
>> component.What reason could it be?
>> 
>> And another question,where can i find all the modules of NOX?There are not 
>> much in the noxwiki.Or, those in noxwiki already include all existing 
>> modules?
>> 
>> regards,
>> Shan  
>> 
>> - Original Message -
>> From: "Murphy McCauley" 
>> To: "Shan Hu" 
>> Cc: "nox-dev" 
>> Sent: Thursday, November 3, 2011 11:44:33 AM
>> Subject: Re: [nox-dev] what is the difference between pyswitch and routing 
>> module?
>> 
>> pyswitch is intended to be a very simple demo and does something along the 
>> lines of making each switch in the network a standalone L2 learning switch.  
>> Each switch gets no insight about the topology from its neighbors.  routing 
>> actually uses a global view of the topology, and can just generate optimal 
>> paths between any two endpoints.
>> 
>> A major result of this is that when running pyswitch, each switch needs to 
>> learn which port to use for each destination.  Before it learns, each switch 
>> will need to flood packets for destinations it doesn't know yet -- a lot of 
>> packets will get sent the "wrong way".  With routing, once ANY switch can 
>> determine where a destination is, the entire system knows.  Additionally, 
>> pyswitch's reliance on flooding is problematic for topologies with loops -- 
>> it's easy for packets to unknown destinations to loop indefinitely.
>> 
>> Hope that helps clear things up.
>> 
>> -- Murphy
>> 
>> On Nov 2, 2011, at 11:34 AM, Shan Hu wrote:
>> 
>>> I'm wondering what's the different between routing module and pyswitch 
>>> module?
>>> 
>>> I can find from wiki that routing is basically a forwarding module. but 
>>> what about pyswitch?
>>> 
>>> Because after i connected 3 openvswitchs(like this:host1 -- ovs1 -- ovs2 -- 
>

Re: [nox-dev] what is the difference between pyswitch and routing module?

2011-11-10 Thread Murphy McCauley
How did you implement rate limiting with pyswitch, and how are you trying to do 
it with routing?

I'm not sure exactly what you mean about the modules of NOX.  They're all in 
the various coreapps/netapps/webapps directories in the NOX source repository.  
Not all of them are documented on the wiki (or anywhere, necessarily, except 
maybe the doxygen).

-- Murphy

On Nov 10, 2011, at 1:35 PM, Shan Hu wrote:

> Thank you very much for the explanation, Murphy.
> 
> Right now,I try to reserve bandwidth and limit rate with the queue table, it 
> works great with pyswitch component,but it doesnt work with routing 
> component.What reason could it be?
> 
> And another question,where can i find all the modules of NOX?There are not 
> much in the noxwiki.Or, those in noxwiki already include all existing modules?
> 
> regards,
> Shan  
> 
> - Original Message -
> From: "Murphy McCauley" 
> To: "Shan Hu" 
> Cc: "nox-dev" 
> Sent: Thursday, November 3, 2011 11:44:33 AM
> Subject: Re: [nox-dev] what is the difference between pyswitch and routing 
> module?
> 
> pyswitch is intended to be a very simple demo and does something along the 
> lines of making each switch in the network a standalone L2 learning switch.  
> Each switch gets no insight about the topology from its neighbors.  routing 
> actually uses a global view of the topology, and can just generate optimal 
> paths between any two endpoints.
> 
> A major result of this is that when running pyswitch, each switch needs to 
> learn which port to use for each destination.  Before it learns, each switch 
> will need to flood packets for destinations it doesn't know yet -- a lot of 
> packets will get sent the "wrong way".  With routing, once ANY switch can 
> determine where a destination is, the entire system knows.  Additionally, 
> pyswitch's reliance on flooding is problematic for topologies with loops -- 
> it's easy for packets to unknown destinations to loop indefinitely.
> 
> Hope that helps clear things up.
> 
> -- Murphy
> 
> On Nov 2, 2011, at 11:34 AM, Shan Hu wrote:
> 
>> I'm wondering what's the different between routing module and pyswitch 
>> module?
>> 
>> I can find from wiki that routing is basically a forwarding module. but what 
>> about pyswitch?
>> 
>> Because after i connected 3 openvswitchs(like this:host1 -- ovs1 -- ovs2 -- 
>> ovs3 --host2),i firstly ran pyswitch module,then host1 can ping host2, 
>> however,i tried to run UDP traffic test,and found that the larger bandwidth 
>> i use, the more packet loss there are.
>> Then i stopped pyswitch module and ran routing module, then host1 still can 
>> ping host2, and the UDP traffic test works well, almost all the packets are 
>> transfered from host1 to host2.
>> 
>> why this happened?
>> 
>> Shan 
>> ___
>> 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


Re: [nox-dev] Switches crash when inserting OFPP_CONTROLLER actions

2011-11-08 Thread Murphy McCauley
How do the switches crash?  With an assertion about insufficient buffer 
headroom or something?  Or about a bad buffer ID (are you applying multiple 
actions?)?  Or do they just segfault?

Feel free to send along a capture of the OpenFlow traffic between NOX and the 
switch (along with the NOX and switch logs if possible), and we can take a 
look.  Though I'd be surprised if it was NOX sending something invalid that was 
causing your problem.

If you can develop a very simple application that crashes the switches, that 
would be valuable, and you might try sending it to one of the OpenFlow mailing 
lists too.

Any which way, the simplest answer is probably to use Open vSwitch instead of 
the OpenFlow reference implementation.

-- Murphy

On Nov 8, 2011, at 1:31 AM, andrea simeoni wrote:

> Hi guys,
> 
> I'm running a test with 2 hosts, 2 OF switches and 1 controller. The switches 
> and hosts are on 4 different ubuntu virtual machines and the controller is on 
> the host machine. For switches I use the user space OF implementation.
> I modified the simplerouting code to install a OFPP_CONTROLLER action in both 
> switches when a flow needs to be routed. To install actions I use the simple 
> API provided by routeinstaller. It happens that both switches crash and close 
> connection to controller.
> I tried the SAME controller on mininet (also with the same network topology) 
> and things seem be working.
> Any suggestions?
> -- 
> Andrea Simeoni
> ___
> 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


Re: [nox-dev] co-thread starving?

2011-11-05 Thread Murphy McCauley
Are you using co_sleep() to do the sleeping?

-- Murphy

On Nov 4, 2011, at 11:35 PM, danderson415 wrote:

> Hi,
> 
> I am wondering how co-threads works. I create a co-thread in my component 
> which just loop 100 times and sleep 100 ms and call co_yield() in the loop. 
> If I run nox with my component, nox can not be connected by bridges until the 
> loop is finished. Are all co-threads scheduled in round-robin or by some 
> priorities?
> 
> Thanks,
> David
> ___
> 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


Re: [nox-dev] what is the difference between pyswitch and routing module?

2011-11-03 Thread Murphy McCauley
pyswitch is intended to be a very simple demo and does something along the 
lines of making each switch in the network a standalone L2 learning switch.  
Each switch gets no insight about the topology from its neighbors.  routing 
actually uses a global view of the topology, and can just generate optimal 
paths between any two endpoints.

A major result of this is that when running pyswitch, each switch needs to 
learn which port to use for each destination.  Before it learns, each switch 
will need to flood packets for destinations it doesn't know yet -- a lot of 
packets will get sent the "wrong way".  With routing, once ANY switch can 
determine where a destination is, the entire system knows.  Additionally, 
pyswitch's reliance on flooding is problematic for topologies with loops -- 
it's easy for packets to unknown destinations to loop indefinitely.

Hope that helps clear things up.

-- Murphy

On Nov 2, 2011, at 11:34 AM, Shan Hu wrote:

> I'm wondering what's the different between routing module and pyswitch module?
> 
> I can find from wiki that routing is basically a forwarding module. but what 
> about pyswitch?
> 
> Because after i connected 3 openvswitchs(like this:host1 -- ovs1 -- ovs2 -- 
> ovs3 --host2),i firstly ran pyswitch module,then host1 can ping host2, 
> however,i tried to run UDP traffic test,and found that the larger bandwidth i 
> use, the more packet loss there are.
> Then i stopped pyswitch module and ran routing module, then host1 still can 
> ping host2, and the UDP traffic test works well, almost all the packets are 
> transfered from host1 to host2.
> 
> why this happened?
> 
> Shan 
> ___
> 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


Re: [nox-dev] a code problem about “util.py”

2011-11-03 Thread Murphy McCauley
The definition of register_handler is in pycontext.cc in pyrt.  It's exposed to 
Python via SWIG.

-- Murphy

On Nov 2, 2011, at 10:14 PM, hzy wrote:

> the code problem I have solved after I looked the python books about function.
> 
> but, when I look the codes in the core.py. 
> def register_handler(self, event_name, handler):
> """\brief Register an event handler.
> 
> The handler will be called with: handler(event).
> 'event' is a dictionary containing data for the
>  specific event.
> 
> @param event_name name of the event
> @param handler handler function
> """
> return self.ctxt.register_handler(event_name, handler)
> 
> I can't find the ctxt.register_handler function's definition. I want to see 
> how the register_handler works. which file can I find the definition?
> any ideas?
> 
> 2011/11/2 hzy 
> The reason why I need to look at the code is that I want to know how does NOX 
> handle the Datapath_join_event.
> I know the gen_datapath_join_callback was invoked by function 
> register_for_datapath_join in core.py.
> 
> I am very interested in the architecture of NOX. I am eager to know how the 
> NOX works. Any information will be appreciated.
> Thanks for advance.
> hzy
> 
> 
> 2011/11/2 hzy 
> Hi all:
> when I look at the code in nox/src/nox/lib/util.py written in python. I was 
> confused about some codes there. Because I am newbie to python.
> 
> def gen_datapath_join_callback(handler):
> def f(event):
> attrs = {}
> attrs[core.N_BUFFERS] = event.n_buffers
> attrs[core.N_TABLES] = event.n_tables
> attrs[core.CAPABILITES] = event.capabilities
> attrs[core.ACTIONS] = event.actions
> attrs[core.PORTS] = event.ports
> for i in range(0, len(attrs[core.PORTS])):
> port = attrs[core.PORTS][i]
> config = port['config']
> state = port['state']
> attrs[core.PORTS][i]['link']= (state & 
> openflow.OFPPS_LINK_DOWN) == 0
> attrs[core.PORTS][i]['enabled'] = (config & 
> openflow.OFPPC_PORT_DOWN) == 0
> attrs[core.PORTS][i]['flood']   = (config & 
> openflow.OFPPC_NO_FLOOD)  == 0
> 
> ret = f.cb(event.datapath_id, attrs)
> if ret == None:
> return CONTINUE
> return ret
> f.cb = handler
> return f
>  
> Python can define a function in a function really confused me. I do not know 
> how the function f(event) is invoked. and what the f.cb mean.
> Any ideas?
> Thanks forward.
> hzy
> 
> 
> ___
> 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


Re: [nox-dev] a code problem about “util.py”

2011-11-03 Thread Murphy McCauley
A function in Python is a first class object.  In the code below, f is defined 
inside of gen_datapath_join_callback, and you get a new f.  Since a function is 
just an object, gen_datapath_join_callback then adds a new property to f -- the 
cb property.  Inside f, this property is accessed.

I didn't write this piece of code, but it can actually be done a bit more 
simply.  I would write it like this:
def gen_datapath_join_callback(handler):
def f(event):
attrs = {}
attrs[core.N_BUFFERS] = event.n_buffers
attrs[core.N_TABLES] = event.n_tables
attrs[core.CAPABILITES] = event.capabilities
attrs[core.ACTIONS] = event.actions
attrs[core.PORTS] = event.ports
for i in range(0, len(attrs[core.PORTS])):
port = attrs[core.PORTS][i]
config = port['config']
state = port['state']
attrs[core.PORTS][i]['link']= (state & 
openflow.OFPPS_LINK_DOWN) == 0
attrs[core.PORTS][i]['enabled'] = (config & 
openflow.OFPPC_PORT_DOWN) == 0
attrs[core.PORTS][i]['flood']   = (config & 
openflow.OFPPC_NO_FLOOD)  == 0

ret = handler(event.datapath_id, attrs)
if ret == None:
return CONTINUE
return ret
return f

I don't know how much that explains.  The big point is that a function is an 
object  like any other: it has properties, it can be passed around and 
returned, and there can be multiple instances of it.

As for how f is invoked...

register_for_datapath_join() takes a callback function (handler) that is 
supposed to get called on datapath join.
Rather than actually have the given handler be the callback function, 
gen_datapath_join_callback() is used to generate a wrapper function.  The 
callback that gen_datapath_join_callback() creates (f) does some stuff (e.g., 
stocking the attrs dictionary), and then calls handler.
So the NOX event system calls f (via pyrt's Python_event_manager), and f calls 
the user-provided handler function.

I hope that sheds at least a little light.

-- Murphy

On Nov 2, 2011, at 7:03 AM, hzy wrote:

> Hi all:
> when I look at the code in nox/src/nox/lib/util.py written in python. I was 
> confused about some codes there. Because I am newbie to python.
> 
> def gen_datapath_join_callback(handler):
> def f(event):
> attrs = {}
> attrs[core.N_BUFFERS] = event.n_buffers
> attrs[core.N_TABLES] = event.n_tables
> attrs[core.CAPABILITES] = event.capabilities
> attrs[core.ACTIONS] = event.actions
> attrs[core.PORTS] = event.ports
> for i in range(0, len(attrs[core.PORTS])):
> port = attrs[core.PORTS][i]
> config = port['config']
> state = port['state']
> attrs[core.PORTS][i]['link']= (state & 
> openflow.OFPPS_LINK_DOWN) == 0
> attrs[core.PORTS][i]['enabled'] = (config & 
> openflow.OFPPC_PORT_DOWN) == 0
> attrs[core.PORTS][i]['flood']   = (config & 
> openflow.OFPPC_NO_FLOOD)  == 0
> 
> ret = f.cb(event.datapath_id, attrs)
> if ret == None:
> return CONTINUE
> return ret
> f.cb = handler
> return f
>  
> Python can define a function in a function really confused me. I do not know 
> how the function f(event) is invoked. and what the f.cb mean.
> Any ideas?
> Thanks forward.
> hzy
> ___
> 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


  1   2   3   4   5   >