From 68b3d0b839ff24d496a9f40e20af06bcd23f806a Mon Sep 17 00:00:00 2001 From: Frederic Jung Date: Mon, 26 Oct 2026 23:29:49 +0100 Subject: [PATCH] Far-away transit backhaul is slow, and slow is bad service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each transit flow's backhaul round trip over your own links (2× the path latency to the exit) now affects service: free up to 20 ms (~1,500 km), up to 20% worse at 50 ms, and half the service value past 50 ms. sfOf() multiplies delivery by it, so revenue, broadband growth and business customers all feel it. Peering, PNIs and caches are exempt. City panel chip and Transit-tab warning name the far exit and the round trip; the NOC lists slow cities. Two tests updated: Moscow on Frankfurt transit is still fully delivered but now slow, and the Red Sea test pins Asian demand that would otherwise churn away on Marseille transit. --- CHANGELOG.md | 1 + package.json | 2 +- site/i18n/fr.js | 9 +++++++- site/i18n/it.js | 9 +++++++- site/i18n/pt.js | 9 +++++++- site/index.html | 32 ++++++++++++++++++------- tests/issues.test.js | 5 +++- tests/latency.test.js | 54 +++++++++++++++++++++++++++++++++++++++++++ tests/regions.test.js | 4 +++- 9 files changed, 111 insertions(+), 14 deletions(-) create mode 100644 tests/latency.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bf0e48..be9fd01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] +- Backhauling users to transit far away now makes their internet slow, and slow is bad service. Users feel the round trip to wherever their traffic leaves for transit: up to 20 ms (about 1,500 km) is fine, beyond that service suffers, and past 50 ms broadband and internet services count as bad service, which costs revenue and customers. Traffic over your own peering, PNIs and caches is not penalised. Slow cities show a 🐢 in their panel, a warning in the Transit tab and a list in the NOC. - Peering now comes with an inbox: every IX port brings peering requests from networks you have never heard of, and sessions drop when someone blows past the max-prefix limit their PeeringDB promised. Answer requests, decide whether a max-prefix alert is growth or a route leak, and keep your reputation up, because selective networks hear when you never answer. For $20M a year the Large Peering Model AI answers it all for you, quickly and often wrongly. - PNIs take time: a cross-connect with a small network takes a few weeks, and the big content networks, Tier 1s and big eyeball networks quote 6 to 12 months for a new PNI or an augment. The content networks and Tier 1s no longer do 10G PNIs (100G and up), Doitsche Telekomm still sells 1G, and Microsnoft has no capacity on the US east coast at all. - RouteScript has a new “Slop it with AI” button: an AI reads your live traffic, writes you a script and tells you how great it is. A new help page explains what every rule does and how real routers do the same, with seven ready-made scripts (Penny Pincher, Peering First, Shields Up and more) filled in from your own network and loaded with one tap. diff --git a/package.json b/package.json index d09f328..755484a 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "url": "git+https://github.com/fjaeckel/seriesoftubes.git" }, "scripts": { - "test": "node --test --test-concurrency=1 tests/game.test.js tests/build.test.js tests/persist.test.js tests/services.test.js tests/peering.test.js tests/inbox.test.js tests/issues.test.js tests/regions.test.js tests/modes.test.js tests/levels.test.js tests/speed.test.js tests/i18n.test.js tests/routing-reference.test.js tests/perf.test.js tests/sea-routing.test.js", + "test": "node --test --test-concurrency=1 tests/game.test.js tests/build.test.js tests/persist.test.js tests/services.test.js tests/peering.test.js tests/inbox.test.js tests/latency.test.js tests/issues.test.js tests/regions.test.js tests/modes.test.js tests/levels.test.js tests/speed.test.js tests/i18n.test.js tests/routing-reference.test.js tests/perf.test.js tests/sea-routing.test.js", "build": "bash scripts/build.sh", "i18n:check": "node scripts/i18n-check.js", "serve": "npm run build && npx --yes serve@14.2.4 _site", diff --git a/site/i18n/fr.js b/site/i18n/fr.js index 11b219f..ec1e9c8 100644 --- a/site/i18n/fr.js +++ b/site/i18n/fr.js @@ -2813,5 +2813,12 @@ "A cross-connect with a small network takes a few weeks. The big content networks, Tier 1s and big eyeball networks quote 6 to 12 months for a new PNI or an augment, and the content networks and Tier 1s start at 100G. Doitsche Telekomm still sells 1G.":"Un cross-connect avec un petit réseau prend quelques semaines. Les grands réseaux de contenu, les Tier 1 et les grands opérateurs d’accès annoncent 6 à 12 mois pour une nouvelle PNI ou une extension, et les réseaux de contenu et les Tier 1 commencent à 100G. Doitsche Telekomm vend encore du 1G.", "Every IX port brings peering requests and max-prefix alerts, in the Networks tab. A session that blows past its limit is down until you look: raise the limit for growth, keep it down for a leak. Ignore your mail and selective networks get pickier.":"Chaque port IX amène des demandes de peering et des alertes max-prefix, dans l’onglet Réseaux. Une session qui dépasse sa limite reste coupée tant que vous n’y regardez pas : relevez la limite si c’est de la croissance, laissez-la coupée si c’est une fuite. Ignorez votre courrier et les réseaux sélectifs deviennent plus exigeants.", "No navigable sea route connects these landing stations.": "Aucun itinéraire maritime navigable ne relie ces stations d’atterrissement.", -"Surveying a sea route\u2026":"Recherche d’un itinéraire maritime…" +"Surveying a sea route\u2026":"Recherche d’un itinéraire maritime…", +"{p} of {city}’s traffic is backhauled to transit in {to}: {ms} ms round trip. Users notice anything over 20 ms (about 1,500 km), and past 50 ms broadband and internet services count as bad service. Buy transit here or nearby, or peer locally.":"{p} du trafic de {city} est ramené vers le transit à {to} : {ms} ms aller-retour. Les utilisateurs le sentent au-delà de 20 ms (environ 1 500 km), et au-delà de 50 ms le haut débit et les services internet comptent comme un mauvais service. Achetez du transit ici ou à proximité, ou peerez localement.", +"Slow cities":"Villes lentes", +"Their users go out through transit far away. Past 50 ms round trip, broadband and internet services count as bad service.":"Leurs utilisateurs sortent par un transit lointain. Au-delà de 50 ms aller-retour, le haut débit et les services internet comptent comme un mauvais service.", +"{p} of its traffic · {ms} ms round trip · service {sf}":"{p} de son trafic · {ms} ms aller-retour · service {sf}", +"{ms} ms to transit":"{ms} ms jusqu’au transit", +"Backhaul latency":"Latence de backhaul", +"Users feel the round trip to wherever their traffic leaves your network for transit. Up to 20 ms (about 1,500 km) is fine; past 50 ms broadband and internet services count as bad service, which costs revenue and customers. Traffic over your own peering, PNIs and caches is not penalised.":"Les utilisateurs sentent l’aller-retour jusqu’à l’endroit où leur trafic quitte votre réseau pour le transit. Jusqu’à 20 ms (environ 1 500 km), ça va ; au-delà de 50 ms, le haut débit et les services internet comptent comme un mauvais service, ce qui coûte revenus et clients. Le trafic qui passe par votre peering, vos PNI et vos caches n’est pas pénalisé.", }; diff --git a/site/i18n/it.js b/site/i18n/it.js index 4071f5f..b03b749 100644 --- a/site/i18n/it.js +++ b/site/i18n/it.js @@ -2813,5 +2813,12 @@ "A cross-connect with a small network takes a few weeks. The big content networks, Tier 1s and big eyeball networks quote 6 to 12 months for a new PNI or an augment, and the content networks and Tier 1s start at 100G. Doitsche Telekomm still sells 1G.":"Un cross-connect con una rete piccola richiede qualche settimana. Le grandi reti di contenuti, i Tier 1 e i grandi operatori di accesso parlano di 6-12 mesi per una nuova PNI o un ampliamento, e le reti di contenuti e i Tier 1 partono da 100G. Doitsche Telekomm vende ancora 1G.", "Every IX port brings peering requests and max-prefix alerts, in the Networks tab. A session that blows past its limit is down until you look: raise the limit for growth, keep it down for a leak. Ignore your mail and selective networks get pickier.":"Ogni porta IX porta richieste di peering e allarmi max-prefix, nella scheda Reti. Una sessione che supera il limite resta giù finché non ci guardi: alza il limite se è crescita, tienila giù se è un leak. Ignora la posta e le reti selettive diventano più esigenti.", "No navigable sea route connects these landing stations.": "Nessuna rotta marittima navigabile collega queste stazioni di approdo.", -"Surveying a sea route\u2026":"Ricerca di una rotta marittima…" +"Surveying a sea route\u2026":"Ricerca di una rotta marittima…", +"{p} of {city}’s traffic is backhauled to transit in {to}: {ms} ms round trip. Users notice anything over 20 ms (about 1,500 km), and past 50 ms broadband and internet services count as bad service. Buy transit here or nearby, or peer locally.":"Il {p} del traffico di {city} viene riportato al transito a {to}: {ms} ms di andata e ritorno. Gli utenti se ne accorgono oltre i 20 ms (circa 1.500 km), e oltre i 50 ms banda larga e servizi internet contano come servizio scadente. Compra transito qui o vicino, o fai peering in loco.", +"Slow cities":"Città lente", +"Their users go out through transit far away. Past 50 ms round trip, broadband and internet services count as bad service.":"I loro utenti escono attraverso un transito lontano. Oltre i 50 ms di andata e ritorno, banda larga e servizi internet contano come servizio scadente.", +"{p} of its traffic · {ms} ms round trip · service {sf}":"{p} del suo traffico · {ms} ms andata e ritorno · servizio {sf}", +"{ms} ms to transit":"{ms} ms al transito", +"Backhaul latency":"Latenza di backhaul", +"Users feel the round trip to wherever their traffic leaves your network for transit. Up to 20 ms (about 1,500 km) is fine; past 50 ms broadband and internet services count as bad service, which costs revenue and customers. Traffic over your own peering, PNIs and caches is not penalised.":"Gli utenti sentono l’andata e ritorno fino al punto in cui il loro traffico lascia la tua rete per il transito. Fino a 20 ms (circa 1.500 km) va bene; oltre i 50 ms banda larga e servizi internet contano come servizio scadente, e costa ricavi e clienti. Il traffico sul tuo peering, sulle PNI e sulle cache non viene penalizzato.", }; diff --git a/site/i18n/pt.js b/site/i18n/pt.js index be84140..95d3bb4 100644 --- a/site/i18n/pt.js +++ b/site/i18n/pt.js @@ -2813,5 +2813,12 @@ "A cross-connect with a small network takes a few weeks. The big content networks, Tier 1s and big eyeball networks quote 6 to 12 months for a new PNI or an augment, and the content networks and Tier 1s start at 100G. Doitsche Telekomm still sells 1G.":"Um cross-connect com uma rede pequena leva algumas semanas. As grandes redes de conteúdo, os Tier 1 e as grandes operadoras de acesso falam em 6 a 12 meses para uma PNI nova ou uma ampliação, e as redes de conteúdo e os Tier 1 começam em 100G. A Doitsche Telekomm ainda vende 1G.", "Every IX port brings peering requests and max-prefix alerts, in the Networks tab. A session that blows past its limit is down until you look: raise the limit for growth, keep it down for a leak. Ignore your mail and selective networks get pickier.":"Cada porta de IX traz pedidos de peering e alertas de max-prefix, na aba Redes. Uma sessão que estoura o limite fica fora até você olhar: aumente o limite se for crescimento, deixe fora se for vazamento. Ignore seus e-mails e as redes seletivas ficam mais exigentes.", "No navigable sea route connects these landing stations.": "Nenhuma rota marítima navegável conecta estas estações de aterragem.", -"Surveying a sea route\u2026":"Pesquisando uma rota marítima…" +"Surveying a sea route\u2026":"Pesquisando uma rota marítima…", +"{p} of {city}’s traffic is backhauled to transit in {to}: {ms} ms round trip. Users notice anything over 20 ms (about 1,500 km), and past 50 ms broadband and internet services count as bad service. Buy transit here or nearby, or peer locally.":"{p} do tráfego de {city} vai até o trânsito em {to}: {ms} ms de ida e volta. Os usuários percebem qualquer coisa acima de 20 ms (cerca de 1.500 km), e acima de 50 ms banda larga e serviços de internet contam como serviço ruim. Compre trânsito aqui ou perto, ou faça peering local.", +"Slow cities":"Cidades lentas", +"Their users go out through transit far away. Past 50 ms round trip, broadband and internet services count as bad service.":"Os usuários delas saem por um trânsito distante. Acima de 50 ms de ida e volta, banda larga e serviços de internet contam como serviço ruim.", +"{p} of its traffic · {ms} ms round trip · service {sf}":"{p} do tráfego · {ms} ms de ida e volta · serviço {sf}", +"{ms} ms to transit":"{ms} ms até o trânsito", +"Backhaul latency":"Latência de backhaul", +"Users feel the round trip to wherever their traffic leaves your network for transit. Up to 20 ms (about 1,500 km) is fine; past 50 ms broadband and internet services count as bad service, which costs revenue and customers. Traffic over your own peering, PNIs and caches is not penalised.":"Os usuários sentem a ida e volta até onde o tráfego deles sai da sua rede para o trânsito. Até 20 ms (cerca de 1.500 km) está tudo bem; acima de 50 ms banda larga e serviços de internet contam como serviço ruim, o que custa receita e clientes. O tráfego pelo seu próprio peering, PNIs e caches não é penalizado.", }; diff --git a/site/index.html b/site/index.html index 0225777..1702fbc 100644 --- a/site/index.html +++ b/site/index.html @@ -157,6 +157,7 @@ button{font:inherit;color:inherit} .x{margin-left:auto;border:2.5px solid var(--ink);background:var(--paper);border-radius:10px;width:32px;height:32px;font-size:20px;line-height:1;cursor:pointer;font-weight:900;flex:none} .facts{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px} .fact{background:var(--soft);border:2px solid var(--ink);border-radius:9px;padding:1px 8px;font-size:12px;font-weight:700} +.fact.bad{background:#FFE3E3}.warn{background:#FFF1F1;border:2px solid #FF5A5F;border-radius:10px;padding:8px 10px;margin:6px 0;font-size:13px;line-height:1.4} .fact.ixf{background:#FFF3C4} .fact.mine{background:var(--me);color:#fff} .fact.down{background:var(--bad);color:#fff} @@ -1447,7 +1448,7 @@ const GOALS=[ let S=null, R=emptyR(); const UI={sel:null,tab:'cust',left:'goals',speed:1,hover:null,drag:null,snap:null,pending:null,confirm:null,leftOpen:false,muted:false,startCity:'fra',hintOff:false}; let uidN=1; const uid=()=>'i'+(Date.now()%1e7).toString(36)+(uidN++); -function emptyR(){return {nt:{},reachNT:0,teBlack:0,tNet:{},egT:{},netEg:{},l2lat:{},nodeLoad:{},nodeCap:{},div:{},l2:{},gfwLost:0,gfwCross:0,ef:{},egDesc:{},p95:{},peered:0,peerShare:0,load:{},useT:{},useIx:{},usePni:{},useCache:{},cityDem:{},citySrv:{},cityEye:{},demTo:{},served:0,demand:0,reach:0,sessions:0,revMo:0,costMo:0,cost:{},rev:{},reachable:{}};} +function emptyR(){return {nt:{},reachNT:0,teBlack:0,tNet:{},egT:{},netEg:{},l2lat:{},nodeLoad:{},nodeCap:{},div:{},l2:{},gfwLost:0,gfwCross:0,ef:{},egDesc:{},p95:{},peered:0,peerShare:0,load:{},useT:{},useIx:{},usePni:{},useCache:{},cityDem:{},citySrv:{},cityEye:{},latF:{},latFar:{},demTo:{},served:0,demand:0,reach:0,sessions:0,revMo:0,costMo:0,cost:{},rev:{},reachable:{}};} /* ================= BANKS & LOANS ================= Lenders make offers now and then (more often when you are broke). Each loan is a fixed monthly payment that shows up in your costs; conditions are checked @@ -2181,7 +2182,7 @@ function compute(){ /* While routing, each edge keeps its own room (res) and load (ld). Routers only exist in POPs (HAS): their room, load and served traffic are kept per city index. What crosses each edge (R.ef) is added up by egress, and in arrays by network (then 'junk' and 'l2vpn') and by source city, each key in the order it first got traffic. */ - const NRES=new Float64Array(NC),HAS=new Uint8Array(NC),NLOAD=new Float64Array(NC),NSEEN=new Uint8Array(NC),NORD=[],SRV=new Float64Array(NC); + const LATP=new Float64Array(NC),FARL=[],NRES=new Float64Array(NC),HAS=new Uint8Array(NC),NLOAD=new Float64Array(NC),NSEEN=new Uint8Array(NC),NORD=[],SRV=new Float64Array(NC); for(const k in edges)edges[k].res=edges[k].cap;for(const c of pops){const i=CIDX[c];NRES[i]=nodeCap(c);HAS[i]=1;R2.nodeCap[c]=NRES[i];} const nodeTake=(i,a)=>{NRES[i]-=a;if(!NSEEN[i]){NSEEN[i]=1;NORD.push(i);}NLOAD[i]=(NLOAD[i]||0)+a;}; const NKN=NN+2,ACN=new Float64Array(NE*NKN),SEN=new Uint8Array(NE*NKN),ACD=new Float64Array(NE*NC),SED=new Uint8Array(NE*NC),EL=[]; @@ -2269,7 +2270,11 @@ function compute(){ e.used+=amt;f.rem-=amt; if(!f.junk){let ok=amt;const cf=f.cn,ce=e.cn,cn=f.ncn; if(cf!==ce||(cf&&!cn)||(!cf&&cn&&e.k==='t')){const prem=(e.k==='t'&&e.prem)||(e.k==='p'&&e.pnc)||path.some(x=>x.links&&x.links.some(y=>y.premium));const loss=prem?0.03:(ev.gfw>day?0.35:0.2);R2.gfwLost+=amt*loss;R2.gfwCross+=amt;ok=amt*(1-loss);} - SRV[f.ci]+=ok;R2.served+=ok;if(f.bz)R2.bizSrv[f.c]+=ok;if(e.rank<=2)R2.peered+=ok;if(e.k==='t'){const m=R2.tNet[e.id]||(R2.tNet[e.id]={});m[f.n]=(m[f.n]||0)+ok;}R2.egT[e.k]=(R2.egT[e.k]||0)+ok;const ne=NEG[f.nj]||(NEG[f.nj]=R2.netEg[f.n]={c:0,p:0,ix:0,t:0});ne[e.k]+=ok;} + SRV[f.ci]+=ok;R2.served+=ok;if(f.bz)R2.bizSrv[f.c]+=ok;if(e.rank<=2)R2.peered+=ok;if(e.k==='t'){const m=R2.tNet[e.id]||(R2.tNet[e.id]={});m[f.n]=(m[f.n]||0)+ok; + // Backhaul to transit: users notice the round trip to the exit. Up to 20 ms (about 1,500 km) is free, then + // it gets worse, and past 50 ms broadband and internet services count as bad service (#…). + if(path.length){let ms=P.ms;if(ms===undefined){ms=0;for(const l of path)ms+=l.lat;P.ms=ms;}const rtt=2*ms; + if(rtt>LAT_OK){LATP[f.ci]+=ok*latLoss(rtt);if(!P.fg){P.fg=0;FARL.push(P,f.ci,e.ci);}P.fg+=ok;}}}R2.egT[e.k]=(R2.egT[e.k]||0)+ok;const ne=NEG[f.nj]||(NEG[f.nj]=R2.netEg[f.n]={c:0,p:0,ix:0,t:0});ne[e.k]+=ok;} return amt; }; // Shortest path first. With Auto-TE, whatever does not fit spills onto up to two alternate paths @@ -2325,7 +2330,11 @@ function compute(){ } } for(const i of NORD)R2.nodeLoad[CITIES[i].id]=NLOAD[i]; - for(const c of Object.keys(S.pops))R2.citySrv[c]=SRV[CIDX[c]]; + for(const c of Object.keys(S.pops)){const i=CIDX[c];R2.citySrv[c]=SRV[i]; + if(LATP[i]>0&&SRV[i]>0)R2.latF[c]=clamp(1-LATP[i]/SRV[i],0,1);} + // Each city's slowest big exit: (path, source, exit) triples, one per path that went far, in the order they first did. + {const G=new Map();for(let k=0;kcur.g)R2.latFar[c]={to:CITIES[o.to].id,g:o.g,ms:o.ms,share:SRV[o.src]>0?o.g/SRV[o.src]:0};}} // R.ef is read for the link you inspect: each edge's record is put together the first time it is asked for. Scenic // routing only needs the egress amounts, so R.efg keeps those as they are (not listed, so R reads the same). {const efg={};for(const l of EL){const t=l.tr,i=l.i;let rec=null;efg[l.id]=t.g; @@ -2588,7 +2597,11 @@ function routerModels(c){const p=S.pops[c],g=p.rgen||0,rt=p.routers||1; return `
${RG.map((M,i)=>{if(i===g)return '';const why=modelFits(c,i),lk=M.lvl>lvl(); return `
${esc(M.n)} ${M.pn} · ${tr('{n} ports',{n:M.ports})} · ${fmtG(M.cap)} · ${tr('boots in ~{n} min',{n:M.boot})}${M.flaky?' · '+tr('crashes more'):''}
${esc(M.blurb)}
${why?`
${esc(why)}
`:''}
${btn(lk?tr('Level {n}',{n:M.lvl}):tr('Swap {cost} + {mo}/mo',{cost:fmt$(swapCost(c,i)),mo:fmt$(M.mo*rt)}),'upRouter',{city:c,g:i},'sm',lk||!!why||S.cash`;}).join('')}
`;} function portNote(c){const p=S.pops[c];if(!p)return '';const g=p.rgen||0;return RG[g].maxP${tr('Your {model} here tops out at {pn} ports. Bigger ports need a router upgrade (Infra tab).',{model:esc(RG[g].n),pn:RG[g].pn})}

`:'';} -function sfOf(r,c){const d=r.cityDem[c]||0;return d<=1e-6?1:clamp(r.citySrv[c]/d,0,1);} +// Service: what you deliver, times how it feels. Traffic backhauled far to transit is slow, and users notice. +const latSlow=c=>!!(R&&R.latF&&R.latF[c]<0.97&&R.latFar[c]); +function latNote(c){if(!latSlow(c))return '';const f=R.latFar[c];return `
🐢 ${tr('{p} of {city}’s traffic is backhauled to transit in {to}: {ms} ms round trip. Users notice anything over 20 ms (about 1,500 km), and past 50 ms broadband and internet services count as bad service. Buy transit here or nearby, or peer locally.',{p:pct(Math.min(1,f.share)),city:esc(CITY[c].name),to:esc(CITY[f.to].name),ms:Math.round(f.ms)})}
`;} +const LAT_OK=20,LAT_BAD=50,latLoss=rtt=>rtt<=LAT_OK?0:rtt<=LAT_BAD?0.2*(rtt-LAT_OK)/(LAT_BAD-LAT_OK):0.5; +function sfOf(r,c){const d=r.cityDem[c]||0;return d<=1e-6?1:clamp(r.citySrv[c]/d,0,1)*((r.latF&&r.latF[c])??1);} /* ---------- failures & events ---------- */ // A few badges read the incident text: callers whose message mentions a shark, anchor, crocodile or llama pass its English as en. @@ -3557,9 +3570,11 @@ function renderLeft(){checkLayer(); :`
Auto-TE${lvl()<3?tr('Unlocks at customer level 3'):tr('Not installed')}

${tr('Traffic takes the shortest path, even when it is full. A traffic-engineering controller spills the overflow onto the next-best paths with room.')}

${btn(tr('Install Auto-TE {cost} + {mo}/mo',{cost:fmt$(TE_COST),mo:fmt$(TE_MO)}),'buyTE',{},'pink sm',lvl()<3||S.cash`; const hot=S.links.filter(l=>!linkDown(l)&&capOf(l)>0&&(R.load[l.id]||0)/capOf(l)>=0.85).sort((a,b)=>(R.load[b.id]/capOf(b))-(R.load[a.id]/capOf(a))); if(hot.length){h+=`

${tr('Congested links')}

${S.te&&S.te.on?'':'

'+tr('Raise a full link’s metric so traffic prefers another path, upgrade it, or install Auto-TE.')+'

'}`+hot.map(l=>`
${CITY[l.a].name} ⇄ ${CITY[l.b].name}
${capName(l)} · ${tr('{p} full',{p:pct((R.load[l.id]||0)/capOf(l))})}
${btn(tr('Inspect'),'selLink',{id:l.id},'pink sm')}
`).join('');} + const slow=Object.keys(S.pops).filter(latSlow).sort((a,b)=>R.latF[a]-R.latF[b]); + if(slow.length)h+=`

🐢 ${tr('Slow cities')}

${tr('Their users go out through transit far away. Past 50 ms round trip, broadband and internet services count as bad service.')}

`+slow.map(c=>{const f=R.latFar[c];return `
${CITY[c].name} → ${CITY[f.to].name}
${tr('{p} of its traffic · {ms} ms round trip · service {sf}',{p:pct(Math.min(1,f.share)),ms:Math.round(f.ms),sf:pct(R.latF[c])})}
${btn(tr('Inspect'),'focusCity',{city:c},'ghost sm')}
`;}).join(''); const hotR=hotPorts(); if(hotR.length)h+=`

${tr('Ports, caches and routers running hot')}

`+hotR.map(x=>`
${HOTL[x.k]}
${CITY[x.city].name} · ${esc(x.lab)}
${tr('{p} full',{p:pct(Math.min(1,x.u))})}${x.u>=0.995?' · '+tr('dropping or overflowing'):''} · ${esc(x.tip)}
${btn(tr('Inspect'),'focusCity',{city:x.city},'pink sm')}
`).join(''); - if(!S.inc.length&&!hot.length&&!hotR.length)h+=`

${tr('All systems green. Enjoy it while it lasts.')}

`; + if(!S.inc.length&&!hot.length&&!hotR.length&&!slow.length)h+=`

${tr('All systems green. Enjoy it while it lasts.')}

`; if(S.log&&S.log.length){h+=`

${tr('Recent events')}

`+S.log.slice(0,15).map(e=>`
${dateStr(e.d)} ${esc(e.t)}
`).join('');} h+=`
${tr('Incidents so far')}${S.stats.incidents}
${tr('Survived with no impact')}${S.stats.survived}
`; }else{ @@ -3587,7 +3602,7 @@ function renderPanel(){checkLayer(); function cityPanel(c){ const C=CITY[c],p=S.pops[c],ix=ixName(c),down=p&&p.down>S.day; let h=`
${REG[C.reg]} · ${esc(C.dc)}

${C.name}

-
${tr('{g} of eyeballs',{g:fmtG(eyeP(c))})}${regionMult(c)>1?`${tr('Transit {x}× pricier',{x:regionMult(c)})}`:''}${C.reg==='AS'&&!C.cn?''+tr('Underserved: users grow 60% faster')+'':''}${ix?`${tr('IX: {ix}',{ix:esc(ix)})}`:''}${p?`${tr('Your POP')}`:''}${down?`DOWN`:''}
+
${tr('{g} of eyeballs',{g:fmtG(eyeP(c))})}${latSlow(c)?`🐢 ${tr('{ms} ms to transit',{ms:Math.round(R.latFar[c].ms)})}`:''}${regionMult(c)>1?`${tr('Transit {x}× pricier',{x:regionMult(c)})}`:''}${C.reg==='AS'&&!C.cn?''+tr('Underserved: users grow 60% faster')+'':''}${ix?`${tr('IX: {ix}',{ix:esc(ix)})}`:''}${p?`${tr('Your POP')}`:''}${down?`DOWN`:''}
`; if(!p){ h+=`
${C.note?`

${esc(C.note)}

`:''} @@ -3624,7 +3639,7 @@ function cityPanel(c){ for(const b of bz)h+=`
${esc(b.name)}
${esc(BIZ_T[b.type].l)}${b.city2?` ${CITY[b.city].name} ⇄ ${CITY[b.city2].name}`:''} · ${bTerms(b)}${BIZ_T[b.type].l2?` · ${b.sites?tr('carrying {g} per site',{g:fmtG(R.l2[b.id]||0)}):tr('carrying {g}',{g:fmtG(R.l2[b.id]||0)})}`:''}${BIZ_T[b.type].fiber&&!fiberOk(b)?' · '+tr('fiber is down')+'':''}${BIZ_T[b.type].event&&eventLive(b)?` · ${tr('serving {v}',{v:pct(sfOf(R,b.city))})}`:''}${b.type==='scrub'&&!hasScrub()?' · '+tr('needs a scrubbing center')+'':''}${S.day-(b.since||0)<15?` · ${tr('provisioning, {n}d grace',{n:15-(S.day-(b.since||0))})}`:''}
${reqList(b)}${BIZ_T[b.type].l2?routeCtl(b):''}
${tr('Happiness {p}%',{p:Math.round(b.mood)})}
${btn(UI.confirm===b.id?tr('Really drop?'):tr('Drop'),'dropBiz',{id:b.id},'ghost sm')}
`; h+=``+offersHere(c); }else if(UI.tab==='up'){ - h+=portNote(c); + h+=portNote(c)+latNote(c); h+=`

${tr('IP transit')}

${tr('Pay a bigger network per Gbps and it carries your traffic to the whole internet. Billed on the 95th percentile of the last 30 days, with a 20% commit and a port fee. Spikes like DDoS raise your bill.')}

`; const prov=NETS.filter(n=>n.price&&n.pops.includes(c)).sort((a,b)=>a.price-b.price); if(!prov.length)h+=`

${tr('Nobody sells transit here. Haul your traffic over fiber to a city that has it.')}

`; @@ -4212,6 +4227,7 @@ function showHelp(){
${tr('IX (Internet Exchange)')}
${tr('A shared switch in a city. One port, many free peering sessions. The route server peers you with every open member at once.')}
PNI
${tr('Private network interconnect: a cable straight to one network in the same building. For big traffic.')}
${tr('PNI lead times')}
${tr('A cross-connect with a small network takes a few weeks. The big content networks, Tier 1s and big eyeball networks quote 6 to 12 months for a new PNI or an augment, and the content networks and Tier 1s start at 100G. Doitsche Telekomm still sells 1G.')}
+
${tr('Backhaul latency')}
${tr('Users feel the round trip to wherever their traffic leaves your network for transit. Up to 20 ms (about 1,500 km) is fine; past 50 ms broadband and internet services count as bad service, which costs revenue and customers. Traffic over your own peering, PNIs and caches is not penalised.')}
${tr('Peering inbox')}
${tr('Every IX port brings peering requests and max-prefix alerts, in the Networks tab. A session that blows past its limit is down until you look: raise the limit for growth, keep it down for a leak. Ignore your mail and selective networks get pickier.')}
${tr('Embedded cache')}
${tr('A CDN\'s server in your rack. Serves most of that CDN\'s traffic locally, for the price of power.')}
DE-KICKS
${tr('The group behind several big exchanges (Frankfurt, Madrid, Marseille, Dubai, Mumbai, New York) treats price lists as a state secret. Ports are quoted per customer and go up the bigger you look. Haggling can work, backfire or stall for a week. Prices get "harmonised" upwards once a year, add-ons appear on your invoice until you opt out, and trying to leave earns you a retention discount that ends with a fee.')}
${tr('Remote peering')}
${tr('Reach an IX over a fabric circuit without a POP there. It works, and the route server still gets you every open network, but it is discouraged: the reseller charges 1.5× for the port and oversubscribes it to 80%, latency rides the fabric, one fabric outage drops every session, and many selective networks refuse remote members outright.')}
${tr('Peering policy')}
${tr('Open peers with anyone. Selective wants to see traffic first. Restrictive (Tier 1s) only peers with giants, over PNIs. Paid means exactly that. Big selective networks also have moods: in some cities they refuse new peers for a few months, or only take PNIs, and now and then they tear down a session you already had. Try another city or a PNI, and ask again later.')}
diff --git a/tests/issues.test.js b/tests/issues.test.js index 72a6e9a..e04bbb1 100644 --- a/tests/issues.test.js +++ b/tests/issues.test.js @@ -1228,7 +1228,10 @@ test('#113 Red Sea Crisis wants traffic into Asia for a month, not broadband and build(1); ev("for(const n of NETS.filter(n=>n.price&&n.pops.includes('mrs')).slice(0,2))ACT.buyTransit({city:'mrs',net:n.id,tier:1});for(const c of ['sin','bom'])if(!S.pops[c].bb)ACT.launchBB({city:c});after()"); assert.ok(!ev('S.scn.done')); - let d = 0; while (!ev('S.scn.done') && d < 200) { ev('dayTick()'); d++; } + // Asian users backhauled to Marseille transit get slow service and would churn away; keep them subscribed, + // this is about the 30-day counter. + ev("window.__bb={sin:60,bom:60}"); + let d = 0; while (!ev('S.scn.done') && d < 200) { ev('for(const c of ["sin","bom"])S.pops[c].bb.d=Math.max(S.pops[c].bb.d,__bb[c]);dayTick()'); d++; } assert.ok(ev('S.scn.done'), 'won once 80 Gbps crossed into Asia for 30 days in a row'); assert.ok(d >= 30, `took ${d} days`); assert.match(ev("scnProg().items.map(x=>x.l+' '+x.txt).join(' | ')"), /Days in a row at 80(\.0)? Gbps or more 30 \/ 30/); diff --git a/tests/latency.test.js b/tests/latency.test.js new file mode 100644 index 0000000..6b870c5 --- /dev/null +++ b/tests/latency.test.js @@ -0,0 +1,54 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const { load } = require('./harness'); + +function setup(ev) { + ev("ACT.start({});S.cash=1e9;S.lvl=6;S.nextFail=S.nextEvent=1e9;for(const g of GOALS)S.done[g.id]=0;for(const c of ['nyc','lon','ams'])ACT.buildPop({city:c});for(const c in S.pops)S.pops[c].rgen=3"); + ev("UI.via='hibx';openLinkModal('lon','nyc');ACT.buildLink({tier:1});closeModal();UI.via=null;openLinkModal('fra','ams');ACT.buildLink({tier:1});closeModal()"); + ev("ACT.launchBB({city:'lon'});S.pops.lon.bb.d=100;ACT.launchBB({city:'ams'});S.pops.ams.bb.d=100"); +} + +test('broadband backhauled to transit far away is slow, and slow is bad service', () => { + const { ev, errors } = load(); + setup(ev); + ev("ACT.buyTransit({city:'nyc',net:'cog',tier:1});ACT.buyTransit({city:'fra',net:'cog',tier:1});compute()"); + // London's only way out is transit in New York: everything is delivered, and it is all too slow + assert.ok(ev('R.citySrv.lon/R.cityDem.lon') > 0.95, 'delivered'); + assert.ok(ev('R.latFar.lon.ms') > 50, `${ev('R.latFar.lon.ms')} ms round trip`); + assert.equal(ev('R.latFar.lon.to'), 'nyc'); + assert.ok(ev("sfOf(R,'lon')") < 0.55, 'over 50 ms counts as bad service'); + // Amsterdam goes out in Frankfurt, a few hundred kilometres away: fine + assert.equal(ev('R.latF.ams'), undefined); + assert.ok(ev("sfOf(R,'ams')") > 0.95); + // the panel and the NOC say so + ev("UI.sel={type:'city',id:'lon'};UI.tab='up';renderPanel()"); + assert.match(ev("document.getElementById('panelBody').textContent"), /backhauled to transit in New York/); + ev("UI.sel=null;UI.left='noc';UI.leftOpen=true;renderLeft()"); + assert.match(ev("document.getElementById('left').textContent"), /Slow cities/); + // bad service costs customers and money: broadband shrinks instead of growing + const d0 = ev('S.pops.lon.bb.d'), a0 = ev('S.pops.ams.bb.d'); + for (let i = 0; i < 20; i++) ev('dayTick()'); + assert.ok(ev('S.pops.lon.bb.d') < d0, 'London churns'); + assert.ok(ev('S.pops.ams.bb.d') >= a0, 'Amsterdam does not'); + // local transit fixes it + ev("ACT.buyTransit({city:'lon',net:'cog',tier:1});compute()"); + assert.equal(ev('R.latF.lon'), undefined); + assert.ok(ev("sfOf(R,'lon')") > 0.95); + assert.deepEqual(errors, []); +}); + +test('the penalty is on a curve, and traffic that needs no transit is never penalised', () => { + const { ev, errors } = load(); + assert.equal(ev('latLoss(15)'), 0); + assert.equal(ev('latLoss(20)'), 0); + assert.ok(Math.abs(ev('latLoss(35)') - 0.1) < 1e-9); + assert.ok(Math.abs(ev('latLoss(50)') - 0.2) < 1e-9); + assert.equal(ev('latLoss(51)'), 0.5); + setup(ev); + // London reaches an open network over peering in New York: far, but no transit, so no penalty + ev("const x=ixIdsIn('nyc')[0];ACT.buyIx({city:x,tier:1,signed:true});ACT.rs({city:x});compute()"); + assert.ok(ev("Object.keys(R.netEg).some(n=>R.netEg[n].ix>0)"), 'traffic over the IX'); + assert.equal(ev('R.latF.lon'), undefined); + assert.equal(ev("sfOf(R,'lon')"), ev("clamp(R.citySrv.lon/R.cityDem.lon,0,1)")); + assert.deepEqual(errors, []); +}); diff --git a/tests/regions.test.js b/tests/regions.test.js index 12fe058..c8366ff 100644 --- a/tests/regions.test.js +++ b/tests/regions.test.js @@ -466,7 +466,9 @@ test('#70 Goggle throttling in Russia no longer counts as traffic you failed to ev("ACT.start({});S.cash=1e9;S.lvl=4;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'});ACT.buildPop({city:'mos'});ACT.launchBB({city:'mos'})"); ev("S.pops.fra.rgen=S.pops.mos.rgen=3;S.pops.fra.routers=S.pops.mos.routers=3;ACT.buyTransit({city:'fra',net:'cog',tier:4});ACT.lagT({id:S.transit[0].id,d:1});UI.via=null;UI.lmode='wave';openLinkModal('fra','mos');ACT.buildLink({tier:4});closeModal();S.pops.mos.bb.d=300;compute()"); assert.equal(ev('S.links.length'), 1); - assert.ok(ev("sfOf(R,'mos')") > 0.99, `Moscow is fully served (${ev("sfOf(R,'mos')")})`); + // (raw delivery: Moscow is backhauled to transit in Frankfurt, which its users feel as latency on top) + assert.ok(ev("R.citySrv.mos/R.cityDem.mos") > 0.99, `Moscow is fully served (${ev("R.citySrv.mos/R.cityDem.mos")})`); + assert.ok(ev("R.latF.mos") < 1, 'and slow, with transit 2,000 km away'); // demand toward Goggle is half of what it would be without the throttle const g = ev("NSH_RU.ggl"), d0 = ev("R.cityEye.mos"); assert.ok(Math.abs(ev("R.cityDem.mos") - d0 * (1 - g / 2)) < 1e-6);