Skip to content

pcn-firewall: implement datapath optimizations#147

Merged
frisso merged 5 commits intomasterfrom
pr/firewall_datapath_optimizations
Jun 18, 2019
Merged

pcn-firewall: implement datapath optimizations#147
frisso merged 5 commits intomasterfrom
pr/firewall_datapath_optimizations

Conversation

@mbertrone
Copy link
Copy Markdown
Contributor

pcn-firewall: introduce datapath pipeline early break
this commit introduces the support for some firewall
filtering pipeline modules to early break the pipeline
if no rule is matched.

the idea is that during the execution of the pipeline
some modules are implemented in a way in wich the cost
of checking if the resulting bitvector is all zero
is almost negligible.

this support enables to speedup the execution since is no
longer needed to go through all the pipeline modules
if this condition is matched.

pcn-firewall: dynamic pipeline reordering
this commit introduces support for pipeline reordering.

in case some filtering pipeline blocks can early break
the pipeline, those modules are injected before others.

pcn-firewall: update connection tracking module
this commit introduces the same connection tracking
module used by pcn-iptables

Main features:

  • avoid double lookup by ordering hashmap keys
  • avoid to call bpf_ktime_get_ns() by introducing
    a customized timestamp written by control plane

pcn-firewall: add HORUS optimization
HORUS - Homogeneous RUleset analySis

Horus optimization allows to
a) offload a group of contiguous rules matching on same field
b) match the group of offloaded rules with complexity O(1) - single hashmap lookup
c) dynamically adapting to different groups of rules, matching each
combination of ipsrc/dst, portsrc/dst, tcpflags
d) dynamically check when the optimization is possible according to current
ruleset. It means check orthogonality
of rules before the offloaded group, respect to the group itself.

each pkt received by the program, is looked-up vs the HORUS HASHMAP.
hit:
-DROP action: drop the packet;
-ACCEPT action: goto CTLABELING and CTTABLEUPDATE without going through pipeline
miss:
-GOTO all pipeline steps

@mbertrone mbertrone requested a review from a team as a code owner June 10, 2019 13:19
Copy link
Copy Markdown
Contributor

@acloudiator acloudiator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker-build check is failing

@acloudiator acloudiator requested a review from a team June 10, 2019 19:41
@acloudiator acloudiator added this to the PCN-Firewall milestone Jun 10, 2019
this commit introduces the support for some firewall
filtering pipeline modules to early break the pipeline
if no rule is matched.

the idea is that during the execution of the pipeline
some modules are implemented in a way in wich the cost
of checking if the resulting bitvector is all zero
is almost negligible.

this support enables to speedup the execution since is no
longer needed to go through all the pipeline modules
if this condition is matched.

Signed-off-by: Matteo Bertrone <m.bertrone@gmail.com>
this commit introduces support for pipeline reordering.

in case some filtering pipeline blocks can early break
the pipeline, those modules are injected before others.

Signed-off-by: Matteo Bertrone <m.bertrone@gmail.com>
this commit introduces the same connection tracking
module used by pcn-iptables

Main features:
- avoid double lookup by ordering hashmap keys
- avoid to call bpf_ktime_get_ns() by introducing
   a customized timestamp written by control plane

Signed-off-by: Matteo Bertrone <m.bertrone@gmail.com>
@mbertrone mbertrone force-pushed the pr/firewall_datapath_optimizations branch from c5fcece to cd585d7 Compare June 11, 2019 13:55
HORUS - Homogeneous RUleset analySis

Horus optimization allows to
 a) offload a group of contiguous rules matching on same field
 b) match the group of offloaded rules with complexity O(1) - single hashmap lookup
 c) dynamically adapting to different groups of rules, matching each
     combination of ipsrc/dst, portsrc/dst, tcpflags
 d) dynamically check when the optimization is possible according to current
     ruleset. It means check orthogonality
     of rules before the offloaded group, respect to the group itself.

each pkt received by the program, is looked-up vs the HORUS HASHMAP.
hit:
 -DROP action: drop the packet;
 -ACCEPT action: goto CTLABELING and CTTABLEUPDATE without going through pipeline
miss:
 -GOTO all pipeline steps

Signed-off-by: Matteo Bertrone <m.bertrone@gmail.com>
Signed-off-by: Matteo Bertrone <m.bertrone@gmail.com>
@mbertrone mbertrone force-pushed the pr/firewall_datapath_optimizations branch from cd585d7 to 24c9c19 Compare June 13, 2019 14:03
@frisso
Copy link
Copy Markdown
Contributor

frisso commented Jun 17, 2019

@acloudiator Can you please merge this? The problem (Docker build was failing) has gone now.

@acloudiator acloudiator requested a review from a team June 17, 2019 21:32
@acloudiator
Copy link
Copy Markdown
Contributor

@acloudiator Can you please merge this? The problem (Docker build was failing) has gone now.

@frisso Can you please be the second reviewer for this, so that this can be merged?

@frisso frisso merged commit 19b8ab7 into master Jun 18, 2019
@frisso frisso deleted the pr/firewall_datapath_optimizations branch June 18, 2019 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants