Search the web
Sign In
New User? Sign Up
the_gdf · The Gnutella Developer Forum (GDF)
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.

Messages

  Messages Help
Advanced
FYI: gtk-gnutella now has anti-hammering   Message List  
Reply Message #7222 of 23642 |
I've discovered a new servent, called Qtrax2, that kept hammering
and hammering, again and again.

Fed up, I've decided to code an anti-hammering engine.
It works like this:

* Each servent is allowed to make up to 10 requests / minute, within
a sliding window.
* The first time the servent crosses that threshold, a "550 Banned"
error is returned (yes, I made it up). It can be returned for both
HTTP and Gnutella connections (I realize that I don't handle 0.4
connections when I send them a 550 0.6 error, oh well!).
* At the first banning, the ban time is set to 5 minutes. It is
doubled upon each subsequent banning. During ban, we still count
requests. When the ban time expires, and if the counter is above
the threshold, we immediately reban at the next connection attempt.
* All the history is forgotten when a servent leaves its sliding window
in a non-banning state.

When banning, the error message is sent as:

HTTP/1.0 550 Banned for 2h 40m
GNUTELLA/0.6 550 Banned for 2h 40m

(that would be for a servent that keeps hammering).

I realize I'm out of specs with my 550 error, but that's precisely
why I chose that number, and why I'm communicating it to you so this
is documented and archived properly.

During banning, connections are accepted and then forgotten about.
We let them timeout on the other end and only close them when we need
new file descriptors.

Therefore, after the initial 550 error, all subsequent connections from
the same IP will be black-holed, without any feedback given.

If you wish to implement something like that in your servent, look
at the source code of gtk-gnutella, in files ban.c / ban.h, to get
the gory implementation details.

Further refinement will include the use of the "Retry-After" HTTP
header in the first 550 error, so that servents get a standard
way of knowing the banning period, without having to parse the
free-form message.

Raphael



Fri May 24, 2002 7:41 pm

Raphael_Manfredi@...
Send Email Send Email

Message #7222 of 23642 |
Expand Messages Author Sort by Date

I've discovered a new servent, called Qtrax2, that kept hammering and hammering, again and again. Fed up, I've decided to code an anti-hammering engine. It...
Raphael Manfredi
Raphael_Manfredi@...
Send Email
May 24, 2002
8:01 pm

... I believe that Qtrax only downloads, and cannot share. ... Just out of curiosity, have you considered that an existing servent is unlikely to change...
freepeers
Offline Send Email
May 25, 2002
1:54 am

I suggest you set a reasonable maximum value for the ban period, not in excess of 2 hours, instead of always doubling the ban period. Simply because this will...
Philippe Verdy
verdy_p
Offline Send Email
May 25, 2002
11:11 am

... connection). This isn't true. BearShare's "anchor" host cache service keeps an IP database of every address ever seen, and it easily handles hundreds of...
freepeers
Offline Send Email
May 25, 2002
5:01 pm

... IP ... key ... (insertion ... In C++: Just implement an IP class with an operator< and use a std::set. Efficient, fast, portable & standard compliant: ...
beatlebum1967
Offline Send Email
May 27, 2002
12:52 am

... Didn't want to turn this into a "whose code is faster" thread but I would like to point out that using your suggestion, the cost of inserting an IP address...
freepeers
Offline Send Email
May 27, 2002
3:46 pm

... the ... random...
beatlebum1967
Offline Send Email
May 27, 2002
7:03 pm

... 1) Buzz't. std::set is implemented as a red-black tree. 2) Buzz't. insersion time is log(n). Where did you get your information about std:set?...
beatlebum1967
Offline Send Email
May 27, 2002
7:06 pm

... Whoops, what I meant to say was "I don't know what they are doing, but I'm sure it can be implemented using a faster technique (but one that is optimized...
freepeers
Offline Send Email
May 27, 2002
8:11 pm

Hey, don't speak about your anchor service. This is a dedicated system, with large bandwidth and with anough CPU power to do nearly only that. I was speaking...
Philippe Verdy
verdy_p
Offline Send Email
May 26, 2002
12:51 am

... system, with ... was ... importantly ... Slow down there cowboy. The only thing I meant was that having a large number of IP addresses in an in-memory...
freepeers
Offline Send Email
May 26, 2002
12:36 pm

... do not ... blocked ... a ACK ... that you ... but long ... You seem to be commenting verbosely without having read the code. I did. This is exactly what...
peerogue
Offline Send Email
May 27, 2002
8:22 am

"peerogue" <peerogue@...> wrote: > You seem to be commenting verbosely without having read the code. > I did. This is exactly what is done in...
Michael Core
syrupdev
Offline Send Email
May 27, 2002
1:47 pm

Don't you think that adding another megabyte for passive data used randomly and continuously is another limitating factor for the efficiency of servents ? I...
Philippe Verdy
verdy_p
Offline Send Email
May 26, 2002
6:25 pm

... randomly ... servents ... In a nutshell, no. My whole point is that you are exaggerating the resource demands of keeping a permanent table (well,...
freepeers
Offline Send Email
May 26, 2002
11:20 pm

If a servent developer wants to implement a feature that you don't want in your servent, so what! Raphael saw a problem, created a solution, and was nice...
jbt00000
Offline Send Email
May 27, 2002
9:39 pm

... a ... I think the criticism was aimed at features which over-utilize the CPU, memory, bandwidth, or all three. I indicated that the particular feature did...
freepeers
Offline Send Email
May 27, 2002
9:56 pm

Don't base your assumption about the STD Library for C++ on its implementation. The Specs do not mandate any implementation (like the POSIX standard does not...
Philippe Verdy
verdy_p
Offline Send Email
May 28, 2002
12:55 am

... the POSIX ... library), and ... licence, ... different ... specification ... level classes ... Actually specific performance guarantees are part of the STL...
beatlebum1967
Offline Send Email
May 28, 2002
3:19 am

Well I did not meant that STL stinks as regard to performance. You cite a Microsoft article, using the Microsoft implementation of the STL library. The...
Philippe Verdy
verdy_p
Offline Send Email
May 29, 2002
1:23 pm

... cite a ... library. ... You stated that STL does not say anything about performance. This is 100% wrong. Performance guarantees are build into the Standard...
beatlebum1967
Offline Send Email
May 29, 2002
3:07 pm

... to ... of the ... the STL ... BearShare re-implements practically *every* linked list, sorted array, tree, etc... for each area of the program it is used,...
freepeers
Offline Send Email
May 29, 2002
6:22 pm

... trying ... benefit ... tweaking ... calls ... I guess that is why it takes ~160,000 lines to do what Gnucleus does in 30,000. Just kidding :) Seriously...
beatlebum1967
Offline Send Email
May 30, 2002
1:06 am

... does ... Its the truth!...
freepeers
Offline Send Email
May 30, 2002
1:53 am
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help