Since this hasn't been quickly resolved, I thought it might be worth
seeing if this is nothing to do with your NOX code, but to do with your
network configuration instead.

If you run ./nox_core with no components specified, do all your packets
from NEIGHBOR go through?  They *should* all die, but I think this is
worth checking.  It's entirely possible to set up a configuration where
Linux forwards them out of NOX's control.

Also, I may have missed this in one of the other messages, but what
OpenFlow switch are you running?

-- Murphy

On Mon, 2010-07-12 at 15:14 +0100, i...@cs.nott.ac.uk wrote:
> Hi Everyone,
> 
> I am running NOX and openflow on the same machine. I am coding the NOX 
> controller in C++. I am trying to write code to selectively drop packets. 
> For a quick test I tried to write code that would drop HTTP (i.e. tcp dst 
> port 80) packets.
> 
> The code correctly identifies the HTTP packet and it calls the 
> send_openflow_command with no action. However the packets are not getting 
> dropped. Below is initialisation of the openflow mod structure. Which is 
> sent in the command.
> 
>       // setup the header
>       ofm.header.version = OFP_VERSION;
>       ofm.header.type = OFPT_FLOW_MOD;                
>       ofm.header.length = htons(sizeof ofm);  // no extended action data
>       
>       // match the flow - therefore no wild-cards!
>       ofm.match.wildcards = htonl(0);
>       ofm.match.in_port = htons(flow.in_port);                
>       ofm.match.dl_vlan = flow.dl_vlan;
>       memcpy(ofm.match.dl_src,flow.dl_src.octet,sizeof ofm.match.dl_src);
>       memcpy(ofm.match.dl_dst,flow.dl_dst.octet,sizeof ofm.match.dl_dst);
>       ofm.match.dl_type = flow.dl_type;       
>       ofm.match.nw_src = flow.nw_src;
>       ofm.match.nw_dst = flow.nw_dst;
>       ofm.match.nw_proto = flow.nw_proto;
>       ofm.match.tp_src = flow.tp_src;
>       ofm.match.tp_dst = flow.tp_dst;
>       
>          // add an entry - initalise entry housekeeping variables (see page 
> 28 of OF spec)
>       ofm.command = htons(OFPFC_ADD);
>       ofm.buffer_id = htonl(packetid);        
>       ofm.idle_timeout = htons(OFP_FLOW_PERMANENT);
>       ofm.hard_timeout = htons(OFP_FLOW_PERMANENT);                           
>       ofm.priority = htons(OFP_DEFAULT_PRIORITY);
>       ofm.flags = OFPFF_CHECK_OVERLAP;
> 
> When I run dpctl dump-flows on the switch I get 
> 
>   cookie=14431522174269325312, duration_sec=15s, duration_nsec=832000000s, 
> table_id=0, priority=65535, n_packets=3, n_bytes=222, 
> idle_timeout=0,hard_timeout=0,tcp,in_port=1,dl_vlan=0xffff,dl_vlan_pcp=0x00,dl_src=00:07:e9:ae:04:c7,dl_dst=00:13:d3:c0:46:f2,nw_src=192.168.1.1,nw_dst=91.189.88.31,nw_tos=0x00,tp_src=58891,tp_dst=80,actions=
> 
> 
> Any ideas on what I am doing wrong?
> 
> thanks in advance
> Iain
> 
> 
> 
> 
> _______________________________________________
> 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

Reply via email to