NftablesRuleScaleRecipe

class lnst.Recipes.ENRT.NftablesRuleScaleRecipe.NftablesRuleScaleRecipe(**kwargs)

Bases: SimpleNetnsRouterRecipe, NftablesMixin

This recipe combines SimpleNetnsRouterRecipe and NftablesMixin for testing routing throughput impact of specific nftables rules. To generate meaningful results, the rule is simply repeated multiple times, thereby amplifying the impact. Rules are added to host2’s forwarding hook which routes test traffic between host1 and a local netns.

Parameters:
  • chainspec (StrParam (default “type filter hook forward priority filter”)) – The hook spec of the chain to add rules to.

  • rule (StrParam representing the nftables rule.) – The actual rule to insert repeatedly into the router’s forwarding chain.

  • scale (IntParam > 0) – The number of times to insert rule into the ruleset.

  • flowtable (BoolParam (default False)) – Whether to offload established connections to a flowtable or not. Besides creating a flowtable hooking into router’s input and output interfaces, this will append a final rule matching on conntrack state ‘established’ and adding the flow.