[nox-dev] Something about Routing Application

2011-06-20 Thread ZHOU Ye
Hi, I'm a freshman of Openflow and Nox. I want to make a demo about customized 
routing control,
but there are something I'm confused. For example, I have a network topology 
consisting of 3 switches(
Switch A, Switch B, Switch C),  making up a triangle. We also have a host "Host 
A" connected to Switch
A, a host "Host B" connected to Switch B. Now I want to sent packets from Host 
A to Host B as a routing problem. 

Based on the k-shortest path method, which is stated in the application of 
routing(routing.cc), the routing is "Host A -> Switch A -> Switch B -> Host B". 
However, I want to modify this route into "Host A -> Switch A -> Switch C -> 
Switch B -> Host B", to represent the customized routing control. I want to 
know whether it is possible. 

Besides, I've already read about codes in the application of routing. If I want 
to finish the demo, what should 
I do to modify these codes. Thank you very much for reading this email. 

2011-06-21 



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


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

2011-06-20 Thread Aaron Rosen
Thanks Murphy!

You're right, that did the trick.

Aaron

On Mon, Jun 20, 2011 at 1:55 PM, Murphy McCauley  wrote:
> So I think the call to l3.checksum() is extraneous, but the real issue is
> probably that l3.iplen should be ipv4.MIN_LEN + l4.len.
>
> -- Murphy
>
> On Monday, June 20, 2011 09:42:07 AM Aaron Rosen wrote:
>> Hi Murphy,
>>
>> wow... Opps...
>>
>> I'm trying the following: This doesn't return any errors but in
>> wireshark the packet_outs say Malformed UDP packets.
>>
>> def send_udp_message():
>>
>>    l4 = udp()
>>    l4.srcport = 1999
>>    l4.dstport = 1888
>>    l4.len = udp.MIN_LEN + len("hello_world")
>>    l4.set_payload("Hello_world")
>>    l4.arr = l4.tostring()
>>
>>    l3 = ipv4()
>>    l3.iplen = ipv4.MIN_LEN
>>    l3.protocol = ipv4.UDP_PROTOCOL
>>    l3.dstip = ipstr_to_int("130.127.39.7");
>>    l3.srcip = ipstr_to_int("1.1.1.1");
>>    l3.set_payload(l4)
>>
>>    l2 = ethernet()
>>    l2.set_payload(l3)
>>    l2.dst = octstr_to_array("00:00:00:00:00:02")
>>    l2.dst = octstr_to_array("a1:00:04:00:0a:04")
>>    l2.type = ethernet.IP_TYPE
>>    l3.checksum()
>>    l4.csum = l4.checksum()
>>
>>    return l2
>>
>> 
>>     inst.send_openflow_packet(dpid, send_udp_message().tostring(),
>> openflow.OFPP_FLOOD, inport)
>>     source = mac_to_str(packet.src)
>>
>> On Mon, Jun 20, 2011 at 12:29 PM, Murphy McCauley  wrote:
>> > Unfortunately, your tweak breaks the logic of the assert.
>> >
>> > The assert is asserting that self.next is a packet_base of some sort OR a
>> > string.  You've set it to a string, so... it should be a string.  So it
>> > should definitely not be a packet_base.  So the first of your asserts
>> > will always fail.
>> >
>> > For the sake of testing, would you please comment out the first of your
>> > two asserts (leaving only the one against type('')), and let me know the
>> > result?
>> >
>> > -- Murphy
>> >
>> > On Monday, June 20, 2011 09:22:23 AM Aaron Rosen wrote:
>> >> Hi Murphy,
>> >>
>> >> I'm using zaku but the one in destiny looked the same to be.
>> >>
>> >> I changed to assert to be on two lines so I could see which one was
>> >> firing.
>> >>
>> >>     def checksum(self):
>> >>         #assert(isinstance(self.next, packet_base) or type(self.next)
>> >> == type(''))
>> >>         assert(isinstance(self.next, packet_base))
>> >>         assert(type(self.next) == type(''))
>> >>
>> >>
>> >> Thanks,
>> >>
>> >> Aaron
>> >>
>> >> On Mon, Jun 20, 2011 at 12:19 PM, Murphy McCauley  wrote:
>> >> > What NOX are you using?  Your udp.py does not seem to be the one in
>> >> > zaku or destiny...
>> >> >
>> >> > -- Murphy
>> >> >
>> >> > On Sunday, June 19, 2011 03:34:20 PM Aaron Rosen wrote:
>> >> >> Hello,
>> >> >>
>> >> >> I'm trying to send udp packets from my controller but I'm getting the
>> >> >> following assertion when I call udp().checksum(). I was hoping
>> >> >> someone could point out where I'm going wrong.
>> >> >>
>> >> >> Thanks,
>> >> >>
>> >> >> Aaron
>> >> >>
>> >> >> Traceback (most recent call last):
>> >> >>   File "./nox/lib/util.py", line 116, in f
>> >> >>     event.total_len, buffer_id, packet)
>> >> >>   File "./nox/coreapps/examples/sos.py", line 299, in
>> >> >> packet_in_callback learn(dpid, inport, packet)
>> >> >>   File "./nox/coreapps/examples/sos.py", line 56, in learn
>> >> >>     send_packet = send_udp_message()
>> >> >>   File "./nox/coreapps/examples/sos.py", line 48, in send_udp_message
>> >> >>     l4.csum = l4.checksum()
>> >> >>   File "./nox/lib/packet/udp.py", line 111, in checksum
>> >> >>     assert(isinstance(self.next, packet_base))
>> >> >> AssertionError
>> >> >>
>> >> >>
>> >> >> def send_udp_message():
>> >> >>
>> >> >>     l4 = udp()
>> >> >>     l4.srcport = 1999
>> >> >>     l4.dstport = 1888
>> >> >>     l4.len = udp.MIN_LEN + len("hello_world")
>> >> >>     l4.set_payload("Hello_world")
>> >> >>
>> >> >>     l3 = ipv4()
>> >> >>     l3.iplen = ipv4.MIN_LEN
>> >> >>     l3.protocol = ipv4.UDP_PROTOCOL
>> >> >>     l3.dstip = ipstr_to_int("130.127.39.7");
>> >> >>     l3.srcip = ipstr_to_int("1.1.1.1");
>> >> >>     l3.set_payload(l4)
>> >> >>
>> >> >>     l2 = ethernet()
>> >> >>     l2.set_payload(l3)
>> >> >>     l2.dst = octstr_to_array("00:00:00:00:00:02")
>> >> >>     l2.dst = octstr_to_array("a1:00:04:00:0a:04")
>> >> >>     l2.type = ethernet.IP_TYPE
>> >> >>     l3.checksum()
>> >> >>     l4.csum = l4.checksum()
>> >> >>
>> >> >>     return l2
>> >> >>
>> >> >>
>> >> >> 
>> >> >>     send_packet = send_udp_message()
>> >> >>     inst.send_openflow_packet(dpid, send_packet.tostring(),
>> >> >> openflow.OFPP_FLOOD, inport)
>



-- 
Aaron O. Rosen
Masters Student - Network Communication
306B Fluor Daniel
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


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

2011-06-20 Thread Murphy McCauley
So I think the call to l3.checksum() is extraneous, but the real issue is 
probably that l3.iplen should be ipv4.MIN_LEN + l4.len.

-- Murphy

On Monday, June 20, 2011 09:42:07 AM Aaron Rosen wrote:
> Hi Murphy,
> 
> wow... Opps...
> 
> I'm trying the following: This doesn't return any errors but in
> wireshark the packet_outs say Malformed UDP packets.
> 
> def send_udp_message():
> 
>l4 = udp()
>l4.srcport = 1999
>l4.dstport = 1888
>l4.len = udp.MIN_LEN + len("hello_world")
>l4.set_payload("Hello_world")
>l4.arr = l4.tostring()
> 
>l3 = ipv4()
>l3.iplen = ipv4.MIN_LEN
>l3.protocol = ipv4.UDP_PROTOCOL
>l3.dstip = ipstr_to_int("130.127.39.7");
>l3.srcip = ipstr_to_int("1.1.1.1");
>l3.set_payload(l4)
> 
>l2 = ethernet()
>l2.set_payload(l3)
>l2.dst = octstr_to_array("00:00:00:00:00:02")
>l2.dst = octstr_to_array("a1:00:04:00:0a:04")
>l2.type = ethernet.IP_TYPE
>l3.checksum()
>l4.csum = l4.checksum()
> 
>return l2
> 
> 
> inst.send_openflow_packet(dpid, send_udp_message().tostring(),
> openflow.OFPP_FLOOD, inport)
> source = mac_to_str(packet.src)
> 
> On Mon, Jun 20, 2011 at 12:29 PM, Murphy McCauley  wrote:
> > Unfortunately, your tweak breaks the logic of the assert.
> > 
> > The assert is asserting that self.next is a packet_base of some sort OR a
> > string.  You've set it to a string, so... it should be a string.  So it
> > should definitely not be a packet_base.  So the first of your asserts
> > will always fail.
> > 
> > For the sake of testing, would you please comment out the first of your
> > two asserts (leaving only the one against type('')), and let me know the
> > result?
> > 
> > -- Murphy
> > 
> > On Monday, June 20, 2011 09:22:23 AM Aaron Rosen wrote:
> >> Hi Murphy,
> >> 
> >> I'm using zaku but the one in destiny looked the same to be.
> >> 
> >> I changed to assert to be on two lines so I could see which one was
> >> firing.
> >> 
> >> def checksum(self):
> >> #assert(isinstance(self.next, packet_base) or type(self.next)
> >> == type(''))
> >> assert(isinstance(self.next, packet_base))
> >> assert(type(self.next) == type(''))
> >> 
> >> 
> >> Thanks,
> >> 
> >> Aaron
> >> 
> >> On Mon, Jun 20, 2011 at 12:19 PM, Murphy McCauley  wrote:
> >> > What NOX are you using?  Your udp.py does not seem to be the one in
> >> > zaku or destiny...
> >> > 
> >> > -- Murphy
> >> > 
> >> > On Sunday, June 19, 2011 03:34:20 PM Aaron Rosen wrote:
> >> >> Hello,
> >> >> 
> >> >> I'm trying to send udp packets from my controller but I'm getting the
> >> >> following assertion when I call udp().checksum(). I was hoping
> >> >> someone could point out where I'm going wrong.
> >> >> 
> >> >> Thanks,
> >> >> 
> >> >> Aaron
> >> >> 
> >> >> Traceback (most recent call last):
> >> >>   File "./nox/lib/util.py", line 116, in f
> >> >> event.total_len, buffer_id, packet)
> >> >>   File "./nox/coreapps/examples/sos.py", line 299, in
> >> >> packet_in_callback learn(dpid, inport, packet)
> >> >>   File "./nox/coreapps/examples/sos.py", line 56, in learn
> >> >> send_packet = send_udp_message()
> >> >>   File "./nox/coreapps/examples/sos.py", line 48, in send_udp_message
> >> >> l4.csum = l4.checksum()
> >> >>   File "./nox/lib/packet/udp.py", line 111, in checksum
> >> >> assert(isinstance(self.next, packet_base))
> >> >> AssertionError
> >> >> 
> >> >> 
> >> >> def send_udp_message():
> >> >> 
> >> >> l4 = udp()
> >> >> l4.srcport = 1999
> >> >> l4.dstport = 1888
> >> >> l4.len = udp.MIN_LEN + len("hello_world")
> >> >> l4.set_payload("Hello_world")
> >> >> 
> >> >> l3 = ipv4()
> >> >> l3.iplen = ipv4.MIN_LEN
> >> >> l3.protocol = ipv4.UDP_PROTOCOL
> >> >> l3.dstip = ipstr_to_int("130.127.39.7");
> >> >> l3.srcip = ipstr_to_int("1.1.1.1");
> >> >> l3.set_payload(l4)
> >> >> 
> >> >> l2 = ethernet()
> >> >> l2.set_payload(l3)
> >> >> l2.dst = octstr_to_array("00:00:00:00:00:02")
> >> >> l2.dst = octstr_to_array("a1:00:04:00:0a:04")
> >> >> l2.type = ethernet.IP_TYPE
> >> >> l3.checksum()
> >> >> l4.csum = l4.checksum()
> >> >> 
> >> >> return l2
> >> >> 
> >> >> 
> >> >> 
> >> >> send_packet = send_udp_message()
> >> >> inst.send_openflow_packet(dpid, send_packet.tostring(),
> >> >> openflow.OFPP_FLOOD, inport)
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


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

