Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expire rules after delay #6

Open
pudelkoM opened this issue Jun 28, 2017 · 4 comments
Open

Expire rules after delay #6

pudelkoM opened this issue Jun 28, 2017 · 4 comments

Comments

@pudelkoM
Copy link
Owner

No description provided.

@pudelkoM
Copy link
Owner Author

  • Add timestamp field in TTL_flow_data, remove tracked flag?
  • Analyzers insert timestamp from packet header
  • Swapper expires rule with {action: "delete", filter: "ip host ...", keepUntil: 123456}
  • Dumper store delete events in FIFO queue
  • Keep current ts from last packet in bucket
  • Check rule list in every iteration

@pudelkoM
Copy link
Owner Author

@emmericp
Copy link

You'll need a priority queue if the keepUntil timestamps aren't in increasing order.

I happen to have an implementation here: https://github.com/DeadlyBossMods/DeadlyBossMods/blob/master/DBM-Core/DBM-Core.lua#L1378-L1470

Or easier: insert new deletion events in the middle of the queue

@pudelkoM
Copy link
Owner Author

pudelkoM commented Jul 5, 2017

Another approach:

  • Make tracked flag an uint8_t
  • Analyzers set it to 1 for tracked, 0 means not tracked
  • Swapper increments field on flow table swap (only if prev. value was > 0)
  • Swapper expires flow when a value reaches threshold N

We can keep the table swapping interval short[1] and can control the delay: swap_interval * N.

No modification in the dumpers which are already slow.
No modification in the analyzers, they always reset the counter to 1.
Little modification in the swapper.

[1] Do we actually care about this? Why not set it to 10 mins and be done with this whole issue?

pudelkoM added a commit that referenced this issue Jul 19, 2017
@pudelkoM pudelkoM reopened this Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants