[pox-dev] To remove flow_entries and keep specific ones (wildcards)

Weiyang Mo moweiyang1988 at gmail.com
Fri Sep 28 12:19:36 PDT 2012


Hi,All

I checked the OpenFlow specification 1.0.0. In my case, I should use
OFPFC_DELETE instead of OFPFC_DELETE_STRICT since I only check two
fields(i.e match.tp_src and match.tp_dst).

And I find that although OFPFC_DELETE supports wildcards, it also has some
stricts.

For example, only using clear1.match.tp_src = 80 won't work.

We should use the following instead:
 clear1.match.dl_type = 0x800
 clear1.match.nw_proto = 6
 clear1.match.tp_src = 80

I guess that's because the match fields are also layerd, thus I cannot
match tp_src (which is layer 3) directly. I should go through dl_type(layer
2) , nw_proto (protocol) first.  Am I right?

Now it seems more clear to me but my quesion still exists. How can keep
specific TCP entries and delete others?

Thanks very much.

Weiyang



2012/9/28 Weiyang Mo <moweiyang1988 at gmail.com>

> Hi,all,
>
> I try to programme a function which deletes TCP flow entires except for
> tp_src=80,tp_dst = 25521 and tp_src=1234,tp_dst=8765  I try the following
> approches:
>
> (1) clear1 =
> of.ofp_flow_mod(match=of.ofp_match(),command=of.OFPFC_DELETE_STRICT)
>   clear2 =
> of.ofp_flow_mod(match=of.ofp_match(),command=of.OFPFC_DELETE_STRICT)
>   clear1.match.tp_src = 80
>   clear1.match.tp_dst = 25521
>   clear2.match.tp_src = 1234
>   clear2.match.tp_src = 8765
>   for switch in core.openflow._connections.values():
>     switch.send(clear1)
>     switch.send(clear2)
> I know that's the other way around,  it only deletes these two sepcific
> TCP flow entries and keeps others. However I need  keep specific ones and
> delete others.
>
> (2) I also try OFPFC_DELETE because I don't quite understand what this
> will exactly do.
>   clear1 = of.ofp_flow_mod(match=of.ofp_match(),command=of.OFPFC_DELETE)
>   clear2 = of.ofp_flow_mod(match=of.ofp_match(),command=of.OFPFC_DELETE)
>   clear1.match.tp_src =80
>   clear1.match.tp_dst = 25521
>   clear2.match.tp_src = 1234
>   clear2.match.tp_src = 8765
>   for switch in core.openflow._connections.values():
>     switch.send(clear1)
>     switch.send(clear2)
>
> In this case all flow entries are deleted disregarding my match
> fields( even delete ARP flow entry..). Does this mean that if I use
> OFPFC_DELETE, it will remove all existent entries disregarding match fields?
>
> Do you have any advice that only keeps specific TCP entries and delete
> others ( e.g in my instance, only keep tp_src=80,tp_dst = 25521 and
> tp_src=1234,tp_dst=8765)
>
> Thanks very much.
>
> Weiyang
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.noxrepo.org/pipermail/pox-dev-noxrepo.org/attachments/20120928/cb8562ca/attachment-0002.htm>


More information about the pox-dev mailing list