2011-06-20 Thread Aaron Rosen
Hi Murphy,

wow... Opps...

I'm trying the following: This doesn't return any errors but in
wireshark the packet_outs say Malformed UDP packets.

def send_udp_message():

   l4 = udp()
   l4.srcport = 1999
   l4.dstport = 1888
   l4.len = udp.MIN_LEN + len("hello_world")
   l4.set_payload("Hello_world")
   l4.arr = l4.tostring()

   l3 = ipv4()
   l3.iplen = ipv4.MIN_LEN
   l3.protocol = ipv4.UDP_PROTOCOL
   l3.dstip = ipstr_to_int("130.127.39.7");
   l3.srcip = ipstr_to_int("1.1.1.1");
   l3.set_payload(l4)

   l2 = ethernet()
   l2.set_payload(l3)
   l2.dst = octstr_to_array("00:00:00:00:00:02")
   l2.dst = octstr_to_array("a1:00:04:00:0a:04")
   l2.type = ethernet.IP_TYPE
   l3.checksum()
   l4.csum = l4.checksum()

   return l2


inst.send_openflow_packet(dpid, send_udp_message().tostring(),
openflow.OFPP_FLOOD, inport)
source = mac_to_str(packet.src)



On Mon, Jun 20, 2011 at 12:29 PM, Murphy McCauley  wrote:
> Unfortunately, your tweak breaks the logic of the assert.
>
> The assert is asserting that self.next is a packet_base of some sort OR a
> string.  You've set it to a string, so... it should be a string.  So it should
> definitely not be a packet_base.  So the first of your asserts will always 
> fail.
>
> For the sake of testing, would you please comment out the first of your two
> asserts (leaving only the one against type('')), and let me know the result?
>
> -- Murphy
>
> On Monday, June 20, 2011 09:22:23 AM Aaron Rosen wrote:
>> Hi Murphy,
>>
>> I'm using zaku but the one in destiny looked the same to be.
>>
>> I changed to assert to be on two lines so I could see which one was firing.
>>
>>     def checksum(self):
>>         #assert(isinstance(self.next, packet_base) or type(self.next)
>> == type(''))
>>         assert(isinstance(self.next, packet_base))
>>         assert(type(self.next) == type(''))
>>
>>
>> Thanks,
>>
>> Aaron
>>
>> On Mon, Jun 20, 2011 at 12:19 PM, Murphy McCauley  wrote:
>> > What NOX are you using?  Your udp.py does not seem to be the one in zaku
>> > or destiny...
>> >
>> > -- Murphy
>> >
>> > On Sunday, June 19, 2011 03:34:20 PM Aaron Rosen wrote:
>> >> Hello,
>> >>
>> >> I'm trying to send udp packets from my controller but I'm getting the
>> >> following assertion when I call udp().checksum(). I was hoping someone
>> >> could point out where I'm going wrong.
>> >>
>> >> Thanks,
>> >>
>> >> Aaron
>> >>
>> >> Traceback (most recent call last):
>> >>   File "./nox/lib/util.py", line 116, in f
>> >>     event.total_len, buffer_id, packet)
>> >>   File "./nox/coreapps/examples/sos.py", line 299, in packet_in_callback
>> >>     learn(dpid, inport, packet)
>> >>   File "./nox/coreapps/examples/sos.py", line 56, in learn
>> >>     send_packet = send_udp_message()
>> >>   File "./nox/coreapps/examples/sos.py", line 48, in send_udp_message
>> >>     l4.csum = l4.checksum()
>> >>   File "./nox/lib/packet/udp.py", line 111, in checksum
>> >>     assert(isinstance(self.next, packet_base))
>> >> AssertionError
>> >>
>> >>
>> >> def send_udp_message():
>> >>
>> >>     l4 = udp()
>> >>     l4.srcport = 1999
>> >>     l4.dstport = 1888
>> >>     l4.len = udp.MIN_LEN + len("hello_world")
>> >>     l4.set_payload("Hello_world")
>> >>
>> >>     l3 = ipv4()
>> >>     l3.iplen = ipv4.MIN_LEN
>> >>     l3.protocol = ipv4.UDP_PROTOCOL
>> >>     l3.dstip = ipstr_to_int("130.127.39.7");
>> >>     l3.srcip = ipstr_to_int("1.1.1.1");
>> >>     l3.set_payload(l4)
>> >>
>> >>     l2 = ethernet()
>> >>     l2.set_payload(l3)
>> >>     l2.dst = octstr_to_array("00:00:00:00:00:02")
>> >>     l2.dst = octstr_to_array("a1:00:04:00:0a:04")
>> >>     l2.type = ethernet.IP_TYPE
>> >>     l3.checksum()
>> >>     l4.csum = l4.checksum()
>> >>
>> >>     return l2
>> >>
>> >>
>> >> 
>> >>     send_packet = send_udp_message()
>> >>     inst.send_openflow_packet(dpid, send_packet.tostring(),
>> >> openflow.OFPP_FLOOD, inport)
>



-- 
Aaron O. Rosen
Masters Student - Network Communication
306B Fluor Daniel
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] gathering status of Openflow Switch

2011-06-20 Thread Min-Hyup KANG



	
	
