diff --git a/CHANGELOG.md b/CHANGELOG.md index fb42726..7288a16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] +- Glowball Sakura Lager joins the map: a Tier 2 carrier with a PoP in nearly every city that sells transit, takes PNIs and peers openly at almost every exchange. It is not a Tier 1, so it buys its own transit from three of them, while 24 smaller networks on every continent buy theirs from it. One PNI with it reaches about 5% of all traffic, so give it a big port. In Australia it sells transit too, dearer than elsewhere like everything there, but cheaper than Telstraya. + ## [1.36.0] — 2026-10-28 - You can put a link on standby, so one of two links between the same cities sits idle as a backup (#122). It carries traffic only when the other links are full or down, so its capacity is never wasted, and the map draws it dashed while it waits. The routing metric still applies to every link between the two cities. diff --git a/site/i18n/es.js b/site/i18n/es.js index 0c9a6df..7a43b19 100644 --- a/site/i18n/es.js +++ b/site/i18n/es.js @@ -1803,6 +1803,7 @@ "geography_and_latency.where_lvl_this_route_is_p":"{where}: {lvl}. Esta ruta está un {p} % por debajo del precio de mercado{since}.", "geography_and_latency.where_lvl_this_route_is_p_0196":"{where}: {lvl}. Esta ruta está un {p} % por encima del precio de mercado{since}.", "geography_and_latency.where_lvl_this_route_is_right":"{where}: {lvl}. Esta ruta está justo al precio de mercado{since}.", +"glowball_sakura_lager.on_tap_in_every_city_resells":"De barril en cada ciudad. Revende tránsito sacado de tres barriles de Tier 1, acepta PNI y hace peering abierto en casi todos los IX. No es un Tier 1, y la flor de cerezo en la factura es puramente decorativa.", "goals.5_pops_ports_on_3_ixs":"5+ POPs, puertos en 3+ IXs y 15+ sesiones de peering.", "goals.a_private_cross_connect_to_one":"Una interconexión cruzada privada con una red del mismo centro de datos, para cuando el tráfico supera al IX.", "goals.a_terabit_per_second_of_happy":"Un terabit por segundo de tráfico feliz.", diff --git a/site/i18n/fr.js b/site/i18n/fr.js index 05ae35c..11ad8e9 100644 --- a/site/i18n/fr.js +++ b/site/i18n/fr.js @@ -1803,6 +1803,7 @@ "geography_and_latency.where_lvl_this_route_is_p":"{where} : {lvl}. Cette route est {p} % sous le prix du marché{since}.", "geography_and_latency.where_lvl_this_route_is_p_0196":"{where} : {lvl}. Cette route est {p} % au-dessus du prix du marché{since}.", "geography_and_latency.where_lvl_this_route_is_right":"{where} : {lvl}. Cette route est pile au prix du marché{since}.", +"glowball_sakura_lager.on_tap_in_every_city_resells":"À la pression dans chaque ville. Revend du transit tiré de trois fûts de Tier 1, accepte les PNI et fait du peering ouvert sur presque tous les IX. Ce n’est pas un Tier 1, et la fleur de cerisier sur la facture est purement décorative.", "goals.5_pops_ports_on_3_ixs":"5+ POP, des ports sur 3+ IX et 15+ sessions de peering.", "goals.a_private_cross_connect_to_one":"Un cross-connect privé vers un réseau dans le même datacenter, pour quand le trafic devient trop gros pour l’IX.", "goals.a_terabit_per_second_of_happy":"Un térabit par seconde de trafic heureux.", diff --git a/site/i18n/it.js b/site/i18n/it.js index 92ca041..a82a60d 100644 --- a/site/i18n/it.js +++ b/site/i18n/it.js @@ -1803,6 +1803,7 @@ "geography_and_latency.where_lvl_this_route_is_p":"{where}: {lvl}. Questa rotta è il {p}% sotto il prezzo di mercato{since}.", "geography_and_latency.where_lvl_this_route_is_p_0196":"{where}: {lvl}. Questa rotta è il {p}% sopra il prezzo di mercato{since}.", "geography_and_latency.where_lvl_this_route_is_right":"{where}: {lvl}. Questa rotta è esattamente al prezzo di mercato{since}.", +"glowball_sakura_lager.on_tap_in_every_city_resells":"Alla spina in ogni città. Rivende transit spillato da tre fusti di Tier 1, accetta PNI e fa peering aperto su quasi tutti gli IX. Non è un Tier 1, e il fiore di ciliegio in fattura è puramente decorativo.", "goals.5_pops_ports_on_3_ixs":"5+ POP, porte su 3+ IX e 15+ sessioni di peering.", "goals.a_private_cross_connect_to_one":"Un cross-connect privato verso una rete nello stesso data center, per quando il traffico è troppo per l’IX.", "goals.a_terabit_per_second_of_happy":"Un terabit al secondo di traffico felice.", diff --git a/site/i18n/pt.js b/site/i18n/pt.js index 6e219ea..3b16a97 100644 --- a/site/i18n/pt.js +++ b/site/i18n/pt.js @@ -1803,6 +1803,7 @@ "geography_and_latency.where_lvl_this_route_is_p":"{where}: {lvl}. Esta rota está {p}% abaixo do preço de mercado{since}.", "geography_and_latency.where_lvl_this_route_is_p_0196":"{where}: {lvl}. Esta rota está {p}% acima do preço de mercado{since}.", "geography_and_latency.where_lvl_this_route_is_right":"{where}: {lvl}. Esta rota está bem no preço de mercado{since}.", +"glowball_sakura_lager.on_tap_in_every_city_resells":"Na torneira em toda cidade. Revende transit tirado de três barris de Tier 1, aceita PNIs e faz peering aberto em quase todos os IX. Não é um Tier 1, e a flor de cerejeira na fatura é puramente decorativa.", "goals.5_pops_ports_on_3_ixs":"5+ POPs, portas em 3+ IXs e 15+ sessões de peering.", "goals.a_private_cross_connect_to_one":"Um cross-connect privado com uma rede no mesmo data center, para quando o tráfego não cabe mais no IX.", "goals.a_terabit_per_second_of_happy":"Um terabit por segundo de tráfego feliz.", diff --git a/src/game/30-networks/35-glowball-sakura-lager.js b/src/game/30-networks/35-glowball-sakura-lager.js new file mode 100644 index 0000000..5f84dff --- /dev/null +++ b/src/game/30-networks/35-glowball-sakura-lager.js @@ -0,0 +1,42 @@ +/* Glowball Sakura Lager: a Tier 2 with a PoP in every city the big content networks reach, except Pitcairn, where no + provider may sell transit so that you must land your own cable (#124). Not a Tier 1, so it buys transit from three of + them and resells it, in Australia too (see AU_SELLERS). Open peering and a port on nearly every exchange (the real + thing lists an open policy and route servers at dozens of IXs). Sits before 40-traffic-shares.js, which indexes NETS. */ +NETS.push( + {id:'gsl',name:'Glowball Sakura Lager',asn:137409,type:'t2',pol:'open',up:['lvl','cog','ntt'],share:.02,price:5,col:'#C94F7C',auIx:['syd','mel','bne','per'],pops:ALLC.filter(c=>c!=='pcn'),ix:'ALL',blurb:tr('glowball_sakura_lager.on_tap_in_every_city_resells')}); +/* Its downstreams: networks that buy their transit from it, so a PNI with it reaches them too. Small and mid-size + networks on every continent, one per line, sorted within each. Kept here rather than in their own entries so the + whole carrier lives in one file. */ +const GSL_DOWN=[ + // Africa + 'art', // Air-Tell Africa + 'mtc', // Dodo Telecom + 'sfc', // Safari-Comic + 'zeo', // Zealot + // Asia + 'dhr', // Dhiraa-goo + 'ptc', // PTC-hell + 'tru', // Mostly-True Move + 'vtl', // Viet-tell + // Europe + 'cms', // CityMess + 'dgi', // Digi-tally Cheap + 'fwb', // Fast-Webby + 'nos', // NOS-y Neighbour + // North America + 'dgc', // Digi-Sell Caribbean + 'pes', // Pessimum + 'snc', // Sonic Boomer + 'wnt', // Whirled Net + // Oceania + 'abb', // Aussie Boyband + 'lpt', // Frogtel + 'npt', // Neptoon Internet + 'spk', // Spark-le + // South America + 'ant', // Antelope + 'bsn', // Brisanada + 'mvs', // Moviestar + 'tgo', // Tiger Mobile +]; +for(const id of GSL_DOWN){const n=NETS.find(x=>x.id===id);n.up=(n.up||[]).concat('gsl');} diff --git a/src/game/70-rules/20-exchanges.js b/src/game/70-rules/20-exchanges.js index d6825f3..a243448 100644 --- a/src/game/70-rules/20-exchanges.js +++ b/src/game/70-rules/20-exchanges.js @@ -3,8 +3,10 @@ /* Transit in Australia is sold only by carriers with an Australian site and at least ten Australian networks buying from them (RIPEstat, Oct 2026): Telstraya, Hocus Pocus, Speedyloop, SingTell, Drizzle Electric, Cogentle, Not That Telecom and Level Tree (whose real-world network lists no sites in PeeringDB at all, but sells in Sydney). Others can sit in - an Australian city, like the Pacific carriers backhauling to Sydney, but reach Australian customers only from overseas. */ -const AU_SELLERS=['tsy','voc','spl','sgt','drz','cog','ntt','lvl'],sellsAt=(n,c)=>!!n.price&&n.pops.includes(c)&&(!CITY[c].au||AU_SELLERS.includes(n.id)); + an Australian city, like the Pacific carriers backhauling to Sydney, but reach Australian customers only from overseas. + Glowball Sakura Lager is the one exception that is a design choice, not a measurement: it sells everywhere, at the + Australian price (3×, so well under Telstraya's). */ +const AU_SELLERS=['tsy','voc','spl','sgt','drz','cog','ntt','lvl','gsl'],sellsAt=(n,c)=>!!n.price&&n.pops.includes(c)&&(!CITY[c].au||AU_SELLERS.includes(n.id)); const onIx=(n,c)=>CITY[c].au&&n.auIx?n.auIx.includes(c):n.ix==='ALL'||Array.isArray(n.ix)&&n.ix.includes(c); function ixMembers(c){if(XIXM[c])return XIXM[c].members.slice();if(S.myIx[c])return S.myIx[c].members.slice();if(!CITY[c].ix)return [];return NETS.filter(n=>onIx(n,c)).map(n=>n.id);} // LAG: several identical ports bundled into one logical link. Flow hashing is never perfectly even, so a bundle carries ~95% of the sum. diff --git a/src/i18n/en.js b/src/i18n/en.js index b8fd360..b6bb4ea 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -1804,6 +1804,7 @@ "geography_and_latency.where_lvl_this_route_is_p":"{where}: {lvl}. This route is {p}% below the going rate{since}.", "geography_and_latency.where_lvl_this_route_is_p_0196":"{where}: {lvl}. This route is {p}% above the going rate{since}.", "geography_and_latency.where_lvl_this_route_is_right":"{where}: {lvl}. This route is right at the going rate{since}.", +"glowball_sakura_lager.on_tap_in_every_city_resells":"On tap in every city. Resells transit poured from three Tier 1 kegs, takes PNIs and peers openly at almost every exchange. Not a Tier 1 itself, and the cherry blossom on the invoice is purely decorative.", "goals.5_pops_ports_on_3_ixs":"5+ POPs, ports on 3+ IXs and 15+ peering sessions.", "goals.a_private_cross_connect_to_one":"A private cross-connect to one network in the same data center, for when traffic outgrows the IX.", "goals.a_terabit_per_second_of_happy":"A terabit per second of happy traffic.", diff --git a/tests/glowball-sakura-lager.test.js b/tests/glowball-sakura-lager.test.js new file mode 100644 index 0000000..31a311f --- /dev/null +++ b/tests/glowball-sakura-lager.test.js @@ -0,0 +1,104 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const { load } = require('./harness'); + +test('Glowball Sakura Lager is a Tier 2 that is everywhere on the map but China and Russia', () => { + const { ev, errors } = load(); + assert.equal(ev("NET.gsl.name"), 'Glowball Sakura Lager'); + assert.equal(ev("NET.gsl.type"), 't2'); + assert.equal(ev("NET.gsl.pol"), 'open'); + assert.equal(ev("ALLC.filter(c=>c!=='pcn').every(c=>NET.gsl.pops.includes(c))"), true, 'a PoP in every city the big content networks reach'); + assert.equal(ev("NET.gsl.pops.includes('pcn')"), false, 'Pitcairn has no provider but you (#124)'); + assert.equal(ev("NET.gsl.pops.some(c=>CITY[c].cn||CITY[c].ru)"), false); + assert.equal(ev("t1Need().some(n=>n.id==='gsl')"), false, 'not a Tier 1, so no Tier 1 club PNI is needed for it'); + assert.equal(ev("NET.gsl.up.every(u=>NET[u].type==='t1')"), true, 'it buys its own transit from Tier 1s'); + assert.equal(ev("PNI_NETS.lvl.includes('gsl')"), true, 'a PNI with an upstream reaches it'); + assert.equal(ev("NETS.filter(n=>n.asn===NET.gsl.asn).length"), 1); + assert.equal(ev("initials(NET.gsl)"), 'GSL'); + assert.deepEqual(errors, []); +}); + +test('it sells transit in every city, Australia included, and sits on the exchanges', () => { + const { ev, errors } = load(); + ev("ACT.start({})"); + assert.equal(ev("ALLC.filter(c=>c!=='pcn').every(c=>sellsAt(NET.gsl,c))"), true); + assert.equal(ev("sellsAt(NET.gsl,'ivc')&&sellsAt(NET.gsl,'prr')"), true, 'the small towns nobody else sells transit in'); + assert.equal(ev("CITIES.filter(c=>c.au).every(c=>sellsAt(NET.gsl,c.id))"), true, 'every Australian city'); + assert.equal(ev("ixMembers('fra').includes('gsl')&&ixMembers('lon').includes('gsl')"), true); + assert.equal(ev("ixMembers('syd').includes('gsl')"), true, 'Australian exchanges follow auIx'); + assert.equal(ev("ixMembers('adl').includes('gsl')"), false); + assert.deepEqual(errors, []); +}); + +test('in Australia it is dear, like everything there, but cheaper than Telstraya', () => { + const { ev, errors } = load(); + const per = (net, c) => ev(`NET.${net}.price*regionMult('${c}')`); + assert.ok(per('gsl', 'syd') > per('gsl', 'fra'), 'dearer at home in Sydney than in Frankfurt'); + assert.ok(per('gsl', 'syd') < per('tsy', 'syd'), 'but cheaper than Telstraya'); + ev("ACT.start({});S.cash=1e8;ACT.buildPop({city:'syd'});ACT.buyTransit({city:'syd',net:'gsl',tier:1});compute()"); + assert.equal(ev("S.transit.filter(t=>t.net==='gsl'&&t.city==='syd').length"), 1, 'the order went through'); + assert.deepEqual(errors, []); +}); + +test('buying transit from it reaches the whole internet', () => { + const { ev, errors } = load(); + ev("ACT.start({});S.cash=1e8;ACT.launchBB({city:'fra'});ACT.buyTransit({city:'fra',net:'gsl',tier:1});compute()"); + assert.equal(ev("S.transit.length"), 1); + assert.ok(ev("R.reach") > 0.999, 'transit reaches every network'); + assert.ok(ev("R.served") > 0); + assert.ok(ev("Object.values(R.useT).reduce((a,b)=>a+b,0)") > 0); + assert.deepEqual(errors, []); +}); + +test('it takes a PNI and open peering at an exchange, and carries its own traffic over them', () => { + const { ev, errors } = load(); + ev("ACT.start({});S.cash=1e8;ACT.launchBB({city:'fra'});ACT.buyTransit({city:'fra',net:'cog',tier:1});S.pops.fra.bb.d=400"); + assert.equal(ev("peerOk('gsl','pni','fra').ok"), true); + assert.equal(ev("peerOk('gsl','ix','fra').ok"), true); + ev("ACT.pni({city:'fra',net:'gsl',tier:1});for(const p of S.pni)p.ready=0;compute()"); + assert.equal(ev("S.pni.length"), 1, 'the PNI order went through'); + assert.ok(ev("R.netEg.gsl.p") > 0, 'traffic for it goes over the PNI'); + ev("S.pni=[];ACT.buyIx({city:'fra',tier:1,signed:true});ACT.rs({city:'fra'});compute()"); + assert.equal(ev("ixSessions('fra').has('gsl')"), true, 'the route server session comes up by itself'); + assert.ok(ev("R.netEg.gsl.ix") > 0, 'traffic for it goes over the exchange'); + assert.deepEqual(errors, []); +}); + +test('networks on every continent buy their transit from it, so a PNI with it reaches them', () => { + const { ev, errors } = load(); + // Each downstream's home continent is where most of its PoPs are. + const home = JSON.parse(ev(`JSON.stringify(PNI_NETS.gsl.slice(1).map(id=>{const c={};for(const p of NET[id].pops){const r=CITY[p].reg;c[r]=(c[r]||0)+1;}return Object.entries(c).sort((a,b)=>b[1]-a[1])[0][0];}))`)); + for (const r of ['AF', 'AM', 'AS', 'EU', 'OC', 'SA']) assert.ok(home.filter((x) => x === r).length >= 3, `${r} has at least three downstreams`); + assert.equal(ev("PNI_NETS.gsl.slice(1).every(id=>NET[id].up.includes('gsl')&&new Set(NET[id].up).size===NET[id].up.length)"), true); + assert.equal(ev("PNI_NETS.gsl.some(id=>NET[id].type==='t1'||NET[id].cn)"), false); + assert.equal(ev("PNI_NETS.gsl.slice(1).some(id=>merged(id)||MERGERS.some(m=>m.id===id))"), false, 'none of them is about to be bought'); + // Their own upstreams still reach them: nothing was replaced, only added. + assert.equal(ev("NET.pes.up.join()"), 'cog,lvl,gsl'); + // One PNI with it carries a downstream's traffic as well as its own (a 100G port: 25 networks share it). + ev("ACT.start({});S.cash=1e8;ACT.launchBB({city:'fra'});ACT.buyTransit({city:'fra',net:'cog',tier:1});S.pops.fra.bb.d=400;ACT.pni({city:'fra',net:'gsl',tier:1});for(const p of S.pni)p.ready=0;compute()"); + assert.ok(ev("(R.netEg.pes||{}).p") > 0, 'Pessimum is reached over the PNI with its upstream'); + assert.ok(ev("(R.netEg.abb||{}).p") > 0, 'so is Aussie Boyband'); + ev("S.pni=[];compute()"); + assert.equal(ev("(R.netEg.pes||{}).p||0"), 0, 'and not without it'); + assert.deepEqual(errors, []); +}); + +test('a game saved before it existed gets the courtesy route to it', () => { + const a = load(); + a.ev("ACT.start({});S.day=40;S.seen=S.seen.filter(x=>x!=='gsl');save(true)"); + const b = load({ storage: { 'sot-save-v1': a.ev("localStorage.getItem('sot-save-v1')") } }); + assert.equal(b.ev("S.grace.nets.includes('gsl')"), true); + assert.equal(b.ev("S.seen.includes('gsl')"), true); + assert.equal(b.ev("R.reachable.gsl"), true, 'reachable through the courtesy route until you find your own way'); + assert.deepEqual(a.errors, []); + assert.deepEqual(b.errors, []); +}); + +test('the city panel offers it as a transit provider, on a desktop and a phone', () => { + for (const w of [1280, 360]) { + const { ev, dom, errors } = load(); + ev(`window.innerWidth=${w};ACT.start({});if(UI.pendGame)ACT.pitchSkip();S.cash=1e8;UI.sel={type:'city',id:'fra'};UI.tab='up';renderPanel()`); + assert.match(dom.window.document.getElementById('panelBody').textContent, /Glowball Sakura Lager/, `${w}px`); + assert.deepEqual(errors, []); + } +}); diff --git a/tests/regions.test.js b/tests/regions.test.js index 1ac3be1..292f2d5 100644 --- a/tests/regions.test.js +++ b/tests/regions.test.js @@ -572,7 +572,7 @@ test('a Tier 1 reaches every Latin American and African network through the carr const { ev, errors } = load(); ev("ACT.start({});S.cash=1e9;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'});S.transit=[];S.ixp={};S.pni=[];for(const n of t1Need())S.pni.push({id:n.id,net:n.id,city:'fra',tier:0});compute()"); for (const n of ['oio', 'tmt', 'bsn', 'mvs', 'llt', 'ant', 'tgo', 'liq', 'scm', 'agc', 'djt', 'mtx', 'art', 'eth', 'mrc']) { - assert.equal(ev(`NET.${n}.up.every(id=>NET[id].type==='t1')`), true, `${n} buys from Tier 1s`); + assert.equal(ev(`NET.${n}.up.some(id=>NET[id].type==='t1')`), true, `${n} buys from a Tier 1`); assert.equal(ev(`R.reachable.${n}`), true, `${n} is reachable`); } assert.deepEqual(errors, []); @@ -708,7 +708,7 @@ test('Australian peering follows PeeringDB: IX Straya and At-The-Edge IX in Sydn assert.ok(hba.includes('cfl') && hba.includes('voc') && !hba.includes('nfx'), 'Hobart: Crowdflare and Hocus Pocus, but no NetChill'); assert.ok(JSON.parse(ev("JSON.stringify(ixMembers('fra'))")).includes('nfx'), 'networks on every IX elsewhere are unchanged outside Australia'); const sellers = JSON.parse(ev("JSON.stringify(NETS.filter(n=>CITIES.some(c=>c.au&&sellsAt(n,c.id))).map(n=>n.id).sort())")); - assert.deepEqual(sellers, ['cog', 'drz', 'lvl', 'ntt', 'sgt', 'spl', 'tsy', 'voc'], 'only carriers that really sell transit in Australia'); + assert.deepEqual(sellers, ['cog', 'drz', 'gsl', 'lvl', 'ntt', 'sgt', 'spl', 'tsy', 'voc'], 'only carriers that really sell transit in Australia, and Glowball Sakura Lager by design'); assert.ok(!ev("NET.ntt.pops.includes('per')"), 'NTT is only in Sydney'); assert.ok(ev("['dsp','fnt','pft'].every(n=>NET[n].pops.includes('syd')&&!sellsAt(NET[n],'syd'))"), 'Pacific carriers backhaul to Sydney but do not sell transit there'); });