Flood Season escalates again, and empty POPs no longer hold floods for free
Every flood was 700G or more from day 1, so the scenario no longer built up. Sizes are 1.36's again (a third terabit monsters, the rest ordinary floods sized to the city), growing by the year as #153 had it. Floods go for POPs that serve someone, and a city with nobody to serve only holds a flood its tools soak up. Seeded runs over a year: no defence or one 1T center cannot win; one 1T center with full Flowspec and clean pipe wins around day 100 (main needed two centers, day 164).
This commit is contained in:
parent
4bb5e07c28
commit
31e44440e8
5 changed files with 44 additions and 21 deletions
|
|
@ -134,3 +134,22 @@ test('the China licence arrives in a tenth of the time with quick lead times, an
|
|||
assert.deepEqual(errors, []);
|
||||
}
|
||||
});
|
||||
|
||||
test('Flood Season escalates from ordinary floods to monsters, and empty POPs or no customers do not hold floods for free', () => {
|
||||
const { ev, errors } = load({ seed: 5 });
|
||||
ev("ACT.startScn({id:'flood',sure:1});S.cash=1e9;S.nextFail=1e9;S.nextEvent=1e9;ACT.launchBB({city:'ams'});ACT.buyTransit({city:'ams',net:NETS.find(n=>sellsAt(n,'ams')).id,tier:1});compute()");
|
||||
const sizes = JSON.parse(ev("const o=[];for(let i=0;i<60;i++){dayTick();for(const a of ddosAll())if(a.start===S.day)o.push(a.gbps);}JSON.stringify(o)"));
|
||||
assert.ok(sizes.some(g => g < 100), `some ordinary floods early on (${sizes.join(' ')})`);
|
||||
assert.ok(sizes.some(g => g >= 1000), 'and some terabit monsters');
|
||||
// Ten empty POPs: floods still go for Amsterdam, where the customers are.
|
||||
ev("for(const c of ['lon','par','fra','mad','mil','vie','waw','sto','osl','hel'])ACT.buildPop({city:c});compute();S.ev.ddos=null;S.ev.ddosMore=[];S.ddosStarts=[]");
|
||||
ev("for(let i=0;i<10;i++){S.ddosStarts=[];ddosAttack(false);}");
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify([...new Set(ddosAll().map(a=>a.city))])')), ['ams']);
|
||||
// A flood on a city with nobody to serve only holds if the tools soak it up.
|
||||
ev("S.ev.ddosMore=[];S.ev.ddos={id:'e',city:'lon',vec:'http',gbps:500,start:S.day,until:S.day+2,entry:{k:'edge',lab:''}};compute()");
|
||||
assert.equal(ev("R.cityDem.lon||0"), 0);
|
||||
assert.ok(ev('ddosSf(S.ev.ddos)') < 0.97, 'unmitigated: not held');
|
||||
ev("S.scrubs=[{city:'lon',tier:1}];S.scrubMode='always';compute()");
|
||||
assert.equal(ev('ddosSf(S.ev.ddos)'), 1, 'scrubbed: held');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -806,11 +806,7 @@ test('DDoS sizes use a smaller non-gaming baseline and preserve unbounded Flood
|
|||
const { ev, errors } = load();
|
||||
ev('ACT.start({});S.lvl=13;R.demand=150000;S.biz=[]');
|
||||
assert.equal(ev('ddosSizeMean()'), 20000);
|
||||
ev("S.scn={id:'flood',rules:{ddos:true}};S.day=365");
|
||||
assert.equal(ev('ddosSizeMean()'), 400000);
|
||||
ev('S.day=730');
|
||||
assert.equal(ev('ddosSizeMean()'), 600000, 'Flood Season keeps growing after completion');
|
||||
ev('S.scn=null;R.demand=300000');
|
||||
ev('R.demand=300000');
|
||||
assert.equal(ev('ddosSizeMean()'), 40000, 'larger networks can draw still larger attacks');
|
||||
ev('S.lvl=1');
|
||||
const early = ev('ddosSizeMax()');
|
||||
|
|
@ -1034,13 +1030,14 @@ test('normal attack sizes cover a broad ordinary range and a two-percent large t
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('Flood Season retains its existing size quantiles and escalation when normal attacks gain rare spikes', () => {
|
||||
test('Flood Season mixes terabit monsters with ordinary floods, and all of it grows through the year and after', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.scn={id:'flood',rules:{ddos:true}};S.lvl=3;S.biz=[];R.demand=1850");
|
||||
for (const [day,expected] of [[0,[700,1400,2099]],[365,[1400,2800,4199]],[730,[2100,4200,6299]]]) {
|
||||
ev("ACT.start({});S.scn={id:'flood',rules:{ddos:true}};S.lvl=3;S.biz=[];R.cityDem={fra:100}");
|
||||
// One draw: below a third a monster (800 to 3,400G), above it an ordinary flood up to 90% of the city's traffic.
|
||||
for (const [day,expected] of [[0,[800,3399,2,91]],[365,[1600,6799,4,183]],[730,[2400,10199,6,275]]]) {
|
||||
ev(`S.day=${day}`);
|
||||
const actual = JSON.parse(ev("const old=Math.random;let sizes;try{sizes=[0,0.5,0.999999].map(r=>{Math.random=()=>r;return ddosSize('syn')})}finally{Math.random=old}JSON.stringify(sizes)"));
|
||||
assert.deepEqual(actual, expected);
|
||||
const actual = JSON.parse(ev("const old=Math.random;let sizes;try{sizes=[0,1/3-1e-9,1/3,0.999999].map(r=>{Math.random=()=>r;return ddosSize('syn','fra')})}finally{Math.random=old}JSON.stringify(sizes)"));
|
||||
assert.deepEqual(actual, expected, `day ${day}`);
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue