A carrier's own transit port takes its traffic, with a Carry here switch for other POPs
Transit ports at a POP shared load by free capacity whatever the traffic was for, so Level Tree's own traffic went out of a Tell-Ya port about half the time. Traffic bound for a carrier, or for a network that buys transit from it, now goes out of that carrier's port at the same POP first (the shorter AS path). Each such port is still an ordinary transit exit, so POPs without one use it when nothing nearer has room. A new switch on each transit port, Carry here, pulls that traffic from every POP across your network to this port. The default, Nearest port, keeps using the closest transit port from POPs that have no port of the carrier. The switch only shows when another carrier's port could take the traffic instead. Prefer-marked ports, Backup only, RouteScript and Auto-TE keep their say, and any Prefer-marked transit port switches the rule off. Traceroute follows the same rule and says why it picked an exit. The setting is repaired in sanitize(); old saves load with it off. The routing reference test now has several carriers sharing POPs, ports that carry, backup ports and RouteScript, and its reference loop knows the new ranks.
This commit is contained in:
parent
48e6200c53
commit
ac5928d41d
18 changed files with 257 additions and 12 deletions
|
|
@ -10,7 +10,7 @@ function trExits(net){const day=S.day,ev=S.ev,leak=ev.leak&&ev.leak.until>day?ev
|
|||
for(const x of S.caches)if(x.net===net&&popUp(x.city)&&!siteDown(x.city,'a'))out.push({k:'c',rank:0,city:x.city,pref:'normal',lab:tr('common.name_cache',{name:NET[net].cache.name}),used:R.useCache[x.id]||0,cap:CACHE_CAP});
|
||||
for(const p of S.pni)if(p.net===net&&pniOn(p)&&popUp(p.city)&&liveN(p.city,p.site,p.n))out.push({k:'p',rank:1,city:p.city,pref:p.pref||'normal',lab:tr('common.pni_with_net',{net:NET[net].name}),used:R.usePni[p.id]||0,cap:liveCap(pniG(p),p.city,p.site,p.n)});
|
||||
for(const c in S.ixp)if(ixSessions(c).has(net)&&(popUp(ixCity(c))||remoteCities().includes(ixCity(c)))&&!(ev.ixdown&&ev.ixdown[c]>day))out.push({k:'ix',rank:2,city:ixCity(c),id:c,pref:(S.ixPref&&S.ixPref[c])||'normal',lab:tr('common.ix_peering',{ix:ixName(c)}),used:R.useIx[c]||0,cap:ixCap(c)});
|
||||
for(const t of S.transit)if(popUp(t.city)&&!(t.down>day)&&liveN(t.city,t.site,t.n)&&net!==leak&&!((ev.depeer>day||scnRule('spat'))&&t.net==='cog'&&net==='ggl'))out.push({k:'t',rank:3,city:t.city,pref:t.pref||'normal',lab:tr('traceroute.name_transit',{name:NET[t.net].name}),tnet:t.net,used:R.useT[t.id]||0,cap:liveCap(PORT[t.tier].g,t.city,t.site,t.n)});
|
||||
for(const t of S.transit)if(popUp(t.city)&&!(t.down>day)&&liveN(t.city,t.site,t.n)&&net!==leak&&!((ev.depeer>day||scnRule('spat'))&&t.net==='cog'&&net==='ggl'))out.push({k:'t',rank:3,city:t.city,pref:t.pref||'normal',carry:!!t.carry,lab:tr('traceroute.name_transit',{name:NET[t.net].name}),tnet:t.net,used:R.useT[t.id]||0,cap:liveCap(PORT[t.tier].g,t.city,t.site,t.n)});
|
||||
return out;}
|
||||
function traceroute(src,to){const P=trPaths(src),me=slug(S.name)+'.net',lines=[],ip=(a,b)=>`100.64.${a%250}.${b%250}`;let rtt=0.3,n=1;
|
||||
const hop=(host,addr,extra,note)=>{rtt+=extra;lines.push(`${String(n++).padStart(2)} ${host} (${addr}) ${rtt.toFixed(1)} ms${note?' ← '+note:''}`);};
|
||||
|
|
@ -20,8 +20,12 @@ function traceroute(src,to){const P=trPaths(src),me=slug(S.name)+'.net',lines=[]
|
|||
const N=NET[to.net],ex=trExits(to.net).filter(e=>P.dist[e.city]!==undefined);
|
||||
lines.unshift(`traceroute to www.${slug(N.name)}.example (${N.name}, AS${N.asn}) from ${CITY[src].name}, 30 hops max`);
|
||||
if(!ex.length){lines.push(' 2 * * *\n 3 * * * ← '+tr('traceroute.n_network_unreachable'));return {text:lines.join('\n'),why:tr('traceroute.nothing_on_your_network_reaches_net',{net:N.name,city:CITY[src].name}),asPath:null};}
|
||||
ex.sort((a,b)=>(a.pref==='low'?4:a.rank)-(b.pref==='low'?4:b.rank)||(a.pref==='high'?0:1)-(b.pref==='high'?0:1)||P.dist[a.city]-P.dist[b.city]);
|
||||
// As in compute(): a carrier's own port (or its customers' carrier) goes before other transit, at this POP or anywhere when it carries.
|
||||
const hiAny=S.transit.some(t=>t.pref==='high'&&popUp(t.city)&&!(t.down>S.day)&&liveN(t.city,t.site,t.n)),dtier=e=>hiAny||e.k!=='t'||e.pref==='low'?0:directTier(e.tnet,N.id);
|
||||
const rk=e=>{const r=e.pref==='low'?4:e.rank,t=dtier(e);return t&&(e.carry||e.city===src)?Math.min(r,DIRECT_RANK[t][e.carry?0:1]):r;};
|
||||
ex.sort((a,b)=>rk(a)-rk(b)||(a.pref==='high'?0:1)-(b.pref==='high'?0:1)||P.dist[a.city]-P.dist[b.city]);
|
||||
const e=ex.find(x=>x.used<x.cap*0.999)||ex[0];walk(P.path(e.city));
|
||||
const direct=e.k==='t'&&rk(e)<3?' '+(dtier(e)===1?tr('traceroute.the_carrier_s_own_port_beats_other',{net:N.name}):tr('traceroute.net_buys_transit_from_carrier_so_that',{net:N.name,carrier:NET[e.tnet].name})):'';
|
||||
let asPath=[S.asn];
|
||||
if(e.k==='t'){const T=NET[e.tnet];asPath.push(T.asn);hop(`be-${S.asn}.${e.city}.${slug(T.name)}.net`,`203.0.113.${hstr(e.city)%250}`,0.4,tr('traceroute.hand_off_to_net',{net:T.name}));
|
||||
if(T.id!==N.id){const far=(N.pops&&N.pops.length?N.pops:[e.city]).reduce((a,c)=>kmBetween(e.city,c)<kmBetween(e.city,a)?c:a,(N.pops||[e.city])[0]);const km=CITY[far]?kmBetween(e.city,far):0;
|
||||
|
|
@ -33,7 +37,7 @@ function traceroute(src,to){const P=trPaths(src),me=slug(S.name)+'.net',lines=[]
|
|||
asPath.push(N.asn);if(e.k!=='c')hop(`www.${slug(N.name)}.example`,`198.51.100.${(hstr(N.id)+1)%250}`,0.5+(e.k==='t'?1:0.2),`${N.name}`);
|
||||
const order={c:tr('traceroute.caches_beat_pnis'),p:tr('traceroute.pnis_beat_ix_peering'),ix:tr('traceroute.ix_peering_beats_transit'),t:tr('traceroute.transit_is_the_last_resort')}[e.k];
|
||||
const cn=cnCity(src)!==!!N.cn?' '+tr('traceroute.crossing_the_great_firewall_here',{p:S.ev.gfw>S.day?35:20}):'';
|
||||
return {text:lines.join('\n'),why:`${tr('traceroute.exit_exit_in_city',{exit:e.lab,city:CITY[e.city].name})} ${tr('traceroute.rule_and_closer_exits_win_ties',{rule:order[0].toUpperCase()+order.slice(1)})}${e.pref!=='normal'?tr('traceroute.this_one_is_set_to_mode',{mode:e.pref==='high'?tr('common.prefer'):tr('common.backup_only')}):''}.${e.used>=e.cap*0.999?' '+tr('traceroute.it_is_full_so_some_traffic'):''}${cn}`,asPath};}
|
||||
return {text:lines.join('\n'),why:`${tr('traceroute.exit_exit_in_city',{exit:e.lab,city:CITY[e.city].name})} ${tr('traceroute.rule_and_closer_exits_win_ties',{rule:order[0].toUpperCase()+order.slice(1)})}${e.pref!=='normal'?tr('traceroute.this_one_is_set_to_mode',{mode:e.pref==='high'?tr('common.prefer'):tr('common.backup_only')}):''}.${direct}${e.used>=e.cap*0.999?' '+tr('traceroute.it_is_full_so_some_traffic'):''}${cn}`,asPath};}
|
||||
function traceModal(src,to){const pops=Object.keys(S.pops).sort((a,b)=>CITY[a].name.localeCompare(CITY[b].name));src=src&&S.pops[src]?src:UI.trFrom&&S.pops[UI.trFrom]?UI.trFrom:S.home&&S.pops[S.home]?S.home:pops[0];
|
||||
const nets=NETS.slice().sort((a,b)=>b.share-a.share),t=to||UI.trTo||'net:ggl';UI.trFrom=src;UI.trTo=t;
|
||||
const r=t.startsWith('net:')?traceroute(src,{net:t.slice(4)}):traceroute(src,{city:t.slice(5)});
|
||||
|
|
|
|||
7
src/game/80-simulation/25-direct-egress.js
Normal file
7
src/game/80-simulation/25-direct-egress.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/* A carrier's own transit port beats other transit ports for traffic bound for that carrier (tier 1) or for a network
|
||||
that buys transit from it (tier 2): the shorter AS path. A port set to carry pulls that traffic from every POP; any
|
||||
other only takes it at the POP it sits in. These ranks come after RouteScript's `prefer transit` (2.9) and before plain
|
||||
transit (3), and each port stays in the plain transit list too, so POPs far from it can still use it.
|
||||
DIRECT_RANK[tier] = [carries, this POP only]. compute() and traceroute() share this. */
|
||||
const DIRECT_RANK=[null,[2.92,2.93],[2.94,2.95]];
|
||||
const directTier=(carrier,dest)=>carrier===dest?1:(NET[dest].up&&NET[dest].up.includes(carrier))?2:0;
|
||||
|
|
@ -19,7 +19,7 @@ function compute(){
|
|||
for(const t of S.transit){if(!popUp(t.city)||t.down>day||!liveN(t.city,t.site,t.n))continue;
|
||||
// AS-path prepending (#96) moves part of the port to a last-resort exit of its own.
|
||||
const cap=Math.min(liveCap(PORT[t.tier].g,t.city,t.site,t.n)*lagF(t),TRX&&TRX.cap[t.net]!==undefined?TRX.cap[t.net]:Infinity),pf=TRX&&TRX.prep[t.net]?PREPEND_F[TRX.prep[t.net]]:0;
|
||||
const ex={k:'t',net:t.net,prem:premOn(t),pref:t.pref||'normal',lab:labOf(N_('common.net_transit'),'net',NET[t.net].name),id:t.id,city:t.city,cap:cap*(1-pf),used:0,rank:3,ok:n=>!(depeer&&t.net==='cog'&&n==='ggl')&&n!==leak};
|
||||
const ex={k:'t',net:t.net,prem:premOn(t),pref:t.pref||'normal',carry:!!t.carry,lab:labOf(N_('common.net_transit'),'net',NET[t.net].name),id:t.id,city:t.city,cap:cap*(1-pf),used:0,rank:3,ok:n=>!(depeer&&t.net==='cog'&&n==='ggl')&&n!==leak};
|
||||
E.push(ex);if(pf)E.push({...ex,cap:cap*pf,prep:true});}
|
||||
// `nets`: every network ok() can say yes to, so it need not be asked about the other hundred.
|
||||
for(const c in S.ixp){const ct=ixCity(c);if(!(popUp(ct)||remote.includes(ct))||(S.ev.ixdown&&S.ev.ixdown[c]>day)||!(S.myIx[c]?myIxLive(c):liveN(ct,(S.ixSite||{})[c],(S.ixn||{})[c])))continue;const set=ixSessions(c);R2.sessions+=set.size;
|
||||
|
|
@ -150,12 +150,19 @@ function compute(){
|
|||
const base=e=>e.pref==='low'?4:e.rank;
|
||||
// LOCAL_PREF on an upstream moves it ahead of or behind the other transits, never ahead of peering (#96).
|
||||
const eff=(e,n)=>{let r=base(e);if(TR){if(e.k==='t'&&TR.up[e.net])r=TR.up[e.net]==='prefer'?2.9:3.5;if(e.prep)r=4.4;if(e.k!=='c'&&TR.drain.has(e.city))r=4.6;const o=TR.net[n];if(o){if(o.prefer===e.k)r=0.5;else if(o.avoid===e.k)r=4.5;}}return r;};
|
||||
const RANKS=TR?[0,0.5,1,2,2.9,3,3.5,4,4.4,4.5,4.6]:[0,1,2,3,4];
|
||||
// A carrier's own port for traffic bound for it or for its customers (25-direct-egress.js): tried before plain transit, but
|
||||
// never over RouteScript, a Prefer-marked port or a port set to backup, which all keep the say they had. Such a port is
|
||||
// also an ordinary transit exit (rank 3), so POPs without one of its own can still use it.
|
||||
const hiAny=E.some(e=>e.k==='t'&&e.pref==='high');
|
||||
const dr=(e,n)=>{if(hiAny||e.k!=='t')return 0;const t=directTier(e.net,n);return t&&eff(e,n)===3?DIRECT_RANK[t][e.carry?0:1]:0;};
|
||||
const RANKS=TR?[0,0.5,1,2,2.9,2.92,2.93,2.94,2.95,3,3.5,4,4.4,4.5,4.6]:[0,1,2,2.92,2.93,2.94,2.95,3,4];
|
||||
// With `protect customers`, business flows take every rank first; home users get what is left.
|
||||
const PASSES=TR&&TR.protect?[x=>x.bz,x=>!x.bz]:null;
|
||||
// Each network's exits by the rank they route at (RouteScript can move an exit per network), in E's order.
|
||||
// Each list also knows whether it holds a preferred exit (hi) and its exits by city (at), in list order.
|
||||
const byRank={};for(const id of NET_IDS){const m=byRank[id]={};for(const e of okBy[id]){const r=TR?eff(e,id):base(e);(m[r]||(m[r]=[])).push(e);}
|
||||
// usedRank: the ranks that have a list for some network, so a rank nobody sits at costs no pass over the flows.
|
||||
const byRank={},usedRank=new Set();for(const id of NET_IDS){const m=byRank[id]={};for(const e of okBy[id]){const r=TR?eff(e,id):base(e);(m[r]||(m[r]=[])).push(e);usedRank.add(r);
|
||||
const d=dr(e,id);if(d){(m[d]||(m[d]=[])).push(e);usedRank.add(d);}}
|
||||
for(const r in m){const L=m[r];L.hi=L.some(e=>e.hp===0);L.at=new Map();for(const e of L){const h=L.at.get(e.ci);if(h)h.push(e);else L.at.set(e.ci,[e]);}}}
|
||||
// The flow being routed, and from its POP: distances, arriving edges and the paths walked so far, by city index.
|
||||
let f=null,Dv=null,Pv=null,PP=null,vis=0;const walked=[],G=[],REST=[],NEG=[];
|
||||
|
|
@ -200,12 +207,15 @@ function compute(){
|
|||
// same comparison, so the order is the same either way.
|
||||
const sortD=a=>{const n=a.length;if(n>24){a.sort(byDist);return;}for(let i=1;i<n;i++){const x=a[i];let j=i-1;while(j>=0&&byDist(a[j],x)>0){a[j+1]=a[j];j--;}a[j+1]=x;}};
|
||||
for(const pass of PASSES||[null])for(const rank of RANKS){
|
||||
if(TR?!E.length:!E.some(e=>base(e)===rank))continue;
|
||||
if(!usedRank.has(rank))continue;
|
||||
// A carrier's own port that is not set to carry only takes the traffic of the POP it sits in.
|
||||
const LOC=rank===DIRECT_RANK[1][1]||rank===DIRECT_RANK[2][1];
|
||||
// Index loops in here: plain for…of allocates an iterator per loop until V8 has optimised compute().
|
||||
for(let fi=0,FN=flows.length;fi<FN;fi++){f=flows[fi];
|
||||
if(f.rem<=1e-6||(rank===0&&!f.cache)||(pass&&!pass(f)))continue;
|
||||
const lst=byRank[f.n][rank];if(!lst)continue;
|
||||
Dv=SDi[f.ci];Pv=SPi[f.ci];PP=walked[f.ci]||(walked[f.ci]=[]);vis++;
|
||||
if(LOC){G.length=0;const here=lst.at.get(f.ci);if(!here)continue;for(let h=0;h<here.length;h++){const e=here[h];if(e.used<e.cap)G.push(e);}if(G.length)sendGroup(G,0,G.length);continue;}
|
||||
/* Groups are tried nearest first, preferred exits before the rest, in the order a stable sort of the usable
|
||||
exits gives. Exits only fill up once tried, so the usable ones stay the same until then. Nearly every flow
|
||||
fits in its first group: find that one with a scan (nothing is visited yet), and sort only what is left
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ function sanitize(s){
|
|||
for(const l of s.links){const k=edgeKey(l);if(lo[k]&&l.metric===undefined)lo[k]='normal';delete l.metric;}
|
||||
for(const k in lo)pm[k]=lo[k];const ks=new Set(s.links.map(edgeKey));for(const k of Object.keys(pm))if(!ks.has(k)||!own(MET,pm[k])||pm[k]==='normal')delete pm[k];}
|
||||
const degO=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;
|
||||
s.transit=s.transit.filter(t=>t&&isCity(t.city)&&isNet(t.net)).map(t=>(t.lacp=degO(t.lacp),t.site=['a','b','ab'].includes(t.site)?t.site:'a',t.id=sid(t.id),t.tier=tier(t.tier),t.n=lag(t.n),t.down=num(t.down,0),t.clean=!!t.clean,t.premium=premOnlyAt(NET[t.net],t.city)||!!t.premium&&premCity(NET[t.net],t.city),t));
|
||||
s.transit=s.transit.filter(t=>t&&isCity(t.city)&&isNet(t.net)).map(t=>(t.lacp=degO(t.lacp),t.site=['a','b','ab'].includes(t.site)?t.site:'a',t.id=sid(t.id),t.tier=tier(t.tier),t.n=lag(t.n),t.down=num(t.down,0),t.clean=!!t.clean,t.carry===true||delete t.carry,t.premium=premOnlyAt(NET[t.net],t.city)||!!t.premium&&premCity(NET[t.net],t.city),t));
|
||||
s.pni=s.pni.filter(x=>x&&isCity(x.city)&&isNet(x.net)).map(x=>(x.lacp=degO(x.lacp),x.site=['a','b','ab'].includes(x.site)?x.site:'a',x.id=sid(x.id),x.tier=tier(x.tier),x.n=lag(x.n),x.sacrif=!!x.sacrif,x));
|
||||
// PNIs on order (#…): delivery day, a pending augment, and 1G for the one network that sells it
|
||||
for(const x of s.pni){if(x.ready!==undefined)x.ready=num(x.ready,0);if(x.g1)x.g1=x.tier===0&&x.net==='dtk'?true:undefined;else delete x.g1;if(x.up){const u=x.up;x.up=u&&typeof u==='object'?{tier:tier(u.tier),n:lag(u.n),ready:num(u.ready,0),g1:!!u.g1&&x.net==='dtk'&&tier(u.tier)===0}:undefined;if(!x.up)delete x.up;}}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ Object.assign(ACT,{
|
|||
cancelVxc:({id})=>{if(UI.confirm!==id){UI.confirm=id;renderPanel();return;}S.links=S.links.filter(l=>l.id!==id);prunePairMet();const rem=remoteCities();for(const c in S.ixp){if(!S.pops[ixCity(c)]&&!rem.includes(ixCity(c))){delete S.ixp[c];delete S.rs[c];for(const k in S.peers)if(k.endsWith('@'+c))delete S.peers[k];}}UI.sel=null;UI.confirm=null;after();},
|
||||
setPref:({kind,id,v})=>{if(!own(PREF,v))return;if(kind!=='t'&&kind!=='p'&&!(isIx(id)&&S.ixp[id]!==undefined))return;if(kind==='t'){const t=S.transit.find(x=>x.id===id);if(t)t.pref=v;}else if(kind==='p'){const x=S.pni.find(y=>y.id===id);if(x)x.pref=v;}else{S.ixPref=S.ixPref||{};S.ixPref[id]=v;}sfx('click');after();},
|
||||
setMetric:({id,v})=>{if(!own(MET,v))return;const l=S.links.find(x=>x.id===id);if(!l)return;const m=S.pairMet||(S.pairMet={}),k=edgeKey(l);if(v==='normal')delete m[k];else m[k]=v;sfx('click');after();},
|
||||
setCarry:({id,on})=>{const t=S.transit.find(x=>x.id===id);if(!t)return;if(on)t.carry=true;else delete t.carry;sfx('click');after();},
|
||||
setStandby:({id,on})=>{const l=S.links.find(x=>x.id===id);if(!l)return;if(on)l.standby=true;else delete l.standby;sfx('click');after();},
|
||||
goEgress:({city,k})=>{ACT.focusCity({city});UI.tab=k==='t'?'up':k==='l2'?'cust':k==='nni'?'links':'peer';renderPanel();},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ function cityPanel(c){
|
|||
for(const n of prov){const t=S.transit.find(x=>x.city===c&&x.net===n.id);const pr=transitPerG(n,c,premOnlyAt(n,c)||!!(t&&premOn(t)))*S.priceMul;
|
||||
h+=`<div class="row">${logo(n)}<div class="grow"><div class="nm">${esc(n.name)} <span class="tag ${n.type}">${TYPE_L[n.type]}</span></div><div class="meta">${tr('city_panel.price_per_gbps_month_billed_on',{price:pr.toFixed(2)})}</div>${premOnlyAt(n,c)&&!t?`<div class="meta">${tr('city_panel.only_the_cn_too_premium_crossing')}</div>`:''}`;
|
||||
if(t){const u=R.useT[t.id]||0,cap=lagCap(PORT[t.tier].g,t.n),tdown=t.down>S.day;
|
||||
h+=`<div class="kv"><span>${lagName(t.tier,t.n)}${tdown?' · <b style="color:var(--bad)">'+tr('common.outage')+'</b>':''}</span><b>${fmtG(u)}</b></div><div class="bar ${barCls(u/cap)}"><i style="width:${u/cap*100}%"></i></div>${prefCtl('t',t.id,t.pref)}${siteCtl('t',t.id,c,t.site)}${premOnlyAt(n,c)?`<p class="note">${tr('city_panel.only_the_cn_too_premium_crossing')}</p>`:premCity(n,c)?`<div class="btns">${btn(t.premium?tr('city_panel.cn_too_premium_on'):tr('city_panel.switch_to_cn_too_premium_x',{x:n.premium}),'togglePrem',{id:t.id},t.premium?'green sm':'sm')}</div>`:''}${(()=>{const top=transitTop([t.id],4);return top.length?`<div class="ttop"><div class="meta"><b>${tr('city_panel.top_destinations_on_this_port')}</b></div>${top.map(([id,v])=>`<div class="meta">${esc(NET[id].name)} · ${fmtG(v)} · <i>${esc(offTransitHint(id,c))}</i></div>`).join('')}</div>`:'';})()}<div class="meta">${tr('city_panel.95th_pct_p95_commit_commit_bill',{p95:fmtG(R.p95[t.id]||0),commit:fmtG(cap*.2),bill:fmt$(Math.max(R.p95[t.id]||0,PORT[t.tier].g*(t.n||1)*.2)*pr+PORT[t.tier].tmo*(t.n||1))})}</div>
|
||||
h+=`<div class="kv"><span>${lagName(t.tier,t.n)}${tdown?' · <b style="color:var(--bad)">'+tr('common.outage')+'</b>':''}</span><b>${fmtG(u)}</b></div><div class="bar ${barCls(u/cap)}"><i style="width:${u/cap*100}%"></i></div>${prefCtl('t',t.id,t.pref)}${carryCtl(t)}${siteCtl('t',t.id,c,t.site)}${premOnlyAt(n,c)?`<p class="note">${tr('city_panel.only_the_cn_too_premium_crossing')}</p>`:premCity(n,c)?`<div class="btns">${btn(t.premium?tr('city_panel.cn_too_premium_on'):tr('city_panel.switch_to_cn_too_premium_x',{x:n.premium}),'togglePrem',{id:t.id},t.premium?'green sm':'sm')}</div>`:''}${(()=>{const top=transitTop([t.id],4);return top.length?`<div class="ttop"><div class="meta"><b>${tr('city_panel.top_destinations_on_this_port')}</b></div>${top.map(([id,v])=>`<div class="meta">${esc(NET[id].name)} · ${fmtG(v)} · <i>${esc(offTransitHint(id,c))}</i></div>`).join('')}</div>`:'';})()}<div class="meta">${tr('city_panel.95th_pct_p95_commit_commit_bill',{p95:fmtG(R.p95[t.id]||0),commit:fmtG(cap*.2),bill:fmt$(Math.max(R.p95[t.id]||0,PORT[t.tier].g*(t.n||1)*.2)*pr+PORT[t.tier].tmo*(t.n||1))})}</div>
|
||||
<div class="btns">${PORT.map((P2,i)=>i>t.tier&&portShown(i)?btn((t.n||1)>1?tr('common.upgrade_all_to_port_cost_mo',{port:P2.n,cost:fmt$(P2.setup*(t.n||1)),mo:fmt$(P2.tmo*(t.n||1))}):tr('common.upgrade_port_cost_mo_mo',{port:P2.n,cost:fmt$(P2.setup*(t.n||1)),mo:fmt$(P2.tmo*(t.n||1))}),'buyTransit',{city:c,net:n.id,tier:i},'sm',S.cash<P2.setup*(t.n||1)||!portOk(c,i)):'').join('')}${(t.n||1)<LAG_MAX?btn(tr('common.lag_member_cost_mo_mo',{cost:fmt$(PORT[t.tier].setup),mo:fmt$(PORT[t.tier].tmo)}),'lagT',{id:t.id,d:1},'sm',S.cash<PORT[t.tier].setup||!portOk(c,t.tier)):''}${(t.n||1)>1?btn(tr('common.member'),'lagT',{id:t.id,d:-1},'ghost sm'):''}${btn(t.clean?tr('city_panel.clean_pipe_on'):tr('city_panel.clean_pipe_mo_mo_scrubs_ddos',{mo:fmt$(cleanMo(t))}),'cleanPipe',{id:t.id},t.clean?'green sm':'sm')}${btn(UI.confirm===t.id?tr('common.really_cancel'):tr('common.cancel'),'cancelTransit',{id:t.id},'ghost sm')}</div>`;}
|
||||
else h+=`<div class="btns">${PORT.map((P2,i)=>portShown(i)?btn(tr('city_panel.port_cost_mo_mo',{port:P2.n,cost:fmt$(P2.setup),mo:fmt$(P2.tmo)}),'buyTransit',{city:c,net:n.id,tier:i},'sm',S.cash<P2.setup||!portOk(c,i)):'').join('')}</div>`;
|
||||
h+=`</div></div>`;}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ function vxcPanel(l){
|
|||
return h;
|
||||
}
|
||||
function prefCtl(kind,id,cur){cur=cur||'normal';return `<div class="btns"><span class="meta" style="align-self:center">${tr('common.egress')}</span>${Object.keys(PREF).map(v=>btn(PREF[v],'setPref',{kind,id,v},cur===v?'pink sm':'ghost sm')).join('')}</div>`;}
|
||||
// At its own POP a carrier's port always takes that carrier's traffic (25-direct-egress.js). From POPs with no port of it, the
|
||||
// traffic goes to the nearest transit port, or across your network to this one. Only worth asking when something else could take it.
|
||||
function carryCtl(t){if(Object.keys(S.pops).length<2||!S.transit.some(x=>x.net!==t.net))return '';const n=esc(NET[t.net].name);
|
||||
return `<div class="btns"><span class="meta" style="align-self:center">${tr('link_panels.traffic_for_net',{net:n})}</span>${btn(tr('link_panels.nearest_port'),'setCarry',{id:t.id,on:0},t.carry?'ghost sm':'pink sm')}${btn(tr('link_panels.carry_here'),'setCarry',{id:t.id,on:1},t.carry?'pink sm':'ghost sm')}</div><div class="meta">${t.carry?tr('link_panels.every_pop_carries_net_s_traffic',{net:n}):tr('link_panels.at_this_pop_net_s_traffic_always',{net:n})}</div>`;}
|
||||
function trafficSection(l){
|
||||
const rec=R.ef[edgeKey(l)],n=pairLinks(l.a,l.b).length;
|
||||
let h=`<section><h3>${tr('link_panels.what_s_on_this_link')}</h3>`;
|
||||
|
|
|
|||
|
|
@ -2101,12 +2101,14 @@
|
|||
"link_panels.abandon_the_fiber":"Abandon the fiber",
|
||||
"link_panels.add_parallel_link":"Add parallel link",
|
||||
"link_panels.apply_for_a_license_price_mo":"Apply for a license <small>{price} + {mo}/mo · ~45 days</small>",
|
||||
"link_panels.at_this_pop_net_s_traffic_always":"At this POP, {net}'s traffic always uses this port. POPs without one use their nearest transit port.",
|
||||
"link_panels.back_in_n_days":"Back in {n} days.",
|
||||
"link_panels.behind_the_great_firewall":"Behind the Great Firewall",
|
||||
"link_panels.biggest_fabric_money_can_buy":"Biggest fabric money can buy.",
|
||||
"link_panels.biggest_feeder_egress_in_city_set":"Biggest feeder: {egress} in {city}. Set it to “Backup only”, give the customers a closer egress (peering, a cache, local transit), or raise this link's metric.",
|
||||
"link_panels.build_a_pop_here_first":"Build a POP here first.",
|
||||
"link_panels.cancel_the_iru":"Cancel the IRU",
|
||||
"link_panels.carry_here":"Carry here",
|
||||
"link_panels.click_to_tear_down":"Click to tear down",
|
||||
"link_panels.collecting_data_check_back_in_a":"Collecting data. Check back in a few days.",
|
||||
"link_panels.congested_upgrade_it_or_add_a":"Congested. Upgrade it or add a parallel path.",
|
||||
|
|
@ -2115,6 +2117,7 @@
|
|||
"link_panels.de_kicks_personalised_pricing_p_of_3d4f":"DE-KICKS personalised pricing: {p}% of what a normal IX would charge.",
|
||||
"link_panels.each_channel_is_a_pair_of":"Each channel is a pair of optics, one per end. ZR+ optics plug straight into your routers. Transponders sit on a shelf.",
|
||||
"link_panels.enters_your_network_at":"Enters your network at",
|
||||
"link_panels.every_pop_carries_net_s_traffic":"Every POP carries {net}'s traffic across your network to this port.",
|
||||
"link_panels.finish_in_1_day_price":"Finish in 1 day <small>{price}</small>",
|
||||
"link_panels.foreign_networks_need_a_local_joint":"Foreign networks need a local joint venture and an operating license to build infrastructure here.",
|
||||
"link_panels.found_your_own_ix_cost_mo":"Found your own IX <small>{cost} + {mo}/mo</small>",
|
||||
|
|
@ -2147,6 +2150,7 @@
|
|||
"link_panels.name_is_down_nothing_you_can":"{name} is down. Nothing you can do but wait, or have another path.",
|
||||
"link_panels.name_parallel_link":"{name} parallel link",
|
||||
"link_panels.name_wave":"{name} wave",
|
||||
"link_panels.nearest_port":"Nearest port",
|
||||
"link_panels.needs_a_pop_in_cities_too":"Needs a POP in {cities} too.",
|
||||
"link_panels.needs_what":"needs {what}",
|
||||
"link_panels.needs_your_own_scrubbing_center":"Needs your own scrubbing center (Infra tab).",
|
||||
|
|
@ -2206,6 +2210,7 @@
|
|||
"link_panels.this_is_the_only_link_between":"This is the only link between these cities. Add a parallel one, or a path through another city.",
|
||||
"link_panels.tier_1_only_a_pni_and":"Tier 1: only a PNI, and only once you are big enough for the Tier 1 club",
|
||||
"link_panels.totals_for_all_n_links_between":"Totals for all {n} links between these cities.",
|
||||
"link_panels.traffic_for_net":"Traffic for {net}",
|
||||
"link_panels.unplugged_optics_go_on_the_spares":"Unplugged optics go on the spares shelf and are used first next time.",
|
||||
"link_panels.upgrade_fabric_to_name_cost_mo":"Upgrade fabric to {name} <small>{cost} + {mo}/mo</small>",
|
||||
"link_panels.upgrade_to_sys_price":"Upgrade to {sys} <small>{price}</small>",
|
||||
|
|
@ -3049,6 +3054,7 @@
|
|||
"traceroute.ix_peering_beats_transit":"IX peering beats transit",
|
||||
"traceroute.n_network_unreachable":"!N network unreachable",
|
||||
"traceroute.name_transit":"{name} transit",
|
||||
"traceroute.net_buys_transit_from_carrier_so_that":"{net} buys transit from {carrier}, so that port beats the other transit ports.",
|
||||
"traceroute.net_carries_it_to_city":"{net} carries it to {city}",
|
||||
"traceroute.net_hands_it_to_to":"{net} hands it to {to}",
|
||||
"traceroute.no_path_every_route_between_these":"No path: every route between these cities is down or missing.",
|
||||
|
|
@ -3057,6 +3063,7 @@
|
|||
"traceroute.pnis_beat_ix_peering":"PNIs beat IX peering",
|
||||
"traceroute.private_cross_connect":"private cross-connect",
|
||||
"traceroute.rule_and_closer_exits_win_ties":"{rule}, and closer exits win ties",
|
||||
"traceroute.the_carrier_s_own_port_beats_other":"This port goes straight to {net}, so it beats the other transit ports.",
|
||||
"traceroute.this_one_is_set_to_mode":"; this one is set to {mode}",
|
||||
"traceroute.transit_is_the_last_resort":"transit is the last resort",
|
||||
"tutorial.businesses_pop_up_as_bubbles_on":"Businesses pop up as $ bubbles on the map. Open Deals and sign your first customer.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue