dhcpkit.ipv6.server.extensions.rate_limit package

Handler to rate limit clients that keep rapidly sending requests.

class dhcpkit.ipv6.server.extensions.rate_limit.RateLimitHandler(key=<function duid_key>, rate: int = 5, per: int = 30, burst: int = None)[source]

Bases: dhcpkit.ipv6.server.handlers.Handler

Handler to rate limit clients that keep rapidly sending requests.

The most common reason that clients keep sending requests is when they get an answer they don’t like. The best way to slow them down is to just stop responding to them.

pre(bundle: dhcpkit.ipv6.server.transaction_bundle.TransactionBundle)[source]

Check the rate of incoming requests from this client and stop processing when a client sends too many requests.

Parameters:bundle – The transaction bundle