Ok, you are right.I refered http://noxrepo.org/noxwiki/index.php/NOX_Installation#Installationso, git clone git://noxrepo.org/noxcd noxgit branch -agit checkout -b destiny origin/destiny./boost.shmkdir build/cd build../configuremake -j 5and thenI can see monitoring directory.src/nox/netapps# lsMakefile          data          lavi          spanning_tree      tests__init__.py       discovery     monitoring    storage            topology__init__.pyc      flow_fetcher  networkstate  switch_management  user_event_logauthenticator     flowtracer    route         switchstatsbindings_storage  hoststate     routing       tablogand then I run monitoring componentbut I can't see any packet.should I re-write monitoring.py ?./nox_core -i ptcp:6633 -v pyswitch  monitoring 1|nox|INFO:Starting nox_core (/home/kang/test/NOX_TEST/nox/build/src/.libs/lt-nox_core)2|nox|INFO:nox bootstrap complete3|nox.coreapps.examples.pyswitch|INFO:Switch 232022d73e has joined the network{}- ¿øº» ¸ÞÀÏ -º¸³½»ç¶÷: Kyriakos Zarifis ¹Þ´Â»ç¶÷ : Min-Hyup KANG ÂüÁ¶ : nox-dev@noxrepo.org³¯Â¥: 2011³â 6¿ù 20ÀÏ ¿ù¿äÀÏ, 16½Ã 15ºÐ 09ÃÊ +0900Á¦¸ñ: Re: [nox-dev] gathering status of Openflow Switch

	Hi,you are probably using the branch of the repository and not destiny. Take a look at the first reply above, which explains that the monitoring component is only on the Destiny branch, and how to get it.
(Using Destiny is suggested at this point, as it is more up-to-date version of nox with several bug fixes and features. In any case, the example code in "monitor" which you already looked at probably answers your question.)
2011/6/19 Min-Hyup KANG 



	
	
Thanks for your kindness.But there is not exsisting monitoring.py of netapps/so there is existing some derectory in netapps as a below.
src/nox/netapps# lsMakefile.am  __init__.py    bindings_storage  discovery     hoststate  networkstate  routing  switch_management  tablog  topologyMakefile.in  authenticator  data              flow_fetcher  lavi       route         storage  switchstats        tests   user_event_log
additionally, I re-write some code(0xfff) in monitor.py refering mail. as a below,"""def aggregate_timer(self, dpid): 
        flow = ofp_match()        #flow.wildcards = 0x        flow.wildcards = 0x        self.ctxt.send_aggregate_stats_request(dpid, flow,  0xff)        self.post_callback(MONITOR_TABLE_PERIOD, lambda : self.aggregate_timer(dpid))
"""1.What does 0xfff mean ?and then, I re-run command.So, I can check below message.00086|openflow-event|DBG:received stats reply from 002320c2f7b4
Aggregate stats in from datapath 00:23:20:c2:f7:b4{'packet_cout' : 39L, 'byte_cout' : 3822L, 'flow_count':2L }- ¿øº» ¸ÞÀÏ -
º¸³½»ç¶÷: Kyriakos Zarifis 
¹Þ´Â»ç¶÷ : Min-Hyup KANG ÂüÁ¶ : nox-dev@noxrepo.org³¯Â¥: 2011³â 6¿ù 20ÀÏ ¿ù¿äÀÏ, 15½Ã 34ºÐ 01ÃÊ +0900
Á¦¸ñ: Re: [nox-dev] gathering status of Openflow Switch

	Hi,I was actually referring to netapps/monitoring/montoring.py, which is a more complete (and complicated) monitoring component, but it is the same idea. However the one you looked at might actually be a better example exactly because it is simpler, but still shows how to create and send switch query packets.

The output you pasted looks okay2011/6/19 Min-Hyup KANG 




	
	
Hi,after I found monitoring.py,There is existing /src/nox/coreapps/examples/monitor.py.I think what you mean is /src/nox/coreapps/examples/monitor.py. right ?

so, I excuted monitor component.I can check Table stats and Port stats, Aggregate stats as a below.00072|openflow-event|DBG:received stats reply from 002320ca92e0

Table stats in from datapath 00:23:20:ca:92:e0	hash2 : 0	linear : 200073|openflow-event|DBG:received stats reply from 002320ca92e0

Port stats in from datapath 00:23:20:ca:92:e0	1 : 4	2 : 400074|openflow-event|DBG:received stats reply from 002320ca92e0

Aggregate stats in from datapath 00:23:20:ca:92:e0	{'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L}

- ¿øº» ¸ÞÀÏ -

º¸³½»ç¶÷: Kyriakos Zarifis ¹Þ´Â»ç¶÷ : Min-Hyup KANG 

ÂüÁ¶ : nox-dev@noxrepo.org³¯Â¥: 2011³â 6¿ù 20ÀÏ ¿ù¿äÀÏ, 00½Ã 35ºÐ 26ÃÊ +0900Á¦¸ñ: Re: [nox-dev] gathering status of Openflow Switch



	Hi, the 'monitoring' component I was referring to, is under:  / src / nox / netapps / monitoring / monitoring.py


but on the Destiny branch of the repository (not Zaku which is the master branch).
Follow the instructions here http://noxrepo.org/noxwiki/index.php/NOX_Installation#Installation (where it says "For a branch other than master"...)


to switch to Destiny. 



-> you mean pyswitch can gather status of flow, port  in switch, right ?
and I think I should use  ofp_stats_request, ofp_stats_reply, ofp_desc_stats, ofp_port_stats_request, ofp_ports_sta

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

2011-06-20 Thread Murphy McCauley
Unfortunately, your tweak breaks the logic of the assert.

The assert is asserting that self.next is a packet_base of some sort OR a 
string.  You've set it to a string, so... it should be a string.  So it should 
definitely not be a packet_base.  So the first of your asserts will always 
fail.  

For the sake of testing, would you please comment out the first of your two 
asserts (leaving only the one against type('')), and let me know the result?

-- Murphy

On Monday, June 20, 2011 09:22:23 AM Aaron Rosen wrote:
> Hi Murphy,
> 
> I'm using zaku but the one in destiny looked the same to be.
> 
> I changed to assert to be on two lines so I could see which one was firing.
> 
> def checksum(self):
> #assert(isinstance(self.next, packet_base) or type(self.next)
> == type(''))
> assert(isinstance(self.next, packet_base))
> assert(type(self.next) == type(''))
> 
> 
> Thanks,
> 
> Aaron
> 
> On Mon, Jun 20, 2011 at 12:19 PM, Murphy McCauley  wrote:
> > What NOX are you using?  Your udp.py does not seem to be the one in zaku
> > or destiny...
> > 
> > -- Murphy
> > 
> > On Sunday, June 19, 2011 03:34:20 PM Aaron Rosen wrote:
> >> Hello,
> >> 
> >> I'm trying to send udp packets from my controller but I'm getting the
> >> following assertion when I call udp().checksum(). I was hoping someone
> >> could point out where I'm going wrong.
> >> 
> >> Thanks,
> >> 
> >> Aaron
> >> 
> >> Traceback (most recent call last):
> >>   File "./nox/lib/util.py", line 116, in f
> >> event.total_len, buffer_id, packet)
> >>   File "./nox/coreapps/examples/sos.py", line 299, in packet_in_callback
> >> learn(dpid, inport, packet)
> >>   File "./nox/coreapps/examples/sos.py", line 56, in learn
> >> send_packet = send_udp_message()
> >>   File "./nox/coreapps/examples/sos.py", line 48, in send_udp_message
> >> l4.csum = l4.checksum()
> >>   File "./nox/lib/packet/udp.py", line 111, in checksum
> >> assert(isinstance(self.next, packet_base))
> >> AssertionError
> >> 
> >> 
> >> def send_udp_message():
> >> 
> >> l4 = udp()
> >> l4.srcport = 1999
> >> l4.dstport = 1888
> >> l4.len = udp.MIN_LEN + len("hello_world")
> >> l4.set_payload("Hello_world")
> >> 
> >> l3 = ipv4()
> >> l3.iplen = ipv4.MIN_LEN
> >> l3.protocol = ipv4.UDP_PROTOCOL
> >> l3.dstip = ipstr_to_int("130.127.39.7");
> >> l3.srcip = ipstr_to_int("1.1.1.1");
> >> l3.set_payload(l4)
> >> 
> >> l2 = ethernet()
> >> l2.set_payload(l3)
> >> l2.dst = octstr_to_array("00:00:00:00:00:02")
> >> l2.dst = octstr_to_array("a1:00:04:00:0a:04")
> >> l2.type = ethernet.IP_TYPE
> >> l3.checksum()
> >> l4.csum = l4.checksum()
> >> 
> >> return l2
> >> 
> >> 
> >> 
> >> send_packet = send_udp_message()
> >> inst.send_openflow_packet(dpid, send_packet.tostring(),
> >> openflow.OFPP_FLOOD, inport)
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


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

2011-06-20 Thread Aaron Rosen
Hi Murphy,

I'm using zaku but the one in destiny looked the same to be.

I changed to assert to be on two lines so I could see which one was firing.

def checksum(self):
#assert(isinstance(self.next, packet_base) or type(self.next)
== type(''))
assert(isinstance(self.next, packet_base))
assert(type(self.next) == type(''))


Thanks,

Aaron

On Mon, Jun 20, 2011 at 12:19 PM, Murphy McCauley  wrote:
> What NOX are you using?  Your udp.py does not seem to be the one in zaku or
> destiny...
>
> -- Murphy
>
> On Sunday, June 19, 2011 03:34:20 PM Aaron Rosen wrote:
>> Hello,
>>
>> I'm trying to send udp packets from my controller but I'm getting the
>> following assertion when I call udp().checksum(). I was hoping someone
>> could point out where I'm going wrong.
>>
>> Thanks,
>>
>> Aaron
>>
>> Traceback (most recent call last):
>>   File "./nox/lib/util.py", line 116, in f
>>     event.total_len, buffer_id, packet)
>>   File "./nox/coreapps/examples/sos.py", line 299, in packet_in_callback
>>     learn(dpid, inport, packet)
>>   File "./nox/coreapps/examples/sos.py", line 56, in learn
>>     send_packet = send_udp_message()
>>   File "./nox/coreapps/examples/sos.py", line 48, in send_udp_message
>>     l4.csum = l4.checksum()
>>   File "./nox/lib/packet/udp.py", line 111, in checksum
>>     assert(isinstance(self.next, packet_base))
>> AssertionError
>>
>>
>> def send_udp_message():
>>
>>     l4 = udp()
>>     l4.srcport = 1999
>>     l4.dstport = 1888
>>     l4.len = udp.MIN_LEN + len("hello_world")
>>     l4.set_payload("Hello_world")
>>
>>     l3 = ipv4()
>>     l3.iplen = ipv4.MIN_LEN
>>     l3.protocol = ipv4.UDP_PROTOCOL
>>     l3.dstip = ipstr_to_int("130.127.39.7");
>>     l3.srcip = ipstr_to_int("1.1.1.1");
>>     l3.set_payload(l4)
>>
>>     l2 = ethernet()
>>     l2.set_payload(l3)
>>     l2.dst = octstr_to_array("00:00:00:00:00:02")
>>     l2.dst = octstr_to_array("a1:00:04:00:0a:04")
>>     l2.type = ethernet.IP_TYPE
>>     l3.checksum()
>>     l4.csum = l4.checksum()
>>
>>     return l2
>>
>>
>> 
>>     send_packet = send_udp_message()
>>     inst.send_openflow_packet(dpid, send_packet.tostring(),
>> openflow.OFPP_FLOOD, inport)
>



-- 
Aaron O. Rosen
Masters Student - Network Communication
306B Fluor Daniel
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


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

2011-06-20 Thread Murphy McCauley
What NOX are you using?  Your udp.py does not seem to be the one in zaku or 
destiny...

-- Murphy

