Concept of "throttling". That is number of New Registration request Per Second allowed to bypass Natpass from client toward server (Registrar)
throttling = Regular UnderDDOS
- "Regular" - Number of new Registration per sec allowed when DDOS Shield is not set. Default: 0. Value: 0 means that throttling is turned Off, and there is no limitation.
- "UnderDDOS" - Number of new Registration per sec allowed when DDOS Shield is set. Default: 20 Important. If that value set to -1, than No New Registration allowed at all.
Natpass requires every device to reregister every 30 sec (by default) in order to hold pinhole in clients firewall open. Let assume we have 100 thousands active devices. In regular circumstances when all registrations distributed evenly in time and every device has 3600 sec (1 hour - default in SIP) registration period, Natpass would bypass to Registrar about (100000/3600=27.77) ~30 registration per sec.
In case of recovery after network outage, box crashes, or Natpass was just restarted, all 100K devices would try to re-register within 30 sec. and that is (100000/30=3333.33) more that 3 thousand Registrations per sec bypassed to Registrar, which is in two orders of magnitude more that regular rate. Registrar may be not powerful enough to handle that traffic and could crashes itself. That is described as "Avalanche Restart" effect in RFC 5390 - Requirements for Management of Overload in SIP That the reason why it may sense to set first param of "throttling=" to not zero value. That would prevent Avalanche Restart effect even when there is no DDOS attack. In production system a value of 200 is recommended, even the Registrar can handle much bigger load.</p></p>
<p>Concept of "DDOS Shield"<p>When DDOS shield is not set, any SIP messages (INVITE, OPTIONS, MESSAGE, INFO,...) bypassed from client to server w/o any limitations, regardless of registration status of the client. That maybe that devices didn't receive response for registration yet, but still allowed to place a call.</p>
<p>When DDOS shield is set, ONLY registered devices (Registration cached in Natpass) allowed to send anything to server.</p> <p>Second param in "throttling=" specifies how many new registration (from not registered devices) would be allowed to bypass Natpass toward server (Registrar) Default: 20
DDOS shield would never prevent normal SIP call flow from devices that were already registered, but significantly decrease registration attempt from new devices (possible attackers).
Set second param in "throttling=" to -1 would completely prohibit new registration while DDOS shield is set. All existing (already registered) devices may still Re-register w/o any problem. That could have a negative effect, because if legitimate device (not an attacker) lost registration it would never be able to re-register again until DOS Shield is removed.</p>
<p>However if there is massive DDOS going on it may sense to have that param set to -1, which would at least protect all current users. That is important to understand that all of described DOS prevention parameters are dynamic and could be changed on fly w/o restart Natpass. Signal SIGHUP sent to Natpass forces it to reread config file.</p>
<p>There is one more parameter:</p>
<p>dos_whitelist = xxx.xxx.xxx.xxx/mask</p> <p>Example:</p> <p>dos_whitelist = 127.0.0.1/8</p> <p>dos_whitelist = 66.153.122.0/24</p> <p>It specifies network segment which never considered as an attacker. You may specify multiple "dos_whitelist=" lines