From daf922c5febddfef6cc76316ea9592e229e6bc46 Mon Sep 17 00:00:00 2001 From: Frederic Jung Date: Sun, 25 Oct 2026 20:27:15 +0100 Subject: [PATCH] Russian Goggle throttling shrinks demand instead of counting as unserved (#70) The flow was carried in full and then halved on delivery, capping every Russian city at about 93.5% served, under the 95% customers need. Halve the Goggle share of demand at the source instead. --- CHANGELOG.md | 1 + site/index.html | 10 ++++++---- tests/regions.test.js | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f34bfc6..fc4a886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] +- Customers in Russian cities no longer get unhappy because of Goggle's throttling (#70). People there simply get, and ask for, half as much Goggle video, so a well-built network serves the whole city again and the throttled half no longer fills your links. - Four new cities in North America: Kansas City, Calgary, Vancouver and Ottawa (#76). Canada gets two more big networks, Tell Us and Bodgers Communications, which you also reach through the Tier 1s they buy transit from. Ottawa's power grid is about as reliable as you would expect, and Canadian fiber has a new natural enemy. - Reach in the top bar no longer rounds up to 100% when it is just short, and the Goals tab now says why you are not Tier 1 right now (#73). Tier 1 needs more than 99.9% reach, so one small network out of reach is enough to lose the title. - New waves can join any route you already have between two cities, so two waves can run on the main route and two on the diverse one (#77). Each extra route shows up as its own choice, priced like the route it joins. diff --git a/site/index.html b/site/index.html index 769c62a..d2906cc 100644 --- a/site/index.html +++ b/site/index.html @@ -1731,9 +1731,12 @@ function compute(){ const viral=(ev.viral>day?1.25:1)*(ev.php&&ev.php>day?0.7:1); const flows=[]; for(const c of Object.keys(S.pops)){ - const p=S.pops[c],SH=cnCity(c)?NSH_CN:ruCity(c)?NSH_RU:CITY[c].kr&&S.krExit?NSH_KRX:NSH;const eye=(p.bb?p.bb.d:0)*viral*(cnCity(c)&&ev.golden>day?1.4:1);const biz=S.biz.filter(b=>b.city===c&&!BIZ_T[b.type].l2&&!BIZ_T[b.type].fiber&&(!BIZ_T[b.type].event||eventLive(b))).reduce((a,b)=>a+b.bw,0);const d=eye+biz; + const p=S.pops[c],SH=cnCity(c)?NSH_CN:ruCity(c)?NSH_RU:CITY[c].kr&&S.krExit?NSH_KRX:NSH;const eye=(p.bb?p.bb.d:0)*viral*(cnCity(c)&&ev.golden>day?1.4:1);const biz=S.biz.filter(b=>b.city===c&&!BIZ_T[b.type].l2&&!BIZ_T[b.type].fiber&&(!BIZ_T[b.type].event||eventLive(b))).reduce((a,b)=>a+b.bw,0);const d0=eye+biz; + // Goggle video is throttled in Russia (#70): people there get half of it, so they ask for half. It is not + // traffic you failed to deliver, and it does not cross your links only to be thrown away. + const thr=n=>n==='ggl'&&ruCity(c)?0.5:1,d=d0*NETS.reduce((t,n)=>t+(SH[n.id]||0)*thr(n.id),0)/(NETS.reduce((t,n)=>t+(SH[n.id]||0),0)||1); R2.cityEye[c]=eye;R2.cityDem[c]=d;R2.citySrv[c]=0;R2.demand+=d; - for(const n of NETS)R2.demTo[n.id]=(R2.demTo[n.id]||0)+d*(SH[n.id]||0); + for(const n of NETS)R2.demTo[n.id]=(R2.demTo[n.id]||0)+d0*(SH[n.id]||0)*thr(n.id); if(!popUp(c))continue; // A shaped attack: `rtbh` is the player pulling the plug on the victim IP (junk gone, customer dark too); // `edge` is the crude RouteScript `blackhole ddos` filter (junk gone, 10% of real traffic with it). Flowspec @@ -1754,7 +1757,7 @@ function compute(){ if(edge)R2.teBlack+=atk.gbps*0.15+d*0.1;if(rtbh)R2.teBlack+=atk.gbps+d; R2.cityBlocked=R2.cityBlocked||{}; const mtuH=ev.pmtud&&ev.pmtud.until>day?ev.pmtud:null,kr=CITY[c].kr; - for(const n of NETS){const a=d*(SH[n.id]||0)*(rtbh?0:edge?0.9:1)*(mtuH&&mtuH.net===n.id?mtuH.f:1)*(kr&&ev.krroute>day&&n.id==='fbk'?0.8:1);if(a<=0)continue; + for(const n of NETS){const a=d0*(SH[n.id]||0)*thr(n.id)*(rtbh?0:edge?0.9:1)*(mtuH&&mtuH.net===n.id?mtuH.f:1)*(kr&&ev.krroute>day&&n.id==='fbk'?0.8:1);if(a<=0)continue; if(cacheNets.has(n.id)){flows.push({c,n:n.id,rem:a*0.85,cache:true});flows.push({c,n:n.id,rem:a*0.15});} else flows.push({c,n:n.id,rem:a});} } @@ -1819,7 +1822,6 @@ function compute(){ e.used+=amt;f.rem-=amt; if(!f.junk){let ok=amt;const fc=cnCity(f.c),ec=cnCity(e.city),nc=!!NET[f.n].cn; if(fc!==ec||(fc&&!nc)||(!fc&&nc&&e.k==='t')){const prem=(e.k==='t'&&e.prem)||(e.k==='p'&&e.pnc)||path.some(x=>x.links&&x.links.some(y=>y.premium));const loss=prem?0.03:(ev.gfw>day?0.35:0.2);R2.gfwLost+=amt*loss;R2.gfwCross+=amt;ok=amt*(1-loss);} - if(f.n==='ggl'&&ruCity(f.c))ok*=0.5; R2.citySrv[f.c]+=ok;R2.served+=ok;if(e.rank<=2)R2.peered+=ok;if(e.k==='t'){const m=R2.tNet[e.id]||(R2.tNet[e.id]={});m[f.n]=(m[f.n]||0)+ok;}R2.egT[e.k]=(R2.egT[e.k]||0)+ok;const ne=R2.netEg[f.n]||(R2.netEg[f.n]={c:0,p:0,ix:0,t:0});ne[e.k]+=ok;} return amt; }; diff --git a/tests/regions.test.js b/tests/regions.test.js index 25cbc49..d10e203 100644 --- a/tests/regions.test.js +++ b/tests/regions.test.js @@ -460,3 +460,18 @@ test('#76 Kansas City, Calgary, Vancouver and Ottawa, with two more Canadian gia assert.ok(ev("(S.badges||[]).includes('beaver')||!!(S.badge&&S.badge.beaver)||BADGES.find(b=>b.id==='beaver').ok()"), 'Dam It'); assert.deepEqual(errors, []); }); + +test('#70 Goggle throttling in Russia no longer counts as traffic you failed to deliver', () => { + const { ev, errors } = load(); + ev("ACT.start({});S.cash=1e9;S.lvl=4;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'});ACT.buildPop({city:'mos'});ACT.launchBB({city:'mos'})"); + ev("S.pops.fra.rgen=S.pops.mos.rgen=3;S.pops.fra.routers=S.pops.mos.routers=3;ACT.buyTransit({city:'fra',net:'cog',tier:4});ACT.lagT({id:S.transit[0].id,d:1});UI.via=null;UI.lmode='wave';openLinkModal('fra','mos');ACT.buildLink({tier:4});closeModal();S.pops.mos.bb.d=300;compute()"); + assert.equal(ev('S.links.length'), 1); + assert.ok(ev("sfOf(R,'mos')") > 0.99, `Moscow is fully served (${ev("sfOf(R,'mos')")})`); + // demand toward Goggle is half of what it would be without the throttle + const g = ev("NSH_RU.ggl"), d0 = ev("R.cityEye.mos"); + assert.ok(Math.abs(ev("R.cityDem.mos") - d0 * (1 - g / 2)) < 1e-6); + // a game-server customer judged on the city's service stays happy + ev("S.biz.push({id:'gs',name:'Startup #384',type:'game',city:'mos',bw:5,rate:120,reqs:[],mood:0.5,day:0});compute()"); + assert.equal(ev("bizWhy(S.biz.find(b=>b.id==='gs')).length"), 0, 'no complaint about bandwidth'); + assert.deepEqual(errors, []); +});