On Sunday, June 19, 2011 03:34:20 PM Aaron Rosen wrote:
> Hello,
> 
> I'm trying to send udp packets from my controller but I'm getting the
> following assertion when I call udp().checksum(). I was hoping someone
> could point out where I'm going wrong.
> 
> Thanks,
> 
> Aaron
> 
> Traceback (most recent call last):
>   File "./nox/lib/util.py", line 116, in f
> event.total_len, buffer_id, packet)
>   File "./nox/coreapps/examples/sos.py", line 299, in packet_in_callback
> learn(dpid, inport, packet)
>   File "./nox/coreapps/examples/sos.py", line 56, in learn
> send_packet = send_udp_message()
>   File "./nox/coreapps/examples/sos.py", line 48, in send_udp_message
> l4.csum = l4.checksum()
>   File "./nox/lib/packet/udp.py", line 111, in checksum
> assert(isinstance(self.next, packet_base))
> AssertionError
> 
> 
> def send_udp_message():
> 
> l4 = udp()
> l4.srcport = 1999
> l4.dstport = 1888
> l4.len = udp.MIN_LEN + len("hello_world")
> l4.set_payload("Hello_world")
> 
> l3 = ipv4()
> l3.iplen = ipv4.MIN_LEN
> l3.protocol = ipv4.UDP_PROTOCOL
> l3.dstip = ipstr_to_int("130.127.39.7");
> l3.srcip = ipstr_to_int("1.1.1.1");
> l3.set_payload(l4)
> 
> l2 = ethernet()
> l2.set_payload(l3)
> l2.dst = octstr_to_array("00:00:00:00:00:02")
> l2.dst = octstr_to_array("a1:00:04:00:0a:04")
> l2.type = ethernet.IP_TYPE
> l3.checksum()
> l4.csum = l4.checksum()
> 
> return l2
> 
> 
> 
> send_packet = send_udp_message()
> inst.send_openflow_packet(dpid, send_packet.tostring(),
> openflow.OFPP_FLOOD, inport)
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


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

2011-06-20 Thread Aaron Rosen
Hello,

I was able to successfully craft my UDP packets using scapy and then
pass that to send_openflow_packet() and that seemed  to do the trick
for me. (I'm this curious what my issue is with building the packet up
using nox though).

def send_udp():
packet = scapy.Ether(type=0x800, dst="00:00:00:00:00:01",
src="00:00:00:00:00:02")/scapy.IP(dst="130.127.39.173",
src="1.1.1.1")/scapy.UDP(dport=9998, sport=)
return packet

...
inst.send_openflow_packet(dpid, str(send_udp()),
openflow.OFPP_FLOOD, inport)


Thanks,

Aaron


On Mon, Jun 20, 2011 at 8:16 AM, Aaron Rosen  wrote:
> I see if I put
>
> a = packet_base()
> l4.next = a
>
> That gets me around the first part of the assertion but then I get asserted 
> on:
>
>    assert(type(self.next) == type(''))
>
> Thanks,
>
> Aaron
>
>
>
>
>
> On Sun, Jun 19, 2011 at 6:34 PM, Aaron Rosen  wrote:
>> Hello,
>>
>> I'm trying to send udp packets from my controller but I'm getting the
>> following assertion when I call udp().checksum(). I was hoping someone
>> could point out where I'm going wrong.
>>
>> Thanks,
>>
>> Aaron
>>
>> Traceback (most recent call last):
>>  File "./nox/lib/util.py", line 116, in f
>>    event.total_len, buffer_id, packet)
>>  File "./nox/coreapps/examples/sos.py", line 299, in packet_in_callback
>>    learn(dpid, inport, packet)
>>  File "./nox/coreapps/examples/sos.py", line 56, in learn
>>    send_packet = send_udp_message()
>>  File "./nox/coreapps/examples/sos.py", line 48, in send_udp_message
>>    l4.csum = l4.checksum()
>>  File "./nox/lib/packet/udp.py", line 111, in checksum
>>    assert(isinstance(self.next, packet_base))
>> AssertionError
>>
>>
>> def send_udp_message():
>>
>>    l4 = udp()
>>    l4.srcport = 1999
>>    l4.dstport = 1888
>>    l4.len = udp.MIN_LEN + len("hello_world")
>>    l4.set_payload("Hello_world")
>>
>>    l3 = ipv4()
>>    l3.iplen = ipv4.MIN_LEN
>>    l3.protocol = ipv4.UDP_PROTOCOL
>>    l3.dstip = ipstr_to_int("130.127.39.7");
>>    l3.srcip = ipstr_to_int("1.1.1.1");
>>    l3.set_payload(l4)
>>
>>    l2 = ethernet()
>>    l2.set_payload(l3)
>>    l2.dst = octstr_to_array("00:00:00:00:00:02")
>>    l2.dst = octstr_to_array("a1:00:04:00:0a:04")
>>    l2.type = ethernet.IP_TYPE
>>    l3.checksum()
>>    l4.csum = l4.checksum()
>>
>>    return l2
>>
>>
>> 
>>    send_packet = send_udp_message()
>>    inst.send_openflow_packet(dpid, send_packet.tostring(),
>> openflow.OFPP_FLOOD, inport)
>>
>>
>>
>>
>>
>>
>> --
>> Aaron O. Rosen
>> Masters Student - Network Communication
>> 306B Fluor Daniel
>>
>
>
>
> --
> Aaron O. Rosen
> Masters Student - Network Communication
> 306B Fluor Daniel
>



-- 
Aaron O. Rosen
Masters Student - Network Communication
306B Fluor Daniel
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


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

2011-06-20 Thread Aaron Rosen
I see if I put

a = packet_base()
l4.next = a

That gets me around the first part of the assertion but then I get asserted on:

assert(type(self.next) == type(''))

Thanks,

Aaron





