LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: random SYN-drop function

To: Wensong Zhang <wensong@xxxxxxxxxxxx>
Subject: Re: random SYN-drop function
Cc: Ratz <ratz@xxxxxx>, lvs-users@xxxxxxxxxxxxxxxxxxxxxx, cluster-list@xxxxxxxxxx
From: Julian Anastasov <uli@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Mar 2000 08:41:18 +0200 (EET)
        Hello,

On Thu, 16 Mar 2000, Wensong Zhang wrote:

> >     May be we can make sltimer_handler() to set the drop rate
> > by this way:
> > 
> > 0 - don't drop (normal)
> > 1 - drop each (may be until the next second)
> > 2 - drop 1/2
> > 3 - drop 1/3
> > n - drop 1/n
> > 
> >     We can use simple counter: once zeroed we drop a SYN
> > frame.

        I have thought about something like this:

        if (rate) {
                if (!--counter) {
                        counter = rate;
                        drop packet
                }
        }
        accept this packet

        sltimer_handler() {
                counter = rate = the_big_formula
        }

        Currently, the formula is not complex and can be put
in the packet handler. But as in above example we can evaluate the
rate in the time handler too, as in the LVS 0.9.[89]. We can use
rate=0 in normal situations and to put a free memory as value
for the rate after some checks, of course.

        So, if we decide to drop packets before forwarding them,
we can use such simple drop mechanism. Rate means: "drop 1/rate
packets". If the rate is evaluated in the time handler it is valid
for one second. rate=1 is total block. counter and rate are global
for all kind of the entries: TCP/UDP

Regards

--
Julian Anastasov <uli@xxxxxxxxxxxxxxxxxxxxxx>



<Prev in Thread] Current Thread [Next in Thread>