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:
jvanvik 2026-11-09 22:56:55 +01:00
parent ae78e82ddb
commit 1f76639b8f
12 changed files with 77 additions and 1 deletions

View file

@ -40,6 +40,12 @@ const satFrom=b=>satRemote(b)?teleCities().filter(a=>a!==b&&satBirds(a,b).length
// it, as one ordered next to a link does, and the player hears about it. Without this the pair's load is shared with orbit.
function satBeside(a,b){const ls=pairLinks(a,b).filter(l=>l.kind==='sat'&&!l.standby);for(const l of ls)l.standby=true;
if(ls.length)toast(trn('satellites.n_circuits_go_on_standby',ls.length,{a:CITY[a].name,b:CITY[b].name}));return ls.length;}
/* An island or remote town that only satellites join to the rest of your network: its fastest circuit (null when a wave,
a fiber, a cable or a pie dish reaches it too). What is built counts, never today's cuts: a selective peer judges what
you built, not this week's repair (50-peering-policy.js). */
function satOnly(c){if(!satRemote(c)||!S.pops[c]||S.pie&&(S.pie.dishes||[]).some(x=>x.city===c))return null;let best=null;
for(const l of S.links){if(l.a!==c&&l.b!==c)continue;if(l.kind!=='sat'){if(!(l.ready>S.day))return null;continue;}if(!best||satLat(l)<satLat(best))best=l;}
return best;}
// What the teleports and their circuits cost a month (R.cost.sat).
function satMoAll(){let m=0;for(const c in S.pops){const t=teleOf(c);if(t)m+=TPORT_MO+(t>1?TRK_MO:0);}for(const l of S.links)if(l.kind==='sat')m+=l.mo||0;return m;}
/* compute(): what users notice on the edges a satellite circuit is on. sv: the losses of the orbits there; sx: the edge's

View file

@ -29,7 +29,7 @@ function ixCap(c){return ixLagF(c)*(S.myIx[c]?myFab(c).g*(myIxLive(c)?1:0):liveC
function ixSessions(c){
const s=new Set(); if(S.ixp[c]===undefined)return s;
for(const id of ixMembers(c)){const n=NET[id];
if(S.peers[id+'@'+c]&&!snub(id,c)&&!(isRemote(c)&&noRemote(id)))s.add(id);
if(S.peers[id+'@'+c]&&!snub(id,c)&&!(isRemote(c)&&noRemote(id))&&!satNo(id,ixCity(c)))s.add(id);
else if(S.rs[c]&&n.pol==='open'&&ppol()==='open')s.add(id);
else if(S.myIx[c]&&(n.pol==='open'||n.pol==='selective'))s.add(id);}
return s;

View file

@ -20,6 +20,14 @@ const REMOTE_WARN=`<p class="note" style="color:var(--tx-red,var(--bad))">${tr('
const REMOTE_WHY=[tr('peering_policy.policy_no_remote_peers_be_in'),tr('peering_policy.saw_your_session_come_in_over'),tr('peering_policy.only_peers_with_members_they_can'),tr('peering_policy.their_pearingdb_entry_says_remote'),tr('peering_policy.tried_a_remote_peer_once_it')];
function isRemote(c){return S.ixp[c]!==undefined&&!S.pops[ixCity(c)]&&!S.myIx[c];}
function noRemote(id){const n=NET[id];if(!n||n.pol!=='selective')return false;return hstr(id+'|remote')%100<(n.share>=0.03?60:30);}
/* Satellite islands (#83): where a satellite circuit is your only way out of a city, many selective networks will not
peer there. They would hand you traffic for your whole network to haul through orbit: most refuse a GEO hop (about
600 ms there and back), few a MEO one (about 130 ms). A stable verdict per network, like remote peering. */
const SAT_NO={geo:60,meo:15};
const noSat=(id,orb)=>{const n=NET[id];return !!n&&n.pol==='selective'&&own(SAT_NO,orb)&&hstr(id+'|sat')%100<SAT_NO[orb];};
// The circuit network id will not take your traffic over in city c (null when it will, or no satellite is in the way).
function satNo(id,c){const n=NET[id];if(!n||n.pol!=='selective'||hstr(id+'|sat')%100>=SAT_NO.geo)return null;const l=satOnly(c);return l&&noSat(id,SATS[l.bird].orb)?l:null;}
function satPeerWhy(id,c){const l=satNo(id,c);return l?tr('peering_policy.not_while_a_satellite_is_your_only_way',{city:CITY[c].name,orb:SAT_ORB[SATS[l.bird].orb].n,ms:Math.round(2*satLat(l))}):'';}
/* Europe's peering market is crowded and competitive: ports are cheaper, and incumbents cut prices
when a challenger in the same metro gets too popular. DE-KICKS harmonises instead. */
const IX_REG={EU:0.8};

View file

@ -14,6 +14,7 @@ function peerOk(id,via,city){
const sn=snub(id,city);if(sn&&(via==='ix'||sn.all))return {ok:false,snub:true,why:snubWhy(sn)};
if(msfNope(id,city))return {ok:false,why:tr(MSF_NOPE[hstr(ixCity(city)+S.day)%MSF_NOPE.length])};
if(via==='ix'&&city&&isRemote(city)&&noRemote(id))return {ok:false,remote:true,why:REMOTE_WHY[hstr(id)%REMOTE_WHY.length]};
if(city&&(via==='ix'||via==='pni')){const w=satPeerWhy(id,ixCity(city));if(w)return {ok:false,sat:true,why:w};}
if(n.pol==='open')return {ok:true};
// In the Cogentle Spat, Goggle's peering desk wants eight times the usual traffic first, so cheap Cogentle-only transit really costs you Goggle (playtest).
if(n.pol==='selective'){const need=Math.round((via==='pni'?n.minPni:n.minIx)*confBoost(id)*salesPeerMul()*(id==='ggl'&&scnRule('spat')?8:1));return dem>=need?{ok:true}:{ok:false,why:tr('sold_out.wants_need_gbps_of_traffic_from',{need,dem:dem.toFixed(1)})};}