Send queue a necessity?

Talk about pretty much anything here, but DO NOT USE FOR SUPPORT.

Moderator: Supporters

Post Reply
nslay
Posts: 7
Joined: Sun Oct 14, 2012 5:11 pm

Send queue a necessity?

Post by nslay » Sun Oct 14, 2012 5:15 pm

I used to develop Battle.net bots about 10 years ago (for fun). Every bot needed a timed send queue or the server would disconnect them for flooding.

Does the same apply for IRC? IRC servers appear to be more forgiving. If not, would it be considered polite to have such a feature on an IRC bot?

Stealth
Head of Support
Posts: 2086
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: Send queue a necessity?

Post by Stealth » Sun Oct 14, 2012 6:37 pm

IRC is designed the same way, as well with many other online services.

The reason for this is by design for stability, security, and most importantly how information is transferred over the internet. If a server allowed any connected client to send as much information as fast as they wanted, a few things will happen when a connected client does so. The first would be the obvious, which is the affect that one connection has on the overall bandwidth of the server's connection to the internet. The next thing down the line would be the amount of memory and processing power the server would need to use. The more data being received, the more the server will need to buffer before processing, and the more process cycles the server would need to do to get all the information processed. Servers all implement buffers or queues to store the information received before processing. These buffers are all a static size, and will vary depending on server. When these buffers fill up, the server will disconnect the client to prevent a "buffer overrun" which could lead to either a crash or remote code execution exploit (meaning someone running outside of a buffer will use unallocated memory to put their own program in and execute it through the overflowed server). Now when all these are combined and a server doesn't disconnect clients that are filling up it's buffer, what happens is a DDoS (Distributed Denial of Service) attack. Imagine if you have 100 remote clients connect to a vulnerable server and send as much data as they can. If the server didn't cut them off, they would be able to consume the entire bandwidth of the server or potentially crash the server causing the server to go offline.

TL;DR: All servers have a specifically allocated buffer or queue in memory that fills up causing you to be disconnected to keep the server stable and secure.

nslay
Posts: 7
Joined: Sun Oct 14, 2012 5:11 pm

Re: Send queue a necessity?

Post by nslay » Sun Oct 14, 2012 6:50 pm

Thanks for your prompt response.

It's not as obvious on IRC as it is on Battle.net. If I remember correctly, if you sent as little as 3-4 messages too quickly, you were disconnected immediately from Battle.net. IRC seems to be more forgiving.

Stealth
Head of Support
Posts: 2086
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: Send queue a necessity?

Post by Stealth » Sun Oct 14, 2012 6:57 pm

With a comparison such as that, IRC will allow more flow of messages.

UnrealIRCd has a queue, and will apply a delay to messages in that queue when they are sent rapidly. Usually the first 4-5 messages go through without delay, but anything after that will have an increased delay.

Post Reply