Selective peers will not meet you where a satellite is your only way out (#83)
An island or remote town that only satellite circuits join to the rest of your network (satOnly: no built wave, fiber, cable or pie dish there, its fastest circuit otherwise) is a place many selective networks will not peer: they would hand you traffic for your whole network to haul through orbit. Like remote peering, the verdict is stable per network (a hash): 60 in 100 selective networks refuse a GEO hop, 15 in 100 a MEO one, and every network that minds MEO minds GEO too. It is judged on what is built, never on today's cuts, so the single-spur trap does not also pause your peering mid-outage. peerOk refuses new IX sessions and PNIs there with one line naming the orbit and the circuit's round trip; ixSessions leaves an existing session out while the island is satellite-only, without deleting it from S.peers, so it carries again once a wave or cable is lit. Existing PNIs stay. No new state, nothing for saves.
This commit is contained in:
parent
ae78e82ddb
commit
1f76639b8f
12 changed files with 77 additions and 1 deletions
|
|
@ -107,6 +107,60 @@ test('a teleport and a GEO circuit: level, price, lead time, capacity, latency,
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('selective peers will not meet you on an island only a satellite reaches: many refuse GEO, few MEO, none once a cable lands', (t) => {
|
||||
// Suva has an exchange with the big content networks on it; Sydney's teleport reaches it over Intelsplat 18.
|
||||
const { ev, errors } = game(t, "ACT.buildPop({city:'syd'});ACT.launchBB({city:'syd'});ACT.buyTransit({city:'syd',net:'cog',tier:1});ACT.teleBuild({city:'syd'});ACT.buySat({a:'syd',b:'suv',bird:'is18',g:5});");
|
||||
ev('window.innerWidth=360;window.innerHeight=740;window.dispatchEvent(new window.Event("resize"))');
|
||||
ev(ready + ";ACT.buyIx({city:'suv',tier:0});closeModal();compute()");
|
||||
assert.equal(ev("S.ixp.suv"), 0, 'a port on the island exchange');
|
||||
assert.equal(ev("satOnly('suv').bird"), 'is18', 'the circuit is the only way out of Suva');
|
||||
assert.equal(ev("satOnly('syd')"), null, 'Sydney is no island');
|
||||
const sel = J(ev, "ixMembers('suv').filter(id=>NET[id].pol==='selective')");
|
||||
const geoNo = sel.filter((id) => ev(`noSat('${id}','geo')`));
|
||||
assert.ok(geoNo.length > 0 && geoNo.length < sel.length, 'some selective members refuse, some do not: ' + geoNo.join(','));
|
||||
const ms = ev(`Math.round(2*satLat(${sat}))`);
|
||||
assert.ok(ms > 500 && ms < 650, 'a GEO round trip: ' + ms);
|
||||
for (const id of geoNo) {
|
||||
for (const via of ['ix', 'pni']) {
|
||||
const r = J(ev, `peerOk('${id}','${via}','suv')`);
|
||||
assert.equal(r.ok, false, id + ' ' + via);
|
||||
assert.equal(r.sat, true, id + ' ' + via);
|
||||
assert.equal(r.why, `Won't peer in Suva while a GEO satellite is your only way out (${ms} ms there and back): they want your backbone where they meet you.`);
|
||||
}
|
||||
}
|
||||
for (const id of sel.filter((x) => !geoNo.includes(x))) assert.ok(!J(ev, `peerOk('${id}','ix','suv')`).sat, id + ' does not mind');
|
||||
for (const id of J(ev, "ixMembers('suv').filter(id=>NET[id].pol==='open')")) assert.equal(ev(`peerOk('${id}','ix','suv').ok`), true, id + ' is open');
|
||||
// A session from before stays on the books but carries nothing while only the satellite reaches the island.
|
||||
const k = geoNo[0];
|
||||
ev(`S.peers['${k}@suv']=true;compute()`);
|
||||
assert.equal(ev(`ixSessions('suv').has('${k}')`), false);
|
||||
assert.equal(ev(`!!S.peers['${k}@suv']`), true, 'not torn down');
|
||||
// The why, in the island's exchange section, at 360 px.
|
||||
ev("UI.sel={type:'city',id:'suv'};UI.tab='peer';renderAll()");
|
||||
assert.ok(ev("$('panel').textContent").includes(`Won't peer in Suva while a GEO satellite is your only way out (${ms} ms there and back)`));
|
||||
// Fewer selective networks mind a MEO hop, and only ones that also mind GEO; the faster circuit is the one they judge.
|
||||
const all = J(ev, "NETS.filter(n=>n.pol==='selective').map(n=>[n.id,noSat(n.id,'geo'),noSat(n.id,'meo')])");
|
||||
const nGeo = all.filter((x) => x[1]).length, nMeo = all.filter((x) => x[2]).length;
|
||||
assert.ok(nMeo > 0 && nMeo < nGeo / 2, `MEO ${nMeo}, GEO ${nGeo}`);
|
||||
assert.ok(all.every((x) => !x[2] || x[1]), 'a network that minds MEO minds GEO too');
|
||||
ev("ACT.teleTrk({city:'syd'});ACT.buySat({a:'syd',b:'suv',bird:'o3b',g:2});closeModal();S.day=S.links.find(l=>l.bird==='o3b').ready;compute()");
|
||||
assert.equal(ev("satOnly('suv').bird"), 'o3b', 'MEO is the faster way out');
|
||||
for (const id of geoNo) assert.equal(!!J(ev, `peerOk('${id}','ix','suv')`).sat, ev(`noSat('${id}','meo')`), id + ' over MEO');
|
||||
// A wave lands: only once it is lit does Suva stop being a satellite island.
|
||||
ev("UI.pending={a:'syd',b:'suv'};ACT.buildLink({tier:1});closeModal();compute()");
|
||||
const w = "S.links.find(l=>l.kind==='wave')";
|
||||
ev(`${w}.ready=S.day+5;compute()`);
|
||||
assert.ok(ev("!!satOnly('suv')"), 'still being provisioned');
|
||||
ev(`S.day=${w}.ready;compute()`);
|
||||
assert.equal(ev("satOnly('suv')"), null);
|
||||
for (const id of geoNo) assert.ok(!J(ev, `peerOk('${id}','ix','suv')`).sat, id + ' with a backbone to meet');
|
||||
assert.equal(ev(`ixSessions('suv').has('${k}')`), true, 'the old session carries again');
|
||||
// A cut does not change what is built: the island is still on the backbone as far as the peers go.
|
||||
ev(`${w}.cut=S.day+30;compute()`);
|
||||
assert.equal(ev("satOnly('suv')"), null);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('MEO needs tracking antennas and a higher level, and users barely notice it', (t) => {
|
||||
const { ev, errors } = game(t, ISLE + "ACT.teleBuild({city:'syd'});");
|
||||
ev("ACT.buySat({a:'syd',b:'tbu',bird:'o3b',g:5})");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue