Well, firstly, note that this is only installing a flow rule and a packet match for a source port of 53. This means it's likely to only get replies from a server -- not requests (which have a *destination* port of 53). So if you're looking for requests, change these. If you're looking for both, add another flow and another packet match.
Secondly, note that the installed flow is actually not good. Specifically, it says [0, openflow.OFPP_CONTROLLER], which means to send *zero bytes* of the packet to the controller. This is clearly a bug. Change the zero to something bigger (0xffff would be an easy choice). And, as you said, you'll want to keep pyswitch from installing flows for these or install a flow with a higher priority (it's an argument to install_datapath_flow), since you want the packet_ins. -- Murphy On Aug 19, 2011, at 4:30 AM, ibrahim mun wrote: > Hi Again, > I've noted that "Packet_match_event" is not included in nox/src/etc/nox.json, > so I added it like: > > "Packet_match_event":[ > "dnsspy" > ], > > but it doesn't work. > > Also I tried : > > "Packet_in_event": [ > "dnsspy", > "trackhost_pktin", > ... > "cswitchstats" > ], > > but it doesn't work niether. > > The problem is that "self.register_for_packet_match(self.handle_dns, 0xffff, > match_src)" is NEVER triggerd!! > > According to the code (below) in dnsspy, every dns packet should be sent to > the controller (even if the switch already knows the route to the dns > server), right?? > > # Make sure we get the full DNS packet at the Controller > self.install_datapath_flow(dpid, > { core.DL_TYPE : ethernet.ethernet.IP_TYPE, > core.NW_PROTO : ipv4.ipv4.UDP_PROTOCOL, > core.TP_SRC : 53 }, > openflow.OFP_FLOW_PERMANENT, > openflow.OFP_FLOW_PERMANENT, > [[openflow.OFPAT_OUTPUT, [0, > openflow.OFPP_CONTROLLER]]]) > > Thank you very much, > Ibrahim > > From: ibrahim.me...@alumnos.upm.es > To: jam...@nau.edu > CC: nox-dev@noxrepo.org > Subject: RE: [nox-dev] Adding DNS functionality to nox > Date: Fri, 19 Aug 2011 11:02:28 +0200 > > Hi Murphy, All, > This may be a silly question but I can't figure it out! it seems that dnsspy > component in not matching the dns packet because the packet is handled by the > switch component, should I modify priority of components (how)? or all > packets are treated by all components? > > I run: > ./nox_core -v -i ptcp: pyswitch dnsspy > > in dnsspy.py I have: > > def handle_dns(self, dpid, inport, ofp_reason, total_frame_len, buffer_id, > packet): > log.msg("****It matches!!**** " ) > > but nox doesn´t show any "****It matches!!****" message, also tcpdump eth > shows taht dns packets are sent to switch. > > Thanks, > Ibrahim > > > > Subject: Re: [nox-dev] Adding DNS functionality to nox > From: jam...@nau.edu > Date: Thu, 18 Aug 2011 01:34:28 -0700 > CC: nox-dev@noxrepo.org > To: ibrahim.me...@alumnos.upm.es > > You're not missing anything; that's about it. > > -- Murphy > > On Aug 18, 2011, at 1:30 AM, ibrahim mun wrote: > > Hi, I'm using zaku, I wonder if I can use dnsspy.py to add basic dns > functionality to NOX. > As I understand, Running the dnsspy component will allow nox to match and > parse DNS packets, so I can modify "handle_dns" to create a DNS replay and > send it out to the inport, right? Am I missing something? > > 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