diff --git a/CHANGELOG.md b/CHANGELOG.md index ed18842..3efbda0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project are documented here. The project follows [Semantic Versioning](https://semver.org/). Each release is deployed to [seriesoftub.es](https://seriesoftub.es). +## [Unreleased] + +- Auto-TE: from customer level 3 you can install a traffic-engineering + controller in the NOC tab. When the shortest path is full, the overflow + spills onto up to two alternate paths with free capacity instead of being + dropped. Without it, traffic still reroutes around failures, but a full + link stays full, just like a real IGP. + ## [1.6.0] — 2026-10-23 - South America is on the map properly: Fortaleza, Rio de Janeiro, Buenos diff --git a/site/index.html b/site/index.html index 99b1c88..ab085ad 100644 --- a/site/index.html +++ b/site/index.html @@ -418,7 +418,7 @@ const POP_COST=20000, POP_MO=1500, EYE_RATE=150, CACHE_CAP=100, CACHE_MO=400; const DAY_MS=2500, ROUTER_COST=15000, ROUTER_MO=1500, GEN_COST=12000, GEN_MO=600, DIVERSE=1.4; const RU_BOX=40000, RU_BOX_MO=2000; const UAE_LIC=15000; -const SITE2_COST=45000,SITE2_MO=3000; +const SITE2_COST=45000,SITE2_MO=3000,TE_COST=60000,TE_MO=4000; const SITE2_N=['The Other Building','Campus B (the one with parking)','Across-the-River DC','The Annex','Suburban Mega-shed','The Cheaper One','Formerly a Shopping Mall','Bunker Two']; const siteName=(c,s)=>s==='b'?SITE2_N[hstr(c)%SITE2_N.length]:CITY[c].dc; const popCost=c=>POP_COST+(c&&CITY[c]&&CITY[c].ru?RU_BOX:0)+(c&&CITY[c]&&CITY[c].uae?UAE_LIC:0); @@ -1034,6 +1034,15 @@ function compute(){ for(const l of path){res[l.id]-=amt;eload[l.id]=(eload[l.id]||0)+amt;const rec=R2.ef[l.id]||(R2.ef[l.id]={eg:{},net:{},dst:{}});rec.eg[ek]=(rec.eg[ek]||0)+amt;rec.net.l2vpn=(rec.net.l2vpn||0)+amt;rec.dst[B]=(rec.dst[B]||0)+amt;}} minF=Math.min(minF,amt/b.bw);tot+=amt;} R2.l2lat[b.id]=maxLat;R2.l2[b.id]=b.bw*minF;R2.egT.l2=(R2.egT.l2||0)+tot;if((b.reqs||[]).includes('diverse'))R2.div[b.id]=diversePaths(b.city,b.city2);} + const TE=!!(S.te&&S.te.on);R2.teMoved=0;const teCache={}; + const spPath=(sp,src,dst)=>{const path=[],ns=[dst];let v=dst;while(v!==src){const l=sp.prev[v];path.push(l);v=l.a===v?l.b:l.a;ns.push(v);}return {path,ns};}; + const altPath=(src,dst,base)=>{const key=src+'>'+dst,c0=teCache[key]; + if(c0===false)return null;if(c0&&c0.path.every(l=>res[l.id]>1e-3)&&c0.ns.every(n=>nres[n]===undefined||nres[n]>1e-3))return c0; + const dist={[src]:0},prev={},done=new Set(); + for(;;){let u=null,ud=Infinity;for(const k in dist)if(!done.has(k)&&dist[k]2*base+60){teCache[key]=false;return null;} + const P=spPath({prev},src,dst);teCache[key]=P;return P;}; for(let rank=0;rank<5;rank++){ const Er=E.filter(e=>(e.pref==='low'?4:e.rank)===rank);if(!Er.length)continue;const sorted={}; for(const f of flows){ @@ -1043,11 +1052,10 @@ function compute(){ const cands=srt.filter(e=>e.used{ - let amt=Math.min(want,f.rem,e.cap-e.used);if(amt<=1e-6)return; - const path=[],ns=[e.city];let v=e.city;while(v!==f.c){const l=sp.prev[v];path.push(l);v=l.a===v?l.b:l.a;ns.push(v);} + // Push up to `want` along one path to exit e; returns what fitted. + const push=(e,P,want)=>{const path=P.path,ns=P.ns;let amt=want; for(const l of path)amt=Math.min(amt,res[l.id]);for(const n of ns)if(nres[n]!==undefined)amt=Math.min(amt,nres[n]); - if(amt<=1e-6)return; + if(amt<=1e-6)return 0; for(const n of ns)if(nres[n]!==undefined){nres[n]-=amt;R2.nodeLoad[n]=(R2.nodeLoad[n]||0)+amt;} const ek=e.k+':'+e.id;R2.egDesc[ek]={lab:e.lab,city:e.city,k:e.k}; for(const l of path){res[l.id]-=amt;eload[l.id]=(eload[l.id]||0)+amt;const rec=R2.ef[l.id]||(R2.ef[l.id]={eg:{},net:{},dst:{}});rec.eg[ek]=(rec.eg[ek]||0)+amt;const nk=f.junk?'junk':f.n;rec.net[nk]=(rec.net[nk]||0)+amt;rec.dst[f.c]=(rec.dst[f.c]||0)+amt;} @@ -1056,6 +1064,14 @@ function compute(){ 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;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; + }; + // Shortest path first. With Auto-TE, whatever does not fit spills onto up to two alternate paths + // with free capacity, as long as they are no more than twice as long. + const send=(e,want)=>{ + let room=Math.min(want,f.rem,e.cap-e.used);if(room<=1e-6)return; + room-=push(e,spPath(sp,f.c,e.city),room); + if(TE&&room>1e-6&&f.rem>1e-6&&e.used1e-6;k++){const P=altPath(f.c,e.city,sp.dist[e.city]);if(!P)break;const m=push(e,P,Math.min(room,e.cap-e.used));if(m<=1e-6)break;room-=m;R2.teMoved+=m;} }; const gk=e=>(e.pref==='high'?0:1); for(let i=0;i1e-6;){ @@ -1080,7 +1096,7 @@ function compute(){ C.pni=S.pni.reduce((a,p)=>a+PORT[p.tier].pni*(p.n||1)+(NET[p.net].pol==='paid'?NET[p.net].paidFee:0),0); C.caches=S.caches.length*CACHE_MO; C.loans=(S.loans||[]).reduce((a,l)=>a+(BANKS[l.bank].equity?0:l.pay),0); - C.extras=(S.cnLic&&S.cnLic.state==='ok'?CN_JV_MO:0)+(S.scrubAt?SCRUB_MO:0)+Object.keys(S.pops).filter(ruCity).length*RU_BOX_MO+Object.values(S.pops).filter(p=>p.site2).length*SITE2_MO; + C.extras=(S.cnLic&&S.cnLic.state==='ok'?CN_JV_MO:0)+(S.scrubAt?SCRUB_MO:0)+Object.keys(S.pops).filter(ruCity).length*RU_BOX_MO+Object.values(S.pops).filter(p=>p.site2).length*SITE2_MO+(S.te?TE_MO:0); V.eyeballs=0;V.business=0;V.ix=0; for(const c in S.pops){const sf=sfOf(R2,c);V.eyeballs+=R2.cityEye[c]*sf*EYE_RATE*(CITY[c].arpu||1);} for(const b of S.biz){const sf=BIZ_T[b.type].fiber?(fiberOk(b)?1:0):BIZ_T[b.type].l2?clamp((R2.l2[b.id]||0)/b.bw,0,1):sfOf(R2,b.city);V.business+=b.bw*b.rate*Math.min(1,sf/0.95);} @@ -1554,6 +1570,8 @@ const ACT={ dkWalk:()=>{const dk=dkState();dk.q=null;closeModal();toast('DE-KICKS will "circle back".
Expect an email titled "Quick question 🙂" within the hour.','');}, dkOptOut:({city,n})=>{const dk=dkState(),k='dk'+city+n;if(UI.confirm!==k){UI.confirm=k;renderPanel();return;}dk.add[city]=(dk.add[city]||[]).filter(x=>x.n!==n);UI.confirm=null;S.stats.optouts=(S.stats.optouts||0)+1;toast(`Opted out of ${esc(n)}.
It took four clicks, a survey and a "we're sad to see you go" page.`,'good');after();}, dkStay:({city})=>{const dk=dkState();dk.ret[city]=S.day+180;dk.retUsed[city]=true;UI.confirm=null;closeModal();toast(`40% off ${esc(ixName(city))} for 6 months.
Your account manager is relieved. Read the small print later.`,'good');after();}, + buyTE:()=>{if(S.te)return;if(lvl()<3){toast('Auto-TE unlocks at customer level 3.','bad');sfx('err');return;}if(!spend(TE_COST))return;S.te={on:true,day:S.day};toast('Auto-TE is live.
The controller now pushes overflow onto alternate paths whenever the shortest one is full.','good');after();}, + teToggle:()=>{if(!S.te)return;S.te.on=!S.te.on;after();}, addSite:({city})=>{const p=S.pops[city];if(!p||p.site2)return;if(!spend(SITE2_COST))return;p.site2=true;p.site2Day=S.day;toast(`Second site live in ${CITY[city].name}.
${esc(siteName(city,'b'))} is joined to ${esc(siteName(city,'a'))} by your own metro ring. Move some uplinks there from the Transit and Peering tabs.`,'good');sfx('build');after();}, rmSite:({city})=>{const p=S.pops[city];if(!p||!p.site2)return;if(UI.confirm!=='site'+city){UI.confirm='site'+city;renderPanel();return;}UI.confirm=null;p.site2=0;p.sdown=null;p.ringcut=0;for(const t of S.transit)if(t.city===city)t.site='a';for(const x of S.pni)if(x.city===city)x.site='a';if(S.ixSite)delete S.ixSite[city];after();}, siteSet:({k,id,s})=>{if(s!=='a'&&s!=='b')return;if(k==='t'){const t=S.transit.find(x=>x.id===id);if(t)t.site=s;}else if(k==='p'){const x=S.pni.find(x=>x.id===id);if(x)x.site=s;}else if(k==='ix'&&S.ixp[id]!==undefined){S.ixSite=S.ixSite||{};S.ixSite[id]=s;}after();}, @@ -1746,8 +1764,10 @@ function renderLeft(){ h+=`
${btn('Open NOC dashboard','dash',{},'pink')}
`; h+=`

Your Network Operations Center. Every notification also lands here. Things fail all the time on the internet. Redundant links and multiple upstreams let traffic reroute by itself.

`; h+=`
DDoS scrubbing${S.scrubAt?'On · '+CITY[S.scrubAt].name:'None (build one from a POP\'s Infra tab)'}
`; + h+=S.te?`
Auto-TE${S.te.on?`On · moving ${fmtG(R.teMoved||0)} onto alternate paths`:'Off'}
${btn(S.te.on?'Turn Auto-TE off':'Turn Auto-TE on','teToggle',{},'ghost sm')}
` + :`
Auto-TE${lvl()<3?'Unlocks at customer level 3':'Not installed'}

Traffic takes the shortest path, even when it is full. A traffic-engineering controller spills the overflow onto the next-best paths with room.

${btn(`Install Auto-TE ${fmt$(TE_COST)} + ${fmt$(TE_MO)}/mo`,'buyTE',{},'pink sm',lvl()<3||S.cash`; const hot=S.links.filter(l=>!linkDown(l)&&capOf(l)>0&&(R.load[l.id]||0)/capOf(l)>=0.85).sort((a,b)=>(R.load[b.id]/capOf(b))-(R.load[a.id]/capOf(a))); - if(hot.length){h+=`

Congested links

`+hot.map(l=>`
${CITY[l.a].name} ⇄ ${CITY[l.b].name}
${capName(l)} · ${pct((R.load[l.id]||0)/capOf(l))} full
${btn('Inspect','selLink',{id:l.id},'pink sm')}
`).join('');} + if(hot.length){h+=`

Congested links

${S.te&&S.te.on?'':'

Raise a full link’s metric so traffic prefers another path, upgrade it, or install Auto-TE.

'}`+hot.map(l=>`
${CITY[l.a].name} ⇄ ${CITY[l.b].name}
${capName(l)} · ${pct((R.load[l.id]||0)/capOf(l))} full
${btn('Inspect','selLink',{id:l.id},'pink sm')}
`).join('');} const hotR=hotPorts(); if(hotR.length)h+=`

Ports, caches and routers running hot

`+hotR.map(x=>`
${HOTL[x.k]}
${CITY[x.city].name} · ${esc(x.lab)}
${pct(Math.min(1,x.u))} full${x.u>=0.995?' · dropping or overflowing':''} · ${esc(x.tip)}
${btn('Inspect','focusCity',{city:x.city},'pink sm')}
`).join(''); if(!S.inc.length&&!hot.length&&!hotR.length)h+=`

All systems green. Enjoy it while it lasts.

`; @@ -2080,7 +2100,7 @@ function showHelp(){
Embedded cache
A CDN's server in your rack. Serves most of that CDN's traffic locally, for the price of power.
DE-KICKS
The group behind several big exchanges (Frankfurt, Madrid, Marseille, Dubai, Mumbai, New York) treats price lists as a state secret. Ports are quoted per customer and go up the bigger you look. Haggling can work, backfire or stall for a week. Prices get "harmonised" upwards once a year, add-ons appear on your invoice until you opt out, and trying to leave earns you a retention discount that ends with a fee.
Remote peering
Reach an IX over a fabric circuit without a POP there. It works, and the route server still gets you every open network, but it is discouraged: the reseller charges 1.5× for the port and oversubscribes it to 80%, latency rides the fabric, one fabric outage drops every session, and many selective networks refuse remote members outright.
Peering policy
Open peers with anyone. Selective wants to see traffic first. Restrictive (Tier 1s) only peers with giants, over PNIs. Paid means exactly that. Big selective networks also have moods: in some cities they refuse new peers for a few months, or only take PNIs, and now and then they tear down a session you already had. Try another city or a PNI, and ask again later.
Waves
Your fiber links are leased waves at a flat monthly rate. Longer and bigger costs more (10G → 6.4T), and subsea is 1.8× the price.
95th percentile
Transit bills sample your usage every day and charge the 95th percentile of the last 30 days, so short spikes are forgiven but long ones are not.
Routers
Each POP's router model caps its fastest port (100G, 400G, 800G, 1.6T) and how much it can forward. Bigger waves and ports need better routers at both ends. Better models unlock with your customer level. With one router, upgrades mean a day of downtime.
Dark fiber
Lease an IRU or build your own (slow, with delays), then buy a line system with amplifiers and light channels with 400ZR+, 800ZR+ or 1.6T transponders. Much cheaper than waves at scale, but the gear can fail. A spares kit speeds up repairs.
Subsea cables
Subsea waves can only follow real-ish cable systems, drawn faintly on the map (tap a city to highlight its cables). Teal ones are new and cheap, purple ones pricey, dashed ones old and cut-prone. All your waves on one cable die together when it is cut. Between continents on land, you can often choose overland (2.5×, many borders) or a cable.
Latency
Every link has latency. High-frequency traders pay a fortune for a circuit within their latency budget; route them “Lowest latency”. Bulk backup customers do not care, so route them “Scenic” over your quiet links to keep busy ones free.
NOC dashboard
The chart button at the top opens traffic graphs by exit (caches, PNIs, IX, transit), money over time, per-ASN traffic with how it reaches you and what its transit costs, plus your busiest links and routers.
Asia
A weird, underserved market. Transit costs 2.5× what it does in Europe (Africa 2×, Oceania 1.8×), local incumbents mostly peer only for pay, and IXs are fragmented. But demand is enormous and users sign up 60% faster than anywhere else. Peering and caches pay off most here.
Russia
Moscow needs a mandatory government box in every POP, Western CDNs are mostly gone, Goggle video is throttled to half speed, and the sovereign internet drills now and then cut Moscow off for a day.
Events, chains and wholesale
Event networks (a final, a festival, a keynote) need a burst of capacity in one city for a few days and pay once at the end, prorated by how much of the crowd you served; below 70% you pay a penalty. SD-WAN chains connect 3–6 of your POPs hub-and-spoke, so one broken spoke upsets the whole contract. Once you run your own dark fiber, carriers want to rent spare channels as alien waves, and on fiber you built yourself, a spare pair.
Bank
Tap your cash to open the bank. Lenders make offers now and then, and much more often when you are in the red. Each loan has a monthly payment and some odd conditions; break one and you pay a penalty. Your credit rating decides which banks talk to you. The loan shark is always there. Do not be late.
LAGs
Out of port speed? Bundle up to 8 identical ports to the same transit provider, IX or PNI into a LAG. Each member costs a full port; flow hashing is never perfectly even, so a bundle carries about 95% of the sum.
Traffic engineering
Tap a link to see which networks, which entry points and which customer cities fill it. Raise a link's metric to steer traffic around it, or set an egress (transit, IX, PNI) to Prefer or Backup only.
China
Mainland China needs a license and a local joint venture. Many foreign services are blocked there, and traffic crossing the border loses packets unless you pay for premium routes.
Weird requirements
Some customers come with conditions: no Cogentle anywhere, no subsea cables because of sharks, two routers, a generator, NetChill on-net, low-loss China reach and more. Each pays a bonus. Unmet ones make them grumpy until you fix it or they leave.
Customer levels
As your peak traffic and footprint grow, bigger customers show up: streaming startups and universities, then AI GPU data centers and cloud on-ramps, then AI training interconnects and hyperscaler DCI deals measured in terabits. Pink $$ bubbles mark the big ones.
L2VPN & DDoS protection
Businesses may want a private circuit between two of your POPs (it rides your backbone), or DDoS protection (needs your own scrubbing center).
NNI fabrics
Megapork, PocketFabric and Consolation Connect sell a port plus virtual circuits between cities. Great for small links and remote peering at an IX where you have no POP.
-
Badges
Below your goals sits a wall of badges, from common to legendary. Some take luck, some take years, and a couple are secret. Badges you earned in earlier games stay on this device with a dashed outline.
The giants
At customer level 3 and 4, hyperscalers and AI clouds show up with deals only they would ask for: terabit AI WANs between gigawatt campuses, training runs spread over several sites, week-long dataset ingests, and hundreds of fiber pairs in a trench you dug yourself. They pay like nobody else, and they want diverse paths, two sites per metro and zero excuses. Cities near their campuses list them under “Who’s here”.
Metro diversity
A POP is one building until you add a second site in the Infra tab. Then a power cut, cleaner or A/C failure only takes out half the city, and you choose which site each transit, PNI and IX port plugs into. Spread them out, or both halves of your redundancy will sit in the same dark room. Watch out for metro ring cuts, which cut site B off.
Regional quirks
South America hangs off Miami: transit is pricier, nothing crosses the Darién Gap by land, and fiber over the Andes costs double and breaks often. IX.brrr in Brazil is run by a nonprofit with cheap public prices, and small Brazilian provedores buy transit in bulk. Inside the UAE only the duopoly may run fiber, so no dark fiber and 3× waves. Taiwan’s cables meet a lot of anchors, Indian fiber meets road widening and the monsoon, and South Africa has load shedding: bring a generator.
Boot times
Some routers take forever to boot. The Infra tab shows how long yours takes. Slow booters make crashes last longer and turn a one-router swap into a three-day outage. Bigger chassis, especially anything with a PacketOinker™ inside, are slow more often. Twin routers make it someone else’s problem.
Failures
Things break all the time: fiber cuts, router crashes, power cuts, IX loops, fabric outages, route leaks, DDoS, fat fingers, cooling failures, and geopolitics: sanctions, tariffs, BGP hijacks, landing permit disputes, exam-day shutdowns and Red Sea cable cuts. Traffic reroutes automatically over other paths and upstreams. Parallel links on diverse routes, a second router and a backup generator all help. Or pay to rush repairs.
+
Badges
Below your goals sits a wall of badges, from common to legendary. Some take luck, some take years, and a couple are secret. Badges you earned in earlier games stay on this device with a dashed outline.
The giants
At customer level 3 and 4, hyperscalers and AI clouds show up with deals only they would ask for: terabit AI WANs between gigawatt campuses, training runs spread over several sites, week-long dataset ingests, and hundreds of fiber pairs in a trench you dug yourself. They pay like nobody else, and they want diverse paths, two sites per metro and zero excuses. Cities near their campuses list them under “Who’s here”.
Auto-TE
Traffic follows the shortest path by distance and link metric, and reroutes by itself when links fail. When a path is merely full, the overflow is dropped, just like a real IGP. From customer level 3 you can install Auto-TE in the NOC tab: it spills overflow onto up to two alternate paths with free capacity, as long as they are no more than twice as long.
Metro diversity
A POP is one building until you add a second site in the Infra tab. Then a power cut, cleaner or A/C failure only takes out half the city, and you choose which site each transit, PNI and IX port plugs into. Spread them out, or both halves of your redundancy will sit in the same dark room. Watch out for metro ring cuts, which cut site B off.
Regional quirks
South America hangs off Miami: transit is pricier, nothing crosses the Darién Gap by land, and fiber over the Andes costs double and breaks often. IX.brrr in Brazil is run by a nonprofit with cheap public prices, and small Brazilian provedores buy transit in bulk. Inside the UAE only the duopoly may run fiber, so no dark fiber and 3× waves. Taiwan’s cables meet a lot of anchors, Indian fiber meets road widening and the monsoon, and South Africa has load shedding: bring a generator.
Boot times
Some routers take forever to boot. The Infra tab shows how long yours takes. Slow booters make crashes last longer and turn a one-router swap into a three-day outage. Bigger chassis, especially anything with a PacketOinker™ inside, are slow more often. Twin routers make it someone else’s problem.
Failures
Things break all the time: fiber cuts, router crashes, power cuts, IX loops, fabric outages, route leaks, DDoS, fat fingers, cooling failures, and geopolitics: sanctions, tariffs, BGP hijacks, landing permit disputes, exam-day shutdowns and Red Sea cable cuts. Traffic reroutes automatically over other paths and upstreams. Parallel links on diverse routes, a second router and a backup generator all help. Or pay to rush repairs.
${btn(UI.started?'Back to the map':'Got it','helpClose',{},'big')}${RELEASE_NOTES.length?btn(`What’s new in ${esc(APP_VERSION)}`,'whatsNewShow',{},'ghost'):''}${UI.started&&S&&!S.lost?btn('Start a new network','resetAsk',{},'ghost sm'):''}
${UI.started&&S&&!S.lost?btn('Export save','exportSave',{},'ghost sm'):''}${btn('Import a save','importPick',{},'ghost sm')}
`); } function showWin(){openModal(`

You're a Tier 1!

${esc(S.name)} (AS${S.asn}) is transit-free. You peer with every giant on the planet and pay nobody to reach the internet. Took you ${S.day} days and ${S.stats.incidents} incidents.

${btn('Keep building','keepPlaying',{},'pink big')}`);sfx('coin');} diff --git a/tests/issues.test.js b/tests/issues.test.js index b963f2a..08fdb87 100644 --- a/tests/issues.test.js +++ b/tests/issues.test.js @@ -132,3 +132,20 @@ test('badges unlock with a rarity, persist across games, and secret ones stay hi assert.equal(ev("document.getElementById('hBank').className"), 'badge'); assert.deepEqual(errors, []); }); + +test('Auto-TE spills overflow onto an alternate path when the shortest one is full', () => { + 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'})"); + ev("for(const c of ['ams','lon','par'])ACT.buildPop({city:c});const L=(a,b,t,v)=>{UI.via=v||null;openLinkModal(a,b);ACT.buildLink({tier:t});closeModal();};L('fra','ams',0);L('ams','lon',1,'uly');L('fra','par',1);L('par','lon',1,'chn');ACT.buyTransit({city:'lon',net:'lvl',tier:1});compute()"); + const dem = ev("R.demand"); + assert.ok(ev("R.served") < dem - 1, 'without TE the 10G link caps it'); + ev("ACT.buyTE();compute()"); + assert.ok(ev("R.served") > dem * 0.97, 'with TE nearly everything is served'); + assert.ok(ev("R.teMoved") > 1); + assert.ok(ev("R.load[S.links.find(l=>l.a==='fra'&&l.b==='par').id]") > 1, 'the Paris path carries the overflow'); + ev("ACT.leftTab({t:'noc'})"); + assert.match(ev("document.body.textContent"), /Auto-TE/); + ev("ACT.teToggle();compute()"); + assert.ok(ev("R.served") < dem - 1, 'switching it off goes back to shortest path only'); + assert.deepEqual(errors, []); +});