Pie in the Sky: backhaul for POPs cut off from the backbone

A pie dish at a POP the backbone does not reach now lifts all of that
POP's own traffic to a landing dish on the backbone (bent pipe within
1,000 km, lasers past that): one virtual edge, capacity min(dish, landing
dish, crust) after terminals, latency the orbit path. Its IGP weight is
Infinity; only the cut-off POP's paths are rerun with it (pieRelink), so
POPs on the backbone never route through orbit and saves without a
cut-off dish route exactly as before. Spats, safe mode, a down crust,
landing rights and backhoes cut it.

A cut-off dish now reports 'backhaul' or 'isl' (it said 'ok' when it
had local terminals). Rule O3 now reads: a cut-off pie dish carries only
its own POP's traffic and local terminals, never transit between other
cities.
This commit is contained in:
Frederic Jung 2026-11-04 07:37:03 +01:00
parent 4ad080cb91
commit 940ce0df10
No known key found for this signature in database
6 changed files with 94 additions and 41 deletions

View file

@ -32,7 +32,7 @@ const EXCEPTIONS = {
W3: {
ivc: 'Invercargill waits for its AI campus; nobody sells transit there yet',
jub: 'Nobody sells transit in Juba: MTN and Zain haul it in from abroad',
pcn: 'Pitcairn: no cable, no network, land your own (#124)',
pcn: 'Pitcairn: no cable, no network, land your own (#124), or reach it with a pie dish (backhaul through orbit)',
prr: 'Prince Rupert is a remote town with no carrier in it',
smr: 'San Marino buys its transit from Italian carriers in Bologna and Rimini; nobody sells it in the town',
sre: "Sucre has no exchange or carrier facility: Bolivia's transit is bought in La Paz",
@ -560,13 +560,20 @@ test('O2: a half-baked crust carries nothing; orbit never carries more than the
assert.deepEqual(g.errors, []);
});
test('O3: a dish off the backbone carries no transit', () => {
test('O3: a cut-off pie dish carries only its own POP\'s traffic (backhaul) and local terminals, never transit between other cities', () => {
const g = orbit();
g.ev("ACT.buildPop({city:'syd'});ACT.pieDish({city:'syd'});S.pie.lic.AU={state:'ok',until:1e6};compute()");
g.ev("ACT.buildPop({city:'syd'});ACT.pieDish({city:'syd'});S.pie.lic.AU={state:'ok',until:1e6};S.pops.syd.bb={d:5};S.pops.lon.bb={d:20};S.pops.nyc.bb={d:20};compute()");
assert.ok(g.ev("R.pie.isl.includes('syd')"), 'O3: the island dish is flagged');
g.c('h', 'lon', 'syd');
assert.equal(g.ev('R.l2.h||0'), 0, 'O3: traffic crossed an island dish');
assert.equal(g.ev("Object.keys(R.ef).some(k=>k.includes('syd'))"), false);
g.c('h', 'lon', 'nyc'); g.c('s', 'lon', 'syd'); g.c('b', 'nyc', 'lon', 'l2vpn', 10); g.c('p', 'cbr', null, 'pizza', 5);
const syd = g.ev("JSON.stringify(Object.keys(R.ef).filter(k=>k.includes('syd')))");
assert.deepEqual(JSON.parse(syd), ['pie:bh:syd'], 'O3: the only edge at the island dish is its own backhaul');
const ef = JSON.parse(g.ev("JSON.stringify(R.ef['pie:bh:syd'])"));
assert.ok(ef.eg['l2:s'] > 0, "O3: Sydney's own circuit rides its backhaul");
assert.ok(!ef.eg['l2:h'] && !ef.eg['l2:b'], 'O3: a circuit between two other cities crossed the island dish');
// IP flows are counted by the POP they come from (and circuits by their far end): only Sydney's own
assert.deepEqual(Object.keys(ef.dst).filter((c) => c !== 'syd' && !(c === 'lon' && ef.eg['l2:s'] > 0)), [], 'O3: another POP\'s traffic crossed the backhaul');
assert.ok(ef.dst.syd > 0, "O3: Sydney's eyeballs and its terminal ride the backhaul");
assert.ok(g.ev("Object.keys(R.ef).filter(k=>k.startsWith('pie:')&&k!=='pie:bh:syd').every(k=>Object.keys(R.ef[k].eg).every(e=>e.startsWith('l2:')))"), 'O3: IP traffic of a POP on the backbone crossed orbit');
assert.deepEqual(g.errors, []);
});

View file

@ -71,14 +71,16 @@ test('O2: a half-baked crust carries nothing, and orbit never carries more than
assert.deepEqual(errors, []);
});
test('O3: a dish whose POP is off the backbone is flagged and carries no transit, only its own terminals', () => {
test('O3: a dish whose POP is off the backbone is flagged and carries only its own POP\'s traffic and its terminals', () => {
const { ev, errors } = load();
world(ev);
ev("ACT.buildPop({city:'syd'});ACT.pieDish({city:'syd'});S.pie.lic.AU={state:'ok',until:1e6};for(const x of S.pie.dishes)x.ant=PIE_ANT_MAX;compute()");
assert.deepEqual(ev('JSON.stringify(R.pie.isl)'), '["syd"]', 'Sydney has no fiber to the rest');
circuit(ev, 'hs', 'lon', 'syd');
assert.equal(ev('R.l2.hs||0'), 0, 'no way through the island dish');
assert.equal(ev("Object.keys(R.ef).some(k=>k.includes('syd'))"), false);
assert.equal(ev('R.l2.hs'), 5, "a circuit to Sydney is Sydney's own traffic: it rides the backhaul");
assert.ok(ev("R.ef['pie:bh:syd'].eg['l2:hs']") > 0);
circuit(ev, 'ln', 'lon', 'nyc');
assert.equal(ev("Object.keys(R.ef).some(k=>k.includes('syd')&&R.ef[k].eg['l2:ln']>0)"), false, 'never transit between other cities');
// a home next to it still lands there (bent pipe, local only)
term(ev, 'pz', 'cbr');
assert.equal(ev('R.pie.gs.pz'), 'syd');