Accept local PNIs for Tier 1 customer breakout

This commit is contained in:
Florian Krieger 2026-10-25 14:28:01 +01:00
parent bfe12cca7d
commit 5f432aefc9
4 changed files with 17 additions and 2 deletions

View file

@ -6,6 +6,8 @@ All notable changes to this project are documented here. The project follows
## [Unreleased]
- A PNI in the customer’s city now meets their local-breakout requirement while your network is Tier 1 (#20).
## [1.25.0] — 2026-10-25
- Your own trench can carry more than one fiber pair (#35). Once a ROADMaster

View file

@ -728,7 +728,6 @@
"Wants NetChill on-net: a cache or a PNI":"Vuole NetChill on-net: una cache o un PNI",
"Backup generator in every city they touch":"Generatore di backup in ogni città che tocca",
"Insists on two routers in their city":"Pretende due router nella sua città",
"Local breakout: transit or an IX port in their own city":"Breakout locale: transit o una porta IX nella sua città",
"Two data centers in every metro they touch":"Due data center in ogni area metropolitana che tocca",
"Wants two different transit providers (or none at all)":"Vuole due provider di transit diversi (o nessuno)",
"Needs low-loss reach into China":"Vuole raggiungere la Cina con poche perdite",
@ -2219,4 +2218,5 @@
"<b>Fiber pair {n} is lit: {a}–{b}.</b><br>Another ROADMaster 9000 and a fresh chain of amplifiers. Room for {m} more channels.":"<b>Coppia di fibre {n} accesa: {a}–{b}.</b><br>Un altro ROADMaster 9000 e una nuova catena di amplificatori. Spazio per altri {m} canali.",
"{n} fiber pairs lit, the trench is full":"{n} coppie di fibre accese, il cavidotto è pieno",
"Light fiber pair {n} <small>{price} + {mo}/mo</small>":"Accendi la coppia {n} <small>{price} + {mo}/mese</small>",
"Local breakout: transit or an IX port in their own city, or a local PNI while Tier 1":"Breakout locale: transit o una porta IX nella città del cliente, oppure un PNI locale quando sei Tier 1",
};

View file

@ -1841,7 +1841,7 @@ const REQS={
netchill:{l:tr('Wants NetChill on-net: a cache or a PNI'),bonus:.15,ok:()=>S.caches.some(c=>c.net==='nfx')||S.pni.some(p=>p.net==='nfx')},
gen:{l:tr('Backup generator in every city they touch'),bonus:.15,ok:b=>[b.city,b.city2].filter(Boolean).every(c=>S.pops[c]&&S.pops[c].gen)},
routers:{l:tr('Insists on two routers in their city'),bonus:.15,ok:b=>((S.pops[b.city]&&S.pops[b.city].routers)||1)>=2},
local:{l:tr('Local breakout: transit or an IX port in their own city'),bonus:.2,ip:true,ok:b=>S.transit.some(t=>t.city===b.city)||hasIxAt(b.city)},
local:{l:tr('Local breakout: transit or an IX port in their own city, or a local PNI while Tier 1'),bonus:.2,ip:true,ok:b=>S.transit.some(t=>t.city===b.city)||hasIxAt(b.city)||(isTier1()&&S.pni.some(p=>p.city===b.city))},
metro:{l:tr('Two data centers in every metro they touch'),bonus:.2,only:true,ok:b=>[b.city,b.city2].filter(Boolean).every(c=>S.pops[c]&&S.pops[c].site2)},
twoup:{l:tr('Wants two different transit providers (or none at all)'),bonus:.15,ip:true,ok:()=>new Set(S.transit.map(t=>t.net)).size>=2||S.transit.length===0},
china:{l:tr('Needs low-loss reach into China'),bonus:.3,ip:true,ok:()=>S.transit.some(t=>t.premium&&t.city==='hkg')||S.links.some(l=>l.premium)||S.pni.some(p=>NET[p.net].cn)},

View file

@ -539,3 +539,16 @@ test('#35 your own trench can light another fiber pair once a ROADMaster is full
assert.equal(ev('S.links[0].pairs'), 4, 'saves are clamped to four pairs');
assert.deepEqual(errors, []);
});
test('#20 local PNIs satisfy local breakout only while Tier 1, without changing transit or IX rules',()=>{
const {ev,errors}=load();ev("ACT.start({});S.cash=1e8;S.transit=[];S.ixp={};S.pni=[{id:'local',net:'nfx',city:'fra',tier:0}];R.reach=1");
assert.equal(ev("REQS.local.ok({city:'fra'})"),false);
ev("for(const n of t1Need())S.pni.push({id:n.id,net:n.id,city:n.pops.find(c=>c!=='fra'),tier:0});R.reach=1");
assert.equal(ev('isTier1()'),true);assert.equal(ev("REQS.local.ok({city:'fra'})"),true);
assert.equal(ev("REQS.local.ok({city:'den'})"),false,'a PNI in another city does not count');
ev("S.won=true;S.pni=S.pni.filter(p=>p.net!==t1Need()[0].id)");
assert.equal(ev("REQS.local.ok({city:'fra'})"),false,'a historical Tier 1 win is insufficient');
ev("S.transit=[{id:'t',net:'cog',city:'fra',tier:0}]");assert.equal(ev("REQS.local.ok({city:'fra'})"),true);
ev("S.transit=[];S.ixp.fra=0");assert.equal(ev("REQS.local.ok({city:'fra'})"),true);
assert.deepEqual(errors,[]);
});