Re: Linux ping flood on localhost

Henrik Olsen (henrik@iaeste.dk)
Sat, 17 Apr 1999 10:29:16 +0200 (CEST)


On Fri, 16 Apr 1999, Richard B. Johnson wrote:
> On Fri, 16 Apr 1999, Tigran Aivazian wrote:
>
> > Hi,
> >
> > You said:
> >
> > >Ummm, If I remember correctly it was a bug in the ping program itself and
> > > not in the kernel.
> > > Just upgrade your version of ping.
> >
> > Yes, we know it is an FAQ and everybody knows the correct answer "get the
> > latest ping" but, even the best Linux distributions (you know who you
> > are!) still come with the ping(8) that says 95% packet loss on lo.
> >
> > Hope they take notice of this and correct their behaviour (while they are
> > at it I hope they also trim down the /etc/rc.d/rc.sysinit file which I
> > always have to manually shorten (by almost an order of magnitude)).
> >
>
> I think the latest ping will produce 90% packet loss on a flood to
> localhost. This was some kind of 'feature' (a side-effect) introduced
> around 2.2.x (Alan responded to this). As I understand it, ICMP replies
> are delayed by a HZ, so the maximum response-rate is 100/second. Ping
> flood tries 1000/second so you lose the flood-game.
>
> Cheers,
> Dick Johnson
Nope, the problem comes from a buggy ping that only checks for the ICMP
packet id, not whether it's a request or a reply, so croaks when counting
its own requests as replies on lo.
The problem is caused by lo being both source AND destination, so with an
ICMP echo request, ping will see both the request and the reply, and the
old buggy ping reacts on the wrong one of them, causing an eventual
buffer fill, which is why you'll see the same number of packets received
each time you try.

BTW Alan, since you're in RedHat I'd like to remind you that ping from the
RH5.2 updates is still the old buggy type:)

-- 
Henrik Olsen,  Dawn Solutions I/S       URL=http://www.iaeste.dk/~henrik/
A Pentium is a terrible thing to waste, http://www.mersenne.org/prime.htm

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/