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

2011-06-20 Thread Kyriakos Zarifis
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 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 kyr.zari...@gmail.com
 *받는사람* : Min-Hyup KANG 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

 kang-min-h...@hanmail.net

___
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 kyr.zari...@gmail.com받는사람 : Min-Hyup KANG 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  


 

___
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 laviroute storage switchstatstests  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 = 0xflow.wildcards = 0xself.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 kyr.zari...@gmail.com받는사람 : Min-Hyup KANG kang-min-h...@hanmail.net참조 : 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 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 : 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 kyr.zari...@gmail.com받는사람 : Min-Hyup KANG 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] 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 jam...@nau.edu 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 jam...@nau.edu 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 jam...@nau.edu 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 Aaron Rosen
Thanks Murphy!

You're right, that did the trick.

Aaron

On Mon, Jun 20, 2011 at 1:55 PM, Murphy McCauley jam...@nau.edu 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 jam...@nau.edu 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 jam...@nau.edu 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


[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