[nox-dev] Creating and sending udp packet from controller through switch

2012-01-26 Thread Bernd Wittefeld
Hi, I have a python component and want to create an udp packet in the controller and send it out via "self.send_openflow_packet(dpid, packet.tostring(), outport)" First of all: a small bugfix is needed: nox/src/nox/lib/packet/packet_base.py needs an "import array". Without that, the set_paylo

Re: [nox-dev] Creating and sending udp packet from controller through switch

2012-01-26 Thread Aaron Rosen
Hi, You need to set the length field in the Ipv4 packet. ipv4_packet.iplen = ipv4.MIN_LEN + udp_packet.len() should do the trick. Aaron On Thu, Jan 26, 2012 at 1:42 PM, Bernd Wittefeld wrote: > Hi, > I have a python component and want to create an udp packet in the controller > and send it ou

Re: [nox-dev] Creating and sending udp packet from controller through switch

2012-01-26 Thread Sabnis, Saurabh S
packet(unreach_ip,"ID") unreach_eth = ethernet() unreach_eth.src = packet.dst # I wonder what this should actually be... ? unreach_eth.dst = packet.src unreach_eth.type = packet.type unreach_eth.set_payload(unreach_ip) - Original Message - From: Aaron Rose

Re: [nox-dev] Creating and sending udp packet from controller through switch

2012-01-26 Thread Aaron Rosen
= ipv4.ICMP_PROTOCOL >        unreach_ip.srcip = packet.next.dstip # Hmm... ? >        unreach_ip.dstip = packet.next.srcip >        unreach_ip.set_payload(unreach_icmp) >        print_packet(unreach_ip,"ID") > >        unreach_eth = ethernet() >        unreach_eth.src

Re: [nox-dev] Creating and sending udp packet from controller through switch

2012-01-26 Thread Sabnis, Saurabh S
self.msg('warning, payload must be string, array or type packet_base') --Saurabh - Original Message - From: Aaron Rosen To: Saurabh S Sabnis Cc: nox-dev , Bernd Wittefeld Sent: Thu, 26 Jan 2012 15:33:45 -0500 (EST) Subject: Re: [nox-dev] Creating and sending udp packet from

Re: [nox-dev] Creating and sending udp packet from controller through switch

2012-01-27 Thread Bernd Wittefeld
ginal Message - From: Aaron Rosen To: Saurabh S Sabnis Cc: nox-dev, Bernd Wittefeld Sent: Thu, 26 Jan 2012 15:33:45 -0500 (EST) Subject: Re: [nox-dev] Creating and sending udp packet from controller through switch Here's an example of sending a UDP packet. If you want to send an ICMP pack