On Sun, Jun 19, 2011 at 6:34 PM, Aaron Rosen  wrote:
> Hello,
>
> I'm trying to send udp packets from my controller but I'm getting the
> following assertion when I call udp().checksum(). I was hoping someone
> could point out where I'm going wrong.
>
> Thanks,
>
> Aaron
>
> Traceback (most recent call last):
>  File "./nox/lib/util.py", line 116, in f
>    event.total_len, buffer_id, packet)
>  File "./nox/coreapps/examples/sos.py", line 299, in packet_in_callback
>    learn(dpid, inport, packet)
>  File "./nox/coreapps/examples/sos.py", line 56, in learn
>    send_packet = send_udp_message()
>  File "./nox/coreapps/examples/sos.py", line 48, in send_udp_message
>    l4.csum = l4.checksum()
>  File "./nox/lib/packet/udp.py", line 111, in checksum
>    assert(isinstance(self.next, packet_base))
> AssertionError
>
>
> def send_udp_message():
>
>    l4 = udp()
>    l4.srcport = 1999
>    l4.dstport = 1888
>    l4.len = udp.MIN_LEN + len("hello_world")
>    l4.set_payload("Hello_world")
>
>    l3 = ipv4()
>    l3.iplen = ipv4.MIN_LEN
>    l3.protocol = ipv4.UDP_PROTOCOL
>    l3.dstip = ipstr_to_int("130.127.39.7");
>    l3.srcip = ipstr_to_int("1.1.1.1");
>    l3.set_payload(l4)
>
>    l2 = ethernet()
>    l2.set_payload(l3)
>    l2.dst = octstr_to_array("00:00:00:00:00:02")
>    l2.dst = octstr_to_array("a1:00:04:00:0a:04")
>    l2.type = ethernet.IP_TYPE
>    l3.checksum()
>    l4.csum = l4.checksum()
>
>    return l2
>
>
> 
>    send_packet = send_udp_message()
>    inst.send_openflow_packet(dpid, send_packet.tostring(),
> openflow.OFPP_FLOOD, inport)
>
>
>
>
>
>
> --
> Aaron O. Rosen
> Masters Student - Network Communication
> 306B Fluor Daniel
>



-- 
Aaron O. Rosen
Masters Student - Network Communication
306B Fluor Daniel
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] gathering status of Openflow Switch

2011-06-20 Thread Kyriakos Zarifis
Hi,

you are probably using the branch of the repository and not destiny. Take a
look at the first reply above, which explains that the monitoring component
is only on the Destiny branch, and how to get it.

(Using Destiny is suggested at this point, as it is more up-to-date version
of nox with several bug fixes and features. In any case, the example code in
"monitor" which you already looked at probably answers your question.)

2011/6/19 Min-Hyup KANG 

>   Thanks for your kindness.
>
>
> But there is not exsisting monitoring.py of netapps/
>
> so there is existing some derectory in netapps as a below.
>
>
> 
>
> src/nox/netapps# ls
>
> Makefile.am  __init__.pybindings_storage  discovery hoststate
>  networkstate  routing  switch_management  tablog  topology
>
> Makefile.in  authenticator  data  flow_fetcher  lavi
> route storage  switchstatstests   user_event_log
>
> 
>
>
> additionally, I re-write some code(0xfff) in monitor.py refering mail.
> as a below,
>
>
> """
>
> def aggregate_timer(self, dpid):
>
> flow = ofp_match()
>
> #flow.wildcards = 0x
>
> flow.wildcards = 0x
>
> self.ctxt.send_aggregate_stats_request(dpid, flow,  0xff)
>
> self.post_callback(MONITOR_TABLE_PERIOD, lambda :
> self.aggregate_timer(dpid))
> """
>
> 1.What does 0xfff mean ?
> and then, I re-run command.
>
> So, I can check below message.
> 00086|openflow-event|DBG:received stats reply from 002320c2f7b4
> Aggregate stats in from datapath 00:23:20:c2:f7:b4
> {'packet_cout' : 39L, 'byte_cout' : 3822L, 'flow_count':2L }
>
>
>
> - 원본 메일 -
>
> *보낸사람*: Kyriakos Zarifis 
> *받는사람* : Min-Hyup KANG 
> *참조* : nox-dev@noxrepo.org
> *날짜*: 2011년 6월 20일 월요일, 15시 34분 01초 +0900
> *제목*: Re: [nox-dev] gathering status of Openflow Switch
> Hi,
>
> I was actually referring to netapps/monitoring/montoring.py, which is a
> more complete (and complicated) monitoring component, but it is the same
> idea. However the one you looked at might actually be a better example
> exactly because it is simpler, but still shows how to create and send switch
> query packets.
> The output you pasted looks okay
>
>
> 2011/6/19 Min-Hyup KANG 
> http://hanmail/mail/MailComposeFrame.daum?TO=kang-min-h...@hanmail.net>
> >
>
>>   Hi,
>>
>>
>> after I found monitoring.py,
>>
>> There is existing /src/nox/coreapps/examples/monitor.py.
>>
>> I think what you mean is /src/nox/coreapps/examples/monitor.py. right ?
>>
>>
>> so, I excuted monitor component.
>>
>>
>> I can check Table stats and Port stats, Aggregate stats as a below.
>>
>>
>> 00072|openflow-event|DBG:received stats reply from 002320ca92e0
>>
>> Table stats in from datapath 00:23:20:ca:92:e0
>>
>> hash2 : 0
>>
>> linear : 2
>>
>> 00073|openflow-event|DBG:received stats reply from 002320ca92e0
>>
>> Port stats in from datapath 00:23:20:ca:92:e0
>>
>> 1 : 4
>>
>> 2 : 4
>>
>> 00074|openflow-event|DBG:received stats reply from 002320ca92e0
>>
>> Aggregate stats in from datapath 00:23:20:ca:92:e0
>>
>> {'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L}
>>
>>
>>
>>
>> - 원본 메일 -
>>
>> *보낸사람*: Kyriakos Zarifis 
>> http://hanmail/mail/MailComposeFrame.daum?TO=kyr.zari...@gmail.com>
>> >
>> *받는사람* : Min-Hyup KANG 
>> http://hanmail/mail/MailComposeFrame.daum?TO=kang-min-h...@hanmail.net>
>> >
>> *참조* : 
>> nox-dev@noxrepo.org
>> *날짜*: 2011년 6월 20일 월요일, 00시 35분 26초 +0900
>>
>> *제목*: Re: [nox-dev] gathering status of Openflow Switch
>>  Hi,
>>
>> the 'monitoring' component I was referring to, is under:
>> ** / src / nox / netapps / monitoring / monitoring.py**
>>
>> but on the Destiny branch of the repository (not Zaku which is the master
>> branch).
>> Follow the instructions here
>> http://noxrepo.org/noxwiki/index.php/NOX_Installation#Installation (where
>> it says "For a branch other than master"...)
>> to switch to Destiny.
>>
>>>  -> you mean pyswitch can gather status of flow, port  in switch, right
>>> ?
>>>
>>> and I think I should use  ofp_stats_request, ofp_stats_reply,
>>> ofp_desc_stats, ofp_port_stats_request, ofp_ports_stats etc of struct in
>>> openflow.h and core.py
>>>
>>
>> Exactly. You can see some example of how to build some messages in
>> 'monitoring.py'
>>
>>
>>
>>
>>
>>
>>
>> Best Regards,
>> Min-Hyup KANG
>>
>> 
>>
>
>
>
>
>
>
>
> Best Regards,
> Min-Hyup KANG
>
> 
>
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] gathering status of Openflow Switch

2011-06-20 Thread Min-Hyup KANG



	
	
Thanks for your kindness.But there is not exsisting monitoring.py of netapps/so there is existing some derectory in netapps as a below.src/nox/netapps# lsMakefile.am  __init__.py    bindings_storage  discovery     hoststate  networkstate  routing  switch_management  tablog  topologyMakefile.in  authenticator  data              flow_fetcher  lavi       route         storage  switchstats        tests   user_event_logadditionally, I re-write some code(0xfff) in monitor.py refering mail. as a below,"""def aggregate_timer(self, dpid):         flow = ofp_match()        #flow.wildcards = 0x        flow.wildcards = 0x        self.ctxt.send_aggregate_stats_request(dpid, flow,  0xff)        self.post_callback(MONITOR_TABLE_PERIOD, lambda : self.aggregate_timer(dpid))"""1.What does 0xfff mean ?and then, I re-run command.So, I can check below message.00086|openflow-event|DBG:received stats reply from 002320c2f7b4Aggregate stats in from datapath 00:23:20:c2:f7:b4{'packet_cout' : 39L, 'byte_cout' : 3822L, 'flow_count':2L }- 원본 메일 -보낸사람: Kyriakos Zarifis 받는사람 : Min-Hyup KANG 참조 : nox-dev@noxrepo.org날짜: 2011년 6월 20일 월요일, 15시 34분 01초 +0900제목: Re: [nox-dev] gathering status of Openflow Switch

	Hi,I was actually referring to netapps/monitoring/montoring.py, which is a more complete (and complicated) monitoring component, but it is the same idea. However the one you looked at might actually be a better example exactly because it is simpler, but still shows how to create and send switch query packets.
The output you pasted looks okay2011/6/19 Min-Hyup KANG 



	
	
Hi,after I found monitoring.py,There is existing /src/nox/coreapps/examples/monitor.py.I think what you mean is /src/nox/coreapps/examples/monitor.py. right ?
so, I excuted monitor component.I can check Table stats and Port stats, Aggregate stats as a below.00072|openflow-event|DBG:received stats reply from 002320ca92e0
Table stats in from datapath 00:23:20:ca:92:e0	hash2 : 0	linear : 200073|openflow-event|DBG:received stats reply from 002320ca92e0
Port stats in from datapath 00:23:20:ca:92:e0	1 : 4	2 : 400074|openflow-event|DBG:received stats reply from 002320ca92e0
Aggregate stats in from datapath 00:23:20:ca:92:e0	{'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L}
- 원본 메일 -
보낸사람: Kyriakos Zarifis 받는사람 : Min-Hyup KANG 
참조 : nox-dev@noxrepo.org날짜: 2011년 6월 20일 월요일, 00시 35분 26초 +0900제목: Re: [nox-dev] gathering status of Openflow Switch


	Hi, the 'monitoring' component I was referring to, is under:  / src / nox / netapps / monitoring / monitoring.py

but on the Destiny branch of the repository (not Zaku which is the master branch).
Follow the instructions here http://noxrepo.org/noxwiki/index.php/NOX_Installation#Installation (where it says "For a branch other than master"...)

to switch to Destiny. 


-> you mean pyswitch can gather status of flow, port  in switch, right ?
and I think I should use  ofp_stats_request, ofp_stats_reply, ofp_desc_stats, ofp_port_stats_request, ofp_ports_stats etc of struct in openflow.h and core.py

Exactly. You can see some example of how to build some messages in 'monitoring.py' 

		







			Best Regards,
Min-Hyup KANG  


 



		







			Best Regards,
Min-Hyup KANG  


 

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


Re: [nox-dev] gathering status of Openflow Switch

2011-06-20 Thread Min-Hyup KANG



	
	
Hi,after I found monitoring.py,There is existing /src/nox/coreapps/examples/monitor.py.I think what you mean is /src/nox/coreapps/examples/monitor.py. right ?so, I excuted monitor component.I can check Table stats and Port stats, Aggregate stats as a below.00072|openflow-event|DBG:received stats reply from 002320ca92e0Table stats in from datapath 00:23:20:ca:92:e0	hash2 : 0	linear : 200073|openflow-event|DBG:received stats reply from 002320ca92e0Port stats in from datapath 00:23:20:ca:92:e0	1 : 4	2 : 400074|openflow-event|DBG:received stats reply from 002320ca92e0Aggregate stats in from datapath 00:23:20:ca:92:e0	{'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L}- 원본 메일 -보낸사람: Kyriakos Zarifis 받는사람 : Min-Hyup KANG 참조 : nox-dev@noxrepo.org날짜: 2011년 6월 20일 월요일, 00시 35분 26초 +0900제목: Re: [nox-dev] gathering status of Openflow Switch

	Hi, the 'monitoring' component I was referring to, is under:  / src / nox / netapps / monitoring / monitoring.py
but on the Destiny branch of the repository (not Zaku which is the master branch).
Follow the instructions here http://noxrepo.org/noxwiki/index.php/NOX_Installation#Installation (where it says "For a branch other than master"...)
to switch to Destiny. 

-> you mean pyswitch can gather status of flow, port  in switch, right ?
and I think I should use  ofp_stats_request, ofp_stats_reply, ofp_desc_stats, ofp_port_stats_request, ofp_ports_stats etc of struct in openflow.h and core.py
Exactly. You can see some example of how to build some messages in 'monitoring.py' 

		







			Best Regards,
Min-Hyup KANG  


 

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