diff --git a/CHANGELOG.md b/CHANGELOG.md index 418720c..f6c9d7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,19 @@ All notable changes to this project are documented here. The project follows shedding: bring a generator. - New local networks: Clarovision, Vivo-ish, Mercado Livre-ly, Jio-graphy, Airtel-tale, Chunghwa Tele-calm and do-ish. +- Metro diversity: add a second data center in any POP's metro from the + Infra tab, joined by your own metro ring. A power cut, cleaner or A/C + failure then only takes out half the city. You choose which site each + transit, PNI and IX port plugs into, and metro ring cuts can cut site B + off. Some hyperscaler and AI customers now insist on two sites. +- More Asia-Pacific: Melbourne, Brisbane, Darwin, Osaka, Kuala Lumpur, + Bangkok, Ho Chi Minh City, Karachi, Dhaka and Colombo, with cables to match. + Vietnam's cables break a lot, and Darwin has crocodiles. +- Central and Eastern Europe: Warsaw, Prague, Vienna, Budapest, Bucharest, + Tallinn and Istanbul. Baltic cables meet a lot of anchors. +- More local networks: KD-DIY, Opt-Out-Us, Mostly-True Move, Viet-tell, + PTC-hell, Telekom Ma-lazy-sia, Türk Tele-komik, Digi-tally Cheap and + UPC-You-Later. - Tap your network's name in the top left for a menu to export or import a save, or start a new network. diff --git a/site/index.html b/site/index.html index 9c90957..8e9e782 100644 --- a/site/index.html +++ b/site/index.html @@ -224,6 +224,8 @@ section h3{font-size:17px;margin-bottom:6px;display:flex;align-items:center;gap: #hint{position:fixed;left:50%;transform:translateX(-50%);top:calc(env(safe-area-inset-top,0px) + 76px);background:var(--ink);color:#fff;border-radius:12px;padding:6px 12px;font-weight:800;font-size:12.5px;z-index:3;pointer-events:none;max-width:min(440px,calc(100% - 32px));text-align:center;box-shadow:3px 3px 0 rgba(30,38,64,.25)} /* modal */ +.seg.site{margin-top:4px;align-items:center} +.seg.site .meta{margin-right:4px} .menu-list{display:flex;flex-direction:column;gap:8px;margin-top:12px} .menu-list .b{justify-content:space-between;width:100%} #mega{position:fixed;left:0;right:0;bottom:0;z-index:17;background:#7A86B8;border-top:3px solid var(--ink);overflow:hidden;white-space:nowrap;pointer-events:none;animation:megaflash 1.2s steps(2) infinite} @@ -407,6 +409,9 @@ const POP_COST=20000, POP_MO=1500, EYE_RATE=150, CACHE_CAP=100, CACHE_MO=400; const DAY_MS=2500, ROUTER_COST=15000, ROUTER_MO=1500, GEN_COST=12000, GEN_MO=600, DIVERSE=1.4; const RU_BOX=40000, RU_BOX_MO=2000; const UAE_LIC=15000; +const SITE2_COST=45000,SITE2_MO=3000; +const SITE2_N=['The Other Building','Campus B (the one with parking)','Across-the-River DC','The Annex','Suburban Mega-shed','The Cheaper One','Formerly a Shopping Mall','Bunker Two']; +const siteName=(c,s)=>s==='b'?SITE2_N[hstr(c)%SITE2_N.length]:CITY[c].dc; const popCost=c=>POP_COST+(c&&CITY[c]&&CITY[c].ru?RU_BOX:0)+(c&&CITY[c]&&CITY[c].uae?UAE_LIC:0); const CN_LIC=150000, CN_JV_MO=6000, SCRUB_COST=60000, SCRUB_MO=5000; const MYIX_COST=80000, MYIX_MO=3000, MYIX_FEE=1500, START_CASH=200000; @@ -463,17 +468,17 @@ const capName=l=>l.kind==='vxc'?VXC[l.vt].n:l.kind==='df'?(l.ready>S.day?'buildi /* ================= WORLD ================= */ // Real-ish geography: lon/lat outlines, equirectangular, with gentle "magnifying lenses" over the busy regions. -const LENSES=[{lon:55.3,lat:24.9,r:26,m:1.2},{lon:78.5,lat:15,r:48,m:1.1},{lon:-44.5,lat:-23.5,r:30,m:1.2},{lon:9,lat:49,r:170,m:1.25},{lon:121,lat:32,r:120,m:0.45},{lon:-80,lat:40,r:110,m:0.5}]; +const LENSES=[{lon:102.5,lat:2.6,r:22,m:1.1},{lon:55.3,lat:24.9,r:26,m:1.2},{lon:78.5,lat:15,r:48,m:1.1},{lon:-44.5,lat:-23.5,r:30,m:1.2},{lon:9,lat:49,r:170,m:1.25},{lon:121,lat:32,r:120,m:0.45},{lon:-80,lat:40,r:110,m:0.5}]; function proj0(lon,lat){return [(lon+180)/360*W,(84-lat)*6.4];} for(const L of LENSES){const q=proj0(L.lon,L.lat);L.x=q[0];L.y=q[1];} function proj(lon,lat){const q=proj0(lon,lat);let dx=0,dy=0;for(const L of LENSES){let ex=q[0]-L.x;ex-=W*Math.round(ex/W);const ey=q[1]-L.y,f=L.m*Math.exp(-(ex*ex+ey*ey)/(L.r*L.r));dx+=ex*f;dy+=ey*f;}return [q[0]+dx,q[1]+dy];} function hav(lo1,la1,lo2,la2){const r=Math.PI/180,dLa=(la2-la1)*r,dLo=(lo2-lo1)*r,a=Math.sin(dLa/2)**2+Math.cos(la1*r)*Math.cos(la2*r)*Math.sin(dLo/2)**2;return 2*6371*Math.asin(Math.min(1,Math.sqrt(a)));} const LANDS_LL=[{id:'am',ll:[[-166,68],[-157,71.2],[-141,69.8],[-128,70],[-115,68.5],[-97,68],[-94,62],[-92.5,57.5],[-85,55.2],[-80,51.5],[-78.5,58],[-77,62],[-70,61],[-64.5,60],[-61.5,56.5],[-57,52],[-55.6,49.5],[-53,47],[-59,46.5],[-61,45.2],[-66,44.5],[-70,43.3],[-70,42],[-74,40.6],[-76,38],[-75.8,35.5],[-77.5,34.5],[-79,33],[-81,31],[-80.05,27],[-80.1,25.3],[-81.5,25],[-82.7,27.5],[-84,30],[-89,30.2],[-94,29.5],[-97,28],[-97.5,25],[-97.7,22],[-96,19],[-94,18.3],[-91,18.5],[-90.4,21],[-87,21.5],[-88,17],[-88.5,15.8],[-84,15.8],[-83.4,12],[-83.7,10.5],[-81.5,9],[-79.5,9.5],[-77.5,8.6],[-75,10.8],[-71.5,12.3],[-68,10.6],[-62,10.5],[-60,8],[-57,6],[-52,5],[-50,1.5],[-48,-1],[-44,-2.5],[-39,-3.5],[-35,-5.5],[-35,-9],[-37.5,-12.5],[-39,-15],[-39.7,-19],[-41,-22],[-44,-23],[-48,-26],[-48.6,-28.5],[-51,-31],[-53,-34],[-58,-34.5],[-57,-37],[-62,-39],[-65,-41],[-64,-43],[-67.5,-46],[-66,-48],[-69,-51],[-68.5,-53],[-70,-55],[-73,-53],[-75,-48],[-73.5,-43],[-73.5,-37],[-71.5,-32],[-71.3,-27],[-70.5,-20],[-71.5,-17],[-76,-14],[-78,-10],[-81,-6],[-80.5,-3],[-80,0],[-79,1.5],[-77.5,4],[-77.4,7.5],[-80,7.3],[-82.5,8.2],[-85.7,10],[-87,12.5],[-91,14],[-94,16],[-96.5,15.7],[-100,17],[-105.5,20],[-105.5,22.5],[-108,25.5],[-110.8,27.9],[-113,31.3],[-114.7,31.7],[-113.5,29],[-112,26.5],[-110,24],[-109.5,23],[-112,24.8],[-114,27.5],[-115.5,29.8],[-117,32.5],[-118.5,34],[-120.6,34.6],[-122.5,37.5],[-124,40.5],[-124.5,43],[-124,46.2],[-124.7,48.4],[-123,49],[-126,50.5],[-130,54.5],[-133,57.5],[-137,58.5],[-141,60],[-146,61],[-150,59.5],[-152,58.5],[-156,57.5],[-158,56.8],[-162,55.5],[-164.5,54.5],[-158,58.5],[-162,60],[-165,61.5],[-166,64],[-164,65.5]]},{id:'eu',ll:[[-9,39],[-9.5,43],[-8,43.7],[-1.8,43.4],[-1.2,46],[-2.5,47.3],[-4.5,48],[-1.6,48.6],[1.5,50.2],[3,51.2],[4.5,52.5],[5,53.4],[7,53.6],[8.6,54],[8.2,55.5],[8.1,57],[10.5,57.7],[10.5,56.5],[11.2,56],[12.6,56.1],[12.7,55.6],[12.1,54.9],[11,54.3],[14,54],[18.5,54.8],[21,55.3],[21,57],[24,57.5],[24,59.2],[28,59.5],[30,60],[28,60.5],[25,60.1],[22.5,60.3],[21.5,61.5],[21.5,63],[25,65],[25.5,65.6],[22,65.8],[20.5,63.5],[18,62.5],[17.4,61],[19,59.8],[18,59],[16.5,57],[16,56.2],[14.2,55.4],[13,55.4],[12.9,56.5],[11.5,58],[10.5,59.3],[8,58],[5.5,58.5],[5,60],[5,62],[7,63],[10,64],[12.5,66],[15,68.5],[18,69.8],[21.5,70.2],[26,71],[30,70],[33,69.3],[41,67],[44,68.5],[53,68.5],[58,69],[68,69],[69,72.8],[73,72.5],[80,73.5],[87,74.8],[100,76],[104,77.7],[112,74],[113.5,73.5],[127,73.5],[132,71.5],[140,72.5],[150,71.5],[160,70],[170,70],[180,69],[190,66.5],[186,64.5],[182,65],[178,62.5],[173,61],[170,60],[164,60],[164,57],[162,55],[159,52],[156.7,51],[156,55.5],[157,58],[155,59.5],[150,59.5],[143,59.3],[137,54.5],[141,53],[140,48.5],[135,43.5],[131,42.7],[129.5,41],[129.4,37],[129.4,35.5],[127.5,34.6],[126.3,34.8],[126.5,37],[125,37.8],[124.5,39.7],[121.5,39],[121.7,40.8],[119,39.3],[117.8,38.5],[119,37.2],[122.5,37.3],[120.5,36],[119.2,35],[121,32],[121.9,30.8],[121.5,28],[119.5,25.5],[116.5,23],[114.3,22.1],[111,21.5],[109.7,20.5],[108.5,21.6],[106.5,20],[106,18],[108.5,15],[109.3,12],[107,10.5],[105,8.6],[104.8,10.3],[103,11],[100.9,12.6],[100,13.4],[99.3,10.5],[100.3,7],[101,6.8],[103.4,4],[104.3,1.4],[103.6,1.25],[101.3,2.8],[100.2,5.3],[98.3,8],[98.6,13],[97.7,16.5],[94.4,16.2],[94.2,18.8],[92.3,20.6],[91.8,22.6],[90,22],[88.3,21.6],[86.9,20.6],[85,19.5],[82.3,16.6],[80.3,15.8],[80.3,13.5],[79.8,10.3],[78.3,8.9],[77.5,8.1],[76.5,8.9],[75.8,11.5],[74.8,12.9],[73.5,16],[72.8,19],[72.7,21.2],[70,22.5],[68.5,23.5],[66.6,25.4],[61.6,25.2],[57.3,25.8],[56.4,27.1],[54.7,26.5],[51.5,27.9],[50,30],[48,30],[48.4,28.5],[49.5,26.7],[50.8,24.8],[51.6,24.2],[52.6,24.2],[54.6,24.5],[56,26.2],[56.4,24.5],[57.8,23.8],[58.8,22.5],[59.8,22.4],[58.5,20.5],[57.7,19],[55.4,17.7],[52.2,15.7],[48.7,14],[45,12.8],[43.4,12.6],[42.7,15.7],[42.5,17.2],[41,19.5],[39.1,21.6],[38.4,23.6],[37,25.5],[35.2,28],[34.9,29.5],[34.3,27.8],[33,28.8],[32.6,30],[32.3,31.2],[34.2,31.3],[34.9,32.8],[35.6,34.5],[36,35.8],[36.2,36.7],[34.5,36.8],[32.5,36.1],[30.5,36.4],[29,36.6],[27.3,37.4],[26.3,38.6],[26.5,40],[26.2,40.6],[24,40.8],[22.6,40.4],[23.5,38],[22.3,36.5],[21.7,36.8],[21.2,38.4],[19.5,40],[19.5,41.8],[18.5,42.5],[16,43.5],[13.7,45.6],[12.3,45.3],[12.4,44.2],[13.6,43.5],[15.9,41.6],[18.5,40.2],[17,39],[16.6,38],[15.6,38],[16.1,39],[15.6,40.1],[14.3,40.6],[12.5,41.6],[11,42.5],[10.2,43.9],[8.8,44.4],[7.5,43.8],[6,43.1],[4,43.5],[3.1,43.1],[3.2,41.9],[0.8,41],[0,39.5],[-0.3,38.4],[-0.8,37.6],[-2.1,36.7],[-4.4,36.7],[-5.6,36],[-6.3,36.8],[-7.4,37.2],[-8.9,37]]},{id:'af',ll:[[-17.5,14.7],[-17,21],[-16,24],[-13,27.5],[-9.8,30],[-9.2,32.5],[-6.8,34],[-5.9,35.8],[-2,35.1],[1,36.5],[5,36.8],[9.8,37.3],[11,36.9],[10.2,35.2],[11.1,33.3],[15.2,32.3],[19,30.3],[20.1,32],[23,32.6],[25,31.7],[29,30.9],[32.2,31.3],[32.6,30],[33.5,28],[35.5,24],[37.2,21],[38.5,18],[39.6,15.5],[41.6,13.5],[43.3,12.4],[44,10.4],[47,11.1],[51.2,11.8],[51,10.4],[49.5,7],[47.8,4.5],[45,1.6],[42,-1],[40.2,-2.8],[39.3,-4.8],[38.8,-6.5],[39.6,-10],[40.5,-11],[40.6,-14.6],[37,-17.5],[35.4,-22],[35.5,-24],[32.9,-25.9],[32.5,-28.6],[31,-29.9],[28,-32.7],[25.6,-33.9],[22.5,-34],[20,-34.8],[18.4,-34],[17.9,-32.5],[16.5,-28.6],[15.2,-27],[14.4,-23],[12.8,-19],[11.8,-16.8],[12.2,-14.5],[13.6,-12.2],[13.2,-8.8],[12.3,-6],[11.8,-3.5],[9.5,-1],[9.4,1],[9.8,3.2],[8.9,4.5],[6,4.3],[4.3,6.3],[1.6,6.2],[-2,4.8],[-4.6,5.2],[-7.5,4.4],[-9.4,5.4],[-11.5,6.9],[-13.2,8.7],[-15,10.9],[-16.7,12.4]]},{id:'uk',ll:[[-5.7,50.1],[-3,50.6],[1.4,51.2],[1.7,52.7],[0.3,53.4],[-0.2,54.3],[-1.6,55.6],[-2,56.4],[-1.8,57.6],[-3.4,58.6],[-5,58.6],[-6.2,57.5],[-5.6,56.3],[-5,55],[-3.2,54.9],[-3.4,54],[-3,53.4],[-4.6,53.3],[-4.2,52.2],[-5.2,51.7],[-3.2,51.4],[-4.6,51]]},{id:'ie',ll:[[-6,52.2],[-6.2,53.5],[-5.6,54.6],[-6.4,55.2],[-7.4,55.4],[-8.5,54.5],[-10,54.2],[-9.6,53.2],[-10.2,51.9],[-9.6,51.5],[-8.2,51.8]]},{id:'is',ll:[[-22.5,63.9],[-24,65.5],[-22,66.4],[-16,66.5],[-14.5,65.3],[-14.6,64.4],[-18,63.4]]},{id:'jp',ll:[[129.6,33.3],[130.2,31.3],[131.4,31.5],[132,33],[133.5,33.4],[135.2,33.6],[136.8,34.3],[138.8,34.6],[140,35],[140.8,35.7],[141,38.2],[141.9,39.5],[141.4,41.4],[140,41.4],[139.9,40.3],[139.8,38.5],[138.8,37.8],[137.3,36.9],[136,36],[135.4,35.6],[133,35.5],[131.5,34.6],[130.9,34]]},{id:'oc',ll:[[113.5,-22],[114,-26.5],[115,-30],[115.7,-33.6],[115,-34.3],[117.9,-35.1],[123.5,-33.9],[126,-32.3],[131,-31.5],[134,-32.8],[135.6,-34.8],[137.6,-35.6],[138.5,-34.6],[139.6,-36.9],[141.5,-38.4],[144.9,-37.9],[146.4,-39.1],[150,-37.5],[150.8,-34.5],[152.5,-32.4],[153.6,-28.5],[153,-25],[150.8,-22.5],[149,-20.6],[146.3,-18.9],[145.4,-16],[145.3,-14.9],[143.5,-12.3],[142.5,-10.7],[141.6,-12.8],[141.6,-16],[140.6,-17.6],[139.3,-17.4],[137,-15.9],[135.8,-15],[136.8,-12.2],[135,-12],[132.6,-11.5],[131,-12.2],[129.5,-14.9],[128,-15.4],[126.5,-13.9],[124.5,-16.5],[122.2,-18.2],[121,-19.7],[118.5,-20.3],[116.7,-20.6],[114.6,-21.8]]},{id:'nz',ll:[[172.7,-34.4],[174.5,-36],[175.9,-37.5],[178.5,-37.7],[177.9,-39.2],[176.9,-39.6],[175.2,-41.6],[174.6,-41.2],[174.9,-39.9],[173.8,-39.3],[174.6,-38.1],[174.5,-37.3],[173.1,-35.3]]},{id:'idn',ll:[[105.2,-6.8],[106.8,-6.1],[108.5,-6.4],[110.5,-6.9],[112.6,-6.9],[114.6,-7.7],[114.4,-8.7],[111,-8.3],[108,-7.8],[105.5,-7]]},{id:'ph',ll:[[120.6,18.5],[122.2,18.5],[122,16.5],[121.6,14.2],[124,13.8],[124,12.5],[123.3,13],[121,13.6],[120.6,14.5],[119.8,16.2]]}]; // South America is drawn as part of 'am' but counts as its own landmass: nothing crosses the Darién Gap. -LANDS_LL.push({id:'sa',hide:true,ll:[[-77.5, 8.6], [-75, 10.8], [-71.5, 12.3], [-68, 10.6], [-62, 10.5], [-60, 8], [-57, 6], [-52, 5], [-50, 1.5], [-48, -1], [-44, -2.5], [-39, -3.5], [-35, -5.5], [-35, -9], [-37.5, -12.5], [-39, -15], [-39.7, -19], [-41, -22], [-44, -23], [-48, -26], [-48.6, -28.5], [-51, -31], [-53, -34], [-58, -34.5], [-57, -37], [-62, -39], [-65, -41], [-64, -43], [-67.5, -46], [-66, -48], [-69, -51], [-68.5, -53], [-70, -55], [-73, -53], [-75, -48], [-73.5, -43], [-73.5, -37], [-71.5, -32], [-71.3, -27], [-70.5, -20], [-71.5, -17], [-76, -14], [-78, -10], [-81, -6], [-80.5, -3], [-80, 0], [-79, 1.5], [-77.5, 4], [-77.4, 7.5]]},{id:'tw',ll:[[121.5, 25.35], [122.05, 25.0], [121.85, 24.3], [121.4, 23.0], [120.85, 21.9], [120.6, 22.3], [120.15, 22.9], [120.1, 23.6], [120.55, 24.5], [121.0, 25.1]]}); +LANDS_LL.push({id:'lk',ll:[[79.9, 9.8], [80.6, 9.6], [81.4, 8.5], [81.9, 7.4], [81.6, 6.4], [80.6, 5.9], [80.0, 6.2], [79.75, 7.2], [79.75, 8.3]]},{id:'sa',hide:true,ll:[[-77.5, 8.6], [-75, 10.8], [-71.5, 12.3], [-68, 10.6], [-62, 10.5], [-60, 8], [-57, 6], [-52, 5], [-50, 1.5], [-48, -1], [-44, -2.5], [-39, -3.5], [-35, -5.5], [-35, -9], [-37.5, -12.5], [-39, -15], [-39.7, -19], [-41, -22], [-44, -23], [-48, -26], [-48.6, -28.5], [-51, -31], [-53, -34], [-58, -34.5], [-57, -37], [-62, -39], [-65, -41], [-64, -43], [-67.5, -46], [-66, -48], [-69, -51], [-68.5, -53], [-70, -55], [-73, -53], [-75, -48], [-73.5, -43], [-73.5, -37], [-71.5, -32], [-71.3, -27], [-70.5, -20], [-71.5, -17], [-76, -14], [-78, -10], [-81, -6], [-80.5, -3], [-80, 0], [-79, 1.5], [-77.5, 4], [-77.4, 7.5]]},{id:'tw',ll:[[121.5, 25.35], [122.05, 25.0], [121.85, 24.3], [121.4, 23.0], [120.85, 21.9], [120.6, 22.3], [120.15, 22.9], [120.1, 23.6], [120.55, 24.5], [121.0, 25.1]]}); const LANDS=LANDS_LL.map(l=>({id:l.id,hide:!!l.hide,pts:l.ll.map(q=>proj(q[0],q[1]))})); const DECOR=[[[-73,78],[-60,81.5],[-35,82.5],[-20,81.5],[-18,77],[-20,72],[-23,70],[-30,68],[-38,65.5],[-43,60],[-48,61],[-52,64.5],[-54,68],[-55,71],[-60,76],[-68,77]],[[-80,73.5],[-72,71.5],[-67,69.5],[-62,66.5],[-64,63],[-71,62.5],[-78,64],[-83,66],[-88,70],[-85,73]],[[-110,76],[-95,77],[-80,79],[-70,82],[-90,82.3],[-105,79]],[[-118,73],[-105,72],[-100,69.5],[-110,68.8],[-118,70]],[[140,41.5],[141.6,42.4],[143.3,42],[145.6,43.3],[144.5,44],[141.9,45.5],[141.4,43.4],[140,42.6]],[[120.1,23],[121,25.2],[121.9,25],[121.5,22.5],[120.8,21.9]],[[122,11],[125.5,11.5],[126.5,9.5],[126.2,6.5],[124,6.5],[122,7]],[[95.3,5.6],[98,4],[100.3,2],[103.8,-1],[106,-3],[106,-5.9],[104.5,-5.9],[102.3,-4],[100.3,-1],[97.5,2.4],[95.2,4]],[[109.6,2],[111,1.6],[113,3.2],[115.5,5.2],[117.2,6.9],[119,5],[118,2],[117.5,0.6],[116.2,-2.5],[116,-4],[114.5,-3.4],[111.7,-3],[110,-1.6],[109,0.5]],[[119,-5.5],[120.5,-1],[121.5,1],[125,1.5],[123,-1],[121.5,-4.5]],[[131,-1.2],[134,-0.8],[138,-1.6],[141,-2.6],[145,-4.3],[147.5,-6],[147.5,-8],[146,-8],[143.4,-9.1],[141,-9.1],[139,-8],[138,-8.5],[137.7,-5.6],[134,-4],[132,-2.8]],[[172.6,-40.5],[174.3,-41.7],[173,-43.5],[171.2,-44.5],[170.6,-45.9],[169.2,-46.6],[166.5,-46],[167,-45],[168.4,-44],[170.8,-42.6],[171.5,-41.7]],[[144.6,-40.7],[148.3,-40.9],[148,-43.2],[146,-43.5]],[[49.3,-12],[50.5,-15.5],[49.5,-17.5],[47.1,-24.9],[45,-25.5],[43.8,-23.6],[43.3,-21],[44.4,-16.2],[46.5,-15.7],[48,-13.5]],[[79.8,9.8],[81.9,7.5],[81.2,6.2],[80,6],[79.7,8.2]],[[-85,21.9],[-82,23.2],[-77.5,22.3],[-74.2,20.2],[-77.7,19.9],[-80.5,21.8]],[[-74.5,18.5],[-72,19.9],[-68.4,18.6],[-70,18.2]],[[12.4,38.1],[15.6,38.3],[15.1,36.7]],[[8.2,41],[9.8,41.1],[9.6,39.1],[8.4,39]],[[11,78],[17,80],[27,80],[20,77]],[[52,71],[56,74],[64,76.5],[68,77],[58,74],[54,71]],[[142,46],[143.5,49],[143,54],[142,53],[141.8,48]],[[108.7,19],[111,19.7],[110,18.2]]].map(poly=>poly.map(q=>proj(q[0],q[1]))); -const CITY_LL={"for":[-38.54, -3.73],"rio":[-43.11,-22.57],"bue":[-58.38, -34.6],"scl":[-70.67, -33.45],"lim":[-76.85,-12.05],"bog":[-74.07, 4.71],"pan":[-79.52, 8.98],"del":[77.21, 28.61],"maa":[80.18,13.25],"blr":[77.59, 12.97],"hyd":[78.49, 17.39],"tpe":[121.56, 25.03],"auh":[54.37, 24.45],"fuj":[56.15,25.07],"cpt":[18.42, -33.92],"stg":[9.18,48.78],"ber":[13.4,52.52],"zrh":[8.54,47.37],"nbo":[36.82,-1.29],"cai":[31.24,30.04],"sea":[-122.33,47.61],"sjc":[-121.89,37.34],"lax":[-118.24,34.05],"dal":[-96.8,32.78],"chi":[-87.63,41.88],"ash":[-77.49,39.04],"nyc":[-74.0,40.71],"mia":[-80.19,25.76],"tor":[-79.38,43.65],"mtl":[-73.57,45.5],"mex":[-99.13,19.43],"sao":[-46.63,-23.55],"lon":[-0.13,51.51],"dub":[-6.26,53.35],"rek":[-21.94,64.15],"ams":[4.9,52.37],"fra":[8.68,50.11],"par":[2.35,48.86],"mrs":[5.37,43.3],"mad":[-3.7,40.42],"sto":[18.07,59.33],"osl":[10.75,59.91],"cph":[12.57,55.68],"hel":[24.94,60.17],"beg":[20.46,44.79],"sof":[23.32,42.7],"mos":[37.62,55.76],"lag":[3.38,6.52],"jnb":[28.05,-26.2],"dxb":[55.27,25.2],"bom":[72.88,19.08],"sin":[103.82,1.35],"jkt":[106.85,-6.2],"mnl":[120.98,14.6],"hkg":[114.17,22.32],"sha":[121.47,31.23],"pek":[116.4,39.9],"icn":[126.98,37.57],"tok":[139.69,35.69],"syd":[151.21,-33.87],"per":[115.86,-31.95],"akl":[174.76,-36.85]}; +const CITY_LL={"mel":[144.96, -37.81],"bne":[153.03, -27.47],"drw":[131.05,-12.46],"osa":[135.5, 34.69],"kul":[101.69, 3.14],"bkk":[100.5, 13.76],"sgn":[106.66, 10.76],"khi":[67.14,25.0],"dac":[90.41, 23.81],"cbo":[80.0, 6.95],"waw":[21.01, 52.23],"prg":[14.42, 50.08],"vie":[16.37, 48.21],"bud":[19.04, 47.5],"buh":[26.1, 44.43],"tll":[24.45,58.9],"ist":[28.98, 41.01],"for":[-38.54, -3.73],"rio":[-43.11,-22.57],"bue":[-58.38, -34.6],"scl":[-70.67, -33.45],"lim":[-76.85,-12.05],"bog":[-74.07, 4.71],"pan":[-79.52, 8.98],"del":[77.21, 28.61],"maa":[80.18,13.25],"blr":[77.59, 12.97],"hyd":[78.49, 17.39],"tpe":[121.56, 25.03],"auh":[54.37, 24.45],"fuj":[56.15,25.07],"cpt":[18.42, -33.92],"stg":[9.18,48.78],"ber":[13.4,52.52],"zrh":[8.54,47.37],"nbo":[36.82,-1.29],"cai":[31.24,30.04],"sea":[-122.33,47.61],"sjc":[-121.89,37.34],"lax":[-118.24,34.05],"dal":[-96.8,32.78],"chi":[-87.63,41.88],"ash":[-77.49,39.04],"nyc":[-74.0,40.71],"mia":[-80.19,25.76],"tor":[-79.38,43.65],"mtl":[-73.57,45.5],"mex":[-99.13,19.43],"sao":[-46.63,-23.55],"lon":[-0.13,51.51],"dub":[-6.26,53.35],"rek":[-21.94,64.15],"ams":[4.9,52.37],"fra":[8.68,50.11],"par":[2.35,48.86],"mrs":[5.37,43.3],"mad":[-3.7,40.42],"sto":[18.07,59.33],"osl":[10.75,59.91],"cph":[12.57,55.68],"hel":[24.94,60.17],"beg":[20.46,44.79],"sof":[23.32,42.7],"mos":[37.62,55.76],"lag":[3.38,6.52],"jnb":[28.05,-26.2],"dxb":[55.27,25.2],"bom":[72.88,19.08],"sin":[103.82,1.35],"jkt":[106.85,-6.2],"mnl":[120.98,14.6],"hkg":[114.17,22.32],"sha":[121.47,31.23],"pek":[116.4,39.9],"icn":[126.98,37.57],"tok":[139.69,35.69],"syd":[151.21,-33.87],"per":[115.86,-31.95],"akl":[174.76,-36.85]}; const CITIES=[ {id:'sea',name:'Seattle',x:205,y:245,land:'am',reg:'AM',P:300,ix:'Sea-IX',dc:'Westin-ish Carrier Hotel'}, {id:'sjc',name:'San Jose',x:240,y:345,land:'am',reg:'AM',P:500,ix:'Silly-Con Valley IX',dc:'Equinox SV-ish'}, @@ -537,9 +542,26 @@ const CITIES=[ {id:'auh',name:'Abu Dhabi',x:0,y:0,land:'eu',reg:'AS',P:200,arpu:1.4,uae:true,ix:'',dc:'Oasis-cooled Campus',note:'The capital. Sovereign AI money and very big data centers. Inside the UAE only the two licensed operators may run fiber.'}, {id:'fuj',name:'Fujairah',x:0,y:0,land:'eu',reg:'AS',P:20,uae:true,ix:'',dc:'Cable Landing Sandcastle',note:'Most UAE cables land on this coast, outside the Strait of Hormuz. Getting from here to Dubai means renting from the duopoly.'}, {id:'cpt',name:'Cape Town',x:0,y:0,land:'af',reg:'AF',P:250,za:true,ix:'Biltong-IX',dc:'Table Mountain Colo',note:'Where the Atlantic cables to Africa’s south land. Penguins on the beach, load shedding on the grid.'}, +{id:'mel',name:'Melbourne',x:0,y:0,land:'oc',reg:'OC',P:450,ix:'Flat-White-IX',dc:'Four-Seasons-a-Day DC',note:'Four seasons in one day, and the racks feel every one of them.'}, + {id:'bne',name:'Brisbane',x:0,y:0,land:'oc',reg:'OC',P:250,ix:'Bris-Vegas-IX',dc:'Sunshine State Shed',note:'Sunny, humid and closer to the Pacific cables than Sydney would like to admit.'}, + {id:'drw',name:'Darwin',x:0,y:0,land:'oc',reg:'OC',P:15,ix:'',dc:'Crocodile-proof Landing Station',note:'Tiny, tropical and the closest Australian city to Asia. New cables to Singapore and Jakarta land here, next to the crocodiles.'}, + {id:'osa',name:'Osaka',x:0,y:0,land:'jp',reg:'AS',P:700,ix:'Takoyaki-IX',dc:'Dojima-ish DC',note:'Japan’s second hub, and Tokyo’s disaster-recovery plan. Earthquakes rarely hit both.'}, + {id:'kul',name:'Kuala Lumpur',x:0,y:0,land:'eu',reg:'AS',P:350,ix:'Satay-IX',dc:'Twin Towers Colo',note:'Cheaper than Singapore next door. The data center builders noticed, and so did the power grid.'}, + {id:'bkk',name:'Bangkok',x:0,y:0,land:'eu',reg:'AS',P:600,ix:'Tom-Yum-IX',dc:'Floating Market DC',note:'Big, busy and flooded with traffic, sometimes literally.'}, + {id:'sgn',name:'Ho Chi Minh City',x:0,y:0,land:'eu',reg:'AS',P:500,vn:true,ix:'Pho-IX',dc:'Scooter-cooled DC',note:'Very online and badly served by the sea: at least one of its subsea cables is broken at any given time.'}, + {id:'khi',name:'Karachi',x:0,y:0,land:'eu',reg:'AS',P:500,arpu:0.4,ix:'Chai-IX',dc:'Seaview Landing Station',note:'Pakistan’s door to the sea. Every cable lands here, and so does every new firewall rule.'}, + {id:'dac',name:'Dhaka',x:0,y:0,land:'eu',reg:'AS',P:700,arpu:0.3,ix:'Rickshaw-IX',dc:'Monsoon-mapped DC',note:'Huge, dense and hungry. Its international traffic squeezes through a couple of cables, or comes overland from India.'}, + {id:'cbo',name:'Colombo',x:0,y:0,land:'lk',reg:'AS',P:120,ix:'Hopper-IX',dc:'Tea-cooled Landing Station',note:'A small island at the crossroads of every Indian Ocean cable.'}, + {id:'waw',name:'Warsaw',x:0,y:0,land:'eu',reg:'EU',P:550,ix:'Pierogi-IX',dc:'Palace-of-Culture-adjacent DC',note:'Central Europe’s rising hub. More data centers every year and a fiercely competitive ISP scene.'}, + {id:'prg',name:'Prague',x:0,y:0,land:'eu',reg:'EU',P:300,ix:'Pilsner-IX',dc:'Castle-view Colo',note:'Beer is cheaper than water here, and IX ports are cheaper than both.'}, + {id:'vie',name:'Vienna',x:0,y:0,land:'eu',reg:'EU',P:300,ix:'Schnitzel-IX',dc:'Waltz-cooled DC',note:'The old gateway to Eastern Europe. Packets still bow politely on the way through.'}, + {id:'bud',name:'Budapest',x:0,y:0,land:'eu',reg:'EU',P:300,ix:'Goulash-IX',dc:'Thermal Bath DC',note:'Waste heat goes straight into the spa next door.'}, + {id:'buh',name:'Bucharest',x:0,y:0,land:'eu',reg:'EU',P:400,ix:'Sarmale-IX',dc:'Parliament-sized DC',note:'Gigabit home broadband for the price of a coffee. Customers here expect a lot for very little.'}, + {id:'tll',name:'Tallinn',x:0,y:0,land:'eu',reg:'EU',P:80,ix:'E-Stonia-IX',dc:'Medieval Wall DC',note:'Digital everything, e-residency for anyone, and Baltic cables that ships keep dragging their anchors over.'}, + {id:'ist',name:'Istanbul',x:0,y:0,land:'eu',reg:'EU',P:900,ix:'Baklava-IX',dc:'Bosphorus Bridge DC',note:'One foot in Europe, one in Asia. Every land route between them crosses here.'}, ]; // Display-only nudges for cities that sit on top of each other at map scale; distances still use real lon/lat. -const CITY_NUDGE={stg:[30,6],fra:[-8,-8],auh:[-30,3],fuj:[8,30],dxb:[6,-8],rio:[14,-16]}; +const CITY_NUDGE={stg:[30,6],fra:[-8,-8],auh:[-30,3],fuj:[8,30],dxb:[6,-8],rio:[14,-16],tll:[-4,22],osa:[-10,6],khi:[-2,-6]}; for(const c of CITIES){const q=CITY_LL[c.id];if(q){c.lon=q[0];c.lat=q[1];const pt=proj(q[0],q[1]),n=CITY_NUDGE[c.id]||[0,0];c.x=pt[0]+n[0];c.y=pt[1]+n[1];}} const CITY=Object.fromEntries(CITIES.map(c=>[c.id,c])); const CABLES=[ @@ -556,9 +578,9 @@ const CABLES=[ {"id":"equi","name":"Equi-yes","price":0.8,"age":"new","blurb":"Always agrees with you. Iberia to West Africa.","pairs":[["lag","cpt",[[4,3],[6,-5],[10,-20],[16,-33]]],["mad","lag",[[-10,38],[-15,28],[-18,15],[-14,5],[-2,3],[3,5.8]]]]}, {"id":"smw6","name":"SEE-ME-WAVE 6","price":0.95,"age":"new","blurb":"Sixth in a long-running series. Europe to India to Singapore.","pairs":[["mrs","bom",[[6.4,42.74],[12.4,37.84],[20.4,34.34],[30.4,32.34],[32.8,31.54],[33.4,29.84],[35.4,26.34],[38.4,21.34],[41.4,15.34],[44.4,12.64],[52,13.4],[62,18.4],[70,19.4]]],["bom","sin",[[72,17],[76,8],[80.5,5],[90,5],[96,5.5],[100,4],[103,1.5]]],["mrs","sin",[[6.4,42.74],[12.4,37.84],[20.4,34.34],[30.4,32.34],[32.8,31.54],[33.4,29.84],[35.4,26.34],[38.4,21.34],[41.4,15.34],[44.4,12.64],[52,12.8],[62,12.5],[75,6.8],[80.5,5.2],[92,5.8],[97,5.8],[100.5,4],[103,1.7]]]]}, {"id":"peace","name":"PEACE-out","price":0.85,"age":"new","blurb":"Marseille to Singapore, then it leaves the party.","pairs":[["mrs","sin",[[5.6,42.26],[11.6,37.36],[19.6,33.86],[29.6,31.860000000000003],[32.0,31.060000000000002],[32.6,29.360000000000003],[34.6,25.860000000000003],[37.6,20.860000000000003],[40.6,14.86],[43.6,12.16],[52,12.2],[62,11.8],[75,6.3],[80.5,4.6],[92,5.2],[97,5.3],[100.5,3.6],[103,1.4]]]]}, - {"id":"aae","name":"AAE-1-ish","price":1.0,"age":"mid","blurb":"Asia, Africa, Europe, and one more thing.","pairs":[["mrs","hkg",[[6.8,42.98],[12.8,38.08],[20.8,34.58],[30.8,32.58],[33.199999999999996,31.78],[33.8,30.080000000000002],[35.8,26.580000000000002],[38.8,21.580000000000002],[41.8,15.58],[44.8,12.88],[52,11.8],[62,11.4],[75,6],[80.5,4.4],[92,5],[97,5],[100.5,3.3],[104.5,1.5],[107,5],[110,10],[113,18],[114.2,21.8]]],["sin","hkg",[[104.5,1.5],[108,6],[111,12],[114,20],[114.2,22]]]]}, + {"id":"aae","name":"AAE-1-ish","price":1.0,"age":"mid","blurb":"Asia, Africa, Europe, and one more thing.","pairs":[["khi","sin",[[66,22],[70,12],[78,5.5],[90,5.5],[97,6],[100,3.6],[102.6,2.1],[103.7,1.3]]],["mrs","hkg",[[6.8,42.98],[12.8,38.08],[20.8,34.58],[30.8,32.58],[33.199999999999996,31.78],[33.8,30.080000000000002],[35.8,26.580000000000002],[38.8,21.580000000000002],[41.8,15.58],[44.8,12.88],[52,11.8],[62,11.4],[75,6],[80.5,4.4],[92,5],[97,5],[100.5,3.3],[104.5,1.5],[107,5],[110,10],[113,18],[114.2,21.8]]],["sin","hkg",[[104.5,1.5],[108,6],[111,12],[114,20],[114.2,22]]]]}, {"id":"apg","name":"A Pretty Gateway","price":0.9,"age":"mid","blurb":"The pretty way around East Asia.","pairs":[["tpe","tok",[[123,25.5],[130,29.5],[137,33.5]]],["hkg","tpe",[[116.5,21.8],[119.5,22.8]]],["sin","hkg",[[105,2],[109,7],[112,13],[114.6,20],[114.4,22]]],["hkg","tok",[[116,21.5],[122,24],[126,28],[132,32],[137,33.8],[139.8,35]]],["hkg","icn",[[116,22],[122,26],[125,32],[126,35],[126.2,36.8]]],["tok","icn",[[136,33.8],[130,33.5],[128,34.5],[126.5,35.5]]],["tok","sha",[[135,33.5],[128,31.5],[122.5,31.2]]]]}, - {"id":"jup","name":"Jupiterrible","price":0.9,"age":"new","blurb":"Named after a planet, behaves like one: big and far away.","pairs":[["lax","tok",[[-121,33.5],[-145,32],[-175,32],[-200,33],[-218,34.5]]]]}, + {"id":"jup","name":"Jupiterrible","price":0.9,"age":"new","blurb":"Named after a planet, behaves like one: big and far away.","pairs":[["lax","osa",[[-121,33.3],[-145,31.5],[-175,31.5],[-200,32.5],[-222,33.8]]],["lax","tok",[[-121,33.5],[-145,32],[-175,32],[-200,33],[-218,34.5]]]]}, {"id":"fast","name":"FASTEST","price":0.85,"age":"mid","blurb":"Its predecessor was FASTER. Marketing had a good day.","pairs":[["sea","tok",[[-125,46],[-150,45],[-180,42],[-205,38],[-218,35]]]]}, {"id":"ncp","name":"New Cross Pacific-ish","price":1.0,"age":"mid","blurb":"Crosses the Pacific, mildly annoyed about it.","pairs":[["sea","tpe",[[-125,46],[-155,45],[-185,38],[-212,28],[-235,25.6]]],["sea","icn",[[-125,46.5],[-155,46.5],[-185,42],[-212,33],[-229,33.8],[-232,36]]],["sea","sha",[[-125,46.2],[-155,45.5],[-185,40],[-212,31],[-236,30.5]]]]}, {"id":"plcn","name":"Pacific Light-ish","price":1.1,"age":"mid","blurb":"Lighter on paperwork than its namesake. Still heavy on paperwork.","pairs":[["lax","tpe",[[-121,33],[-150,25],[-180,22],[-215,22],[-236,24]]],["lax","hkg",[[-121,33],[-150,25],[-180,22],[-215,21],[-240,21.5]]]]}, @@ -582,7 +604,7 @@ const CABLES=[ {"id":"clion","name":"C-Lion King","price":1.0,"age":"new","blurb":"Helsinki to Germany under the Baltic. Anchors keep finding it.","pairs":[["hel","fra",[[24,59.8],[20,57.5],[15,55.2],[12.2,54.3]]]]}, {"id":"uly","name":"Ulysses-ish","price":0.8,"age":"old","blurb":"Short hop across the North Sea. An odyssey it is not.","pairs":[["lon","ams",[[2,51.8]]]]}, {"id":"chn","name":"Channel Hopper","price":0.7,"age":"mid","blurb":"London to Paris under the Channel. Cheaper than the train.","pairs":[["lon","par",[[1,50.5]]]]}, - {"id":"medn","name":"Med-Nauti-lust","price":0.9,"age":"mid","blurb":"Across the Mediterranean, Egypt to France. Romantic, in a cable way.","pairs":[["cai","mrs",[[29.9,31.4],[28,32.5],[20,34.5],[12,38],[6.5,42.6]]]]}, + {"id":"medn","name":"Med-Nauti-lust","price":0.9,"age":"mid","blurb":"Across the Mediterranean, Egypt to France. Romantic, in a cable way.","pairs":[["ist","mrs",[[26.5,40],[25,37],[20,35.5],[12,38],[6.5,42.6]]],["cai","mrs",[[29.9,31.4],[28,32.5],[20,34.5],[12,38],[6.5,42.6]]]]}, {"id":"eassy","name":"EASSy Peasy","price":0.95,"age":"mid","blurb":"East Africa up to Europe via the Red Sea. Lemon squeezy.","pairs":[["nbo","mrs",[[39.7,-4],[42,-1],[45,2],[51,10.5],[45,12.3],[43.4,12.0],[40.4,14.7],[37.4,20.700000000000003],[34.4,25.700000000000003],[32.4,29.200000000000003],[31.799999999999997,30.900000000000002],[29.4,31.700000000000003],[19.4,33.7],[11.4,37.2],[5.4,42.1]]]]}, {"id":"teams","name":"TEAMS-work","price":0.9,"age":"mid","blurb":"Kenya to the Gulf. Makes the dream work.","pairs":[["nbo","dxb",[[39.7,-4],[44,0],[52,8],[58,18],[59,22.5],[57,25]]]]}, {"id":"monet","name":"Mo-Net-y","price":0.9,"age":"new","blurb":"Brazil to Florida. The invoice arrives just as fast.","pairs":[["sao","mia",[[-44,-25.5],[-36,-14],[-33,-4],[-45,4],[-62,16],[-76,25]]],["for","mia",[[-37,-2.2],[-45,4.5],[-62,16.5],[-76,25.3]]]]}, @@ -597,7 +619,13 @@ const CABLES=[ {"id":"bbg","name":"Bay of Bengal Gateway-ish","price":0.95,"age":"mid","blurb":"Fujairah to Mumbai, round the tip of India to Chennai, then on to Singapore.","pairs":[["fuj","bom",[[58,24.5],[63,22],[69.5,19.5]]],["bom","maa",[[72,15],[75,8],[78.5,6.6],[81.8,8],[81,12]]],["maa","sin",[[82,12],[90,8],[96.5,6],[100,3.5],[102.5,2],[103.6,1.25]]]]}, {"id":"i2i","name":"i2i-ish (Eye to Eye)","price":0.85,"age":"mid","blurb":"Chennai to Singapore, looking it straight in the eye.","pairs":[["maa","sin",[[82,13],[91,9.5],[97,6.6],[100.2,3.8],[102.6,2.2],[103.7,1.3]]]]}, {"id":"tse","name":"Strait-ish Express","price":1.5,"age":"old","blurb":"A short cable across a very tense strait.","pairs":[["tpe","sha",[[122.2,26.5],[122.6,29],[122.2,31]]]]}, - {"id":"gbi","name":"Gulf Bridge Over Troubled Water","price":1.0,"age":"mid","blurb":"Leaves the Gulf from Fujairah and runs up the Red Sea to Europe.","pairs":[["fuj","mrs",[[57.5,23.5],[59.5,21.5],[55,15.5],[48,12.6],[43.2,11.8],[40.2,14.5],[37.2,20.5],[34.2,25.5],[32.2,29],[31.6,30.7],[29.2,31.5],[19.2,33.5],[11.2,37],[5.2,42]]]]} + {"id":"gbi","name":"Gulf Bridge Over Troubled Water","price":1.0,"age":"mid","blurb":"Leaves the Gulf from Fujairah and runs up the Red Sea to Europe.","pairs":[["fuj","mrs",[[57.5,23.5],[59.5,21.5],[55,15.5],[48,12.6],[43.2,11.8],[40.2,14.5],[37.2,20.5],[34.2,25.5],[32.2,29],[31.6,30.7],[29.2,31.5],[19.2,33.5],[11.2,37],[5.2,42]]]]}, + {"id":"aagony","name":"AAG-ony","price":1.1,"age":"old","blurb":"An Asia–America gateway-ish cable that breaks so often it has its own support group.","pairs":[["sgn","hkg",[[109,12],[113,18],[114.2,21.5]]],["sgn","sin",[[106,7],[104.6,3]]]]}, + {"id":"darwin","name":"Darwin Award Cable","price":1.0,"age":"new","blurb":"Darwin to Singapore via Jakarta. Survival of the fittest packets.","pairs":[["drw","jkt",[[129,-11.2],[122,-10],[114,-8.6],[108,-6.6]]],["drw","sin",[[129,-11.2],[120,-9],[114,-6],[108,-2],[105,0.6]]]]}, + {"id":"jga","name":"JGA-ish (Japan–Guam–Aussie)","price":0.9,"age":"new","blurb":"Brisbane to Tokyo with a beach break in Guam.","pairs":[["bne","tok",[[155,-25],[156,-5],[146,13],[141,30]]]]}, + {"id":"smw4","name":"SEE-ME-WAVE 4-ish","price":1.2,"age":"old","blurb":"The previous generation. Still carries most of Pakistan, Sri Lanka and Bangladesh, held together with hope.","pairs":[["khi","mrs",[[65,23.5],[60,22],[55,15.5],[48,12.6],[43.2,11.8],[40.2,14.5],[37.2,20.5],[34.2,25.5],[32.2,29],[31.6,30.7],[29.2,31.5],[19.2,33.5],[11.2,37],[5.2,42]]],["khi","bom",[[67,23],[70,20.5]]],["bom","cbo",[[72,15],[75,8],[78.5,6.3]]],["cbo","maa",[[80.6,8.6],[81,11.5]]],["maa","dac",[[82,14],[87,17.5],[91.5,21.2]]],["dac","sin",[[92,21],[93,17],[95,10],[97,6.4],[100,3.6],[102.6,2.1],[103.7,1.3]]]]}, + {"id":"balt","name":"Baltic Anchor Magnet","price":0.8,"age":"mid","blurb":"Short hops under the Baltic Sea. Every passing ship seems to find it.","pairs":[["tll","hel",[[24.8,59.8]]],["tll","sto",[[22,59.3],[19.5,59.3]]]]}, + {"id":"bsea","name":"Black Sea-ish Cable","price":1.0,"age":"mid","blurb":"Istanbul to Bucharest's coast across the Black Sea.","pairs":[["ist","buh",[[29.5,42],[29.5,43.5],[28.8,44.2]]]]} ]; const CAB=Object.fromEntries(CABLES.map(c=>[c.id,c])); const CABLE_PAIRS=CABLES.flatMap(c=>c.pairs.map(([a,b,mid])=>{const A=CITY[a],B=CITY[b];const near=(x,ref)=>x+W*Math.round((ref-x)/W); @@ -610,20 +638,20 @@ function cablePair(cid,a,b){const c=CABLE_PAIRS.find(x=>x.cid===cid&&((x.a===a&& const ALLC=CITIES.filter(c=>!c.cn&&!c.ru&&!c.ixOnly).map(c=>c.id); const ruCity=c=>!!CITY[c].ru; const cnCity=c=>!!CITY[c].cn; -const BIGC=['rio','bue','scl','bog','lim','del','maa','blr','hyd','tpe','cpt','auh','ber','zrh','nbo','cai','jkt','mnl','per','akl','dub','lax','tor','mex','dxb','cph','icn','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mrs','mad','sto','bom','sin','hkg','tok','syd','jnb','lag']; -const MIDC=['rio','bue','scl','bog','del','maa','blr','tpe','auh','ber','zrh','jkt','mnl','dub','lax','tor','dxb','icn','sjc','ash','nyc','chi','dal','mia','lon','ams','fra','par','mad','sin','hkg','tok','syd','bom','sao']; +const BIGC=['mel','bne','osa','kul','bkk','sgn','khi','dac','waw','prg','vie','bud','buh','ist','rio','bue','scl','bog','lim','del','maa','blr','hyd','tpe','cpt','auh','ber','zrh','nbo','cai','jkt','mnl','per','akl','dub','lax','tor','mex','dxb','cph','icn','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mrs','mad','sto','bom','sin','hkg','tok','syd','jnb','lag']; +const MIDC=['mel','osa','kul','bkk','waw','vie','ist','rio','bue','scl','bog','del','maa','blr','tpe','auh','ber','zrh','jkt','mnl','dub','lax','tor','dxb','icn','sjc','ash','nyc','chi','dal','mia','lon','ams','fra','par','mad','sin','hkg','tok','syd','bom','sao']; /* ================= NETWORKS ================= */ const NETS=[ - {id:'lvl',name:'Level Tree',asn:3535,type:'t1',pol:'restrictive',share:.07,price:9,col:'#7B61FF',pops:['ber','zrh','dub','cph','osl','tor','lax','mex','mtl','sea','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mad','rio','bue','scl','bog','lim','pan'],ix:[],blurb:'Grew from a seedling into a global backbone. Leaves no route behind.'}, - {id:'ntt',name:'Not That Telecom',asn:2941,type:'t1',pol:'restrictive',share:.06,price:8,col:'#4B3FC4',pops:['jkt','mnl','per','lax','dxb','icn','sea','sjc','dal','ash','nyc','lon','ams','fra','sin','hkg','tok','syd','tpe','del','maa','blr','hyd'],ix:[],blurb:'Huge in Asia. "Which telecom?" "Not that one."'}, - {id:'tly',name:'Tell-Ya Carrier',asn:1229,type:'t1',pol:'restrictive',share:.05,price:8,col:'#9D4EDD',pops:['ber','osl','cph','hel','beg','sof','chi','ash','nyc','mia','lon','ams','fra','par','sto','mad','mrs','hkg','sin','tpe'],ix:[],blurb:'Nordic backbone that tells you exactly where your packets went.'}, - {id:'cog',name:'Cogentle',asn:714,type:'t1',pol:'restrictive',share:.04,price:3,col:'#B35CF0',pops:['ber','zrh','dub','hel','sof','beg','tor','lax','mex','cph','icn','sea','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mad','mrs','sto','sin','hkg','tok','rio','bue','scl','bog','lim'],ix:[],blurb:'Cheapest transit on the map. Famously gentle, except during peering spats.'}, - {id:'tat',name:'Ta-Ta Comms',asn:6543,type:'t1',pol:'restrictive',share:.04,price:9,col:'#6A4C93',pops:['nbo','cai','jkt','dxb','nyc','ash','lon','fra','mrs','lag','jnb','bom','sin','hkg','tok','del','maa','blr','hyd','cpt','fuj','auh','tpe'],ix:[],blurb:'Waves goodbye to latency across the Indian Ocean.'}, - {id:'drz',name:'Drizzle Electric',asn:9369,type:'t2',pol:'open',share:.04,price:4,col:'#1E90FF',pops:['ber','zrh','nbo','akl','per','jkt','mnl','dub','rek','tor','mtl','lax','mex','sof','osl','icn','sea','sjc','dal','chi','ash','nyc','mia','lon','ams','fra','par','sto','mad','hkg','sin','tok','syd','jnb','for','rio','bue','scl','lim','bog','pan','del','maa','blr','hyd','tpe','auh','cpt'],ix:'ALL',blurb:'Will peer with anyone, anywhere. Rumored to mail out IPv6 cakes.'}, - {id:'tng',name:'Tangerine Telecom',asn:5115,type:'t2',pol:'selective',minIx:15,minPni:40,share:.03,price:6,col:'#FF8C42',pops:['cai','nbo','dxb','par','mrs','mad','lon','ams','lag','jnb'],ix:['par','mrs','mad','lon','ams','lag','jnb'],blurb:'Juicy reach into Europe and Africa.'}, - {id:'sgt',name:'SingTell',asn:7474,type:'t2',pol:'selective',minIx:15,minPni:40,share:.03,price:7,col:'#00A6A6',pops:['jkt','mnl','per','akl','icn','sin','hkg','tok','syd','bom','tpe','maa'],ix:['sin','hkg','tok','syd','bom','tpe','maa'],blurb:'Sings your packets across Asia-Pacific.'}, - {id:'vdp',name:'Voda-Phony',asn:1373,type:'t2',pol:'selective',minIx:15,minPni:40,share:.03,price:6,col:'#E63946',pops:['nbo','cai','ber','dub','dxb','lon','fra','ams','mad','mrs','jnb','bom','lag','cpt','del','maa'],ix:['lon','fra','ams','mad','mrs','jnb','bom','lag','cpt','del','maa'],blurb:'Mobile giant. The signal is real, the name is not.'}, + {id:'lvl',name:'Level Tree',asn:3535,type:'t1',pol:'restrictive',share:.07,price:9,col:'#7B61FF',pops:['ber','zrh','dub','cph','osl','tor','lax','mex','mtl','sea','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mad','rio','bue','scl','bog','lim','pan','waw','prg','vie','bud','buh','ist'],ix:[],blurb:'Grew from a seedling into a global backbone. Leaves no route behind.'}, + {id:'ntt',name:'Not That Telecom',asn:2941,type:'t1',pol:'restrictive',share:.06,price:8,col:'#4B3FC4',pops:['jkt','mnl','per','lax','dxb','icn','sea','sjc','dal','ash','nyc','lon','ams','fra','sin','hkg','tok','syd','tpe','del','maa','blr','hyd','osa','kul','bkk','sgn'],ix:[],blurb:'Huge in Asia. "Which telecom?" "Not that one."'}, + {id:'tly',name:'Tell-Ya Carrier',asn:1229,type:'t1',pol:'restrictive',share:.05,price:8,col:'#9D4EDD',pops:['ber','osl','cph','hel','beg','sof','chi','ash','nyc','mia','lon','ams','fra','par','sto','mad','mrs','hkg','sin','tpe','tll','waw','vie','bud','buh','prg'],ix:[],blurb:'Nordic backbone that tells you exactly where your packets went.'}, + {id:'cog',name:'Cogentle',asn:714,type:'t1',pol:'restrictive',share:.04,price:3,col:'#B35CF0',pops:['ber','zrh','dub','hel','sof','beg','tor','lax','mex','cph','icn','sea','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mad','mrs','sto','sin','hkg','tok','rio','bue','scl','bog','lim','osa','waw','prg','vie','bud','buh','ist'],ix:[],blurb:'Cheapest transit on the map. Famously gentle, except during peering spats.'}, + {id:'tat',name:'Ta-Ta Comms',asn:6543,type:'t1',pol:'restrictive',share:.04,price:9,col:'#6A4C93',pops:['nbo','cai','jkt','dxb','nyc','ash','lon','fra','mrs','lag','jnb','bom','sin','hkg','tok','del','maa','blr','hyd','cpt','fuj','auh','tpe','khi','dac','cbo','kul','bkk'],ix:[],blurb:'Waves goodbye to latency across the Indian Ocean.'}, + {id:'drz',name:'Drizzle Electric',asn:9369,type:'t2',pol:'open',share:.04,price:4,col:'#1E90FF',pops:['ber','zrh','nbo','akl','per','jkt','mnl','dub','rek','tor','mtl','lax','mex','sof','osl','icn','sea','sjc','dal','chi','ash','nyc','mia','lon','ams','fra','par','sto','mad','hkg','sin','tok','syd','jnb','for','rio','bue','scl','lim','bog','pan','del','maa','blr','hyd','tpe','auh','cpt','mel','bne','osa','kul','bkk','sgn','khi','dac','cbo','waw','prg','vie','bud','buh','tll','ist'],ix:'ALL',blurb:'Will peer with anyone, anywhere. Rumored to mail out IPv6 cakes.'}, + {id:'tng',name:'Tangerine Telecom',asn:5115,type:'t2',pol:'selective',minIx:15,minPni:40,share:.03,price:6,col:'#FF8C42',pops:['cai','nbo','dxb','par','mrs','mad','lon','ams','lag','jnb','waw','buh'],ix:['par','mrs','mad','lon','ams','lag','jnb','waw'],blurb:'Juicy reach into Europe and Africa.'}, + {id:'sgt',name:'SingTell',asn:7474,type:'t2',pol:'selective',minIx:15,minPni:40,share:.03,price:7,col:'#00A6A6',pops:['jkt','mnl','per','akl','icn','sin','hkg','tok','syd','bom','tpe','maa','kul','bkk','sgn','mel'],ix:['sin','hkg','tok','syd','bom','tpe','maa','kul','bkk'],blurb:'Sings your packets across Asia-Pacific.'}, + {id:'vdp',name:'Voda-Phony',asn:1373,type:'t2',pol:'selective',minIx:15,minPni:40,share:.03,price:6,col:'#E63946',pops:['nbo','cai','ber','dub','dxb','lon','fra','ams','mad','mrs','jnb','bom','lag','cpt','del','maa','ist','prg','bud','buh'],ix:['lon','fra','ams','mad','mrs','jnb','bom','lag','cpt','del','maa'],blurb:'Mobile giant. The signal is real, the name is not.'}, {id:'ctc',name:'China Telecomet',asn:4314,type:'t2',pol:'restrictive',share:.02,price:22,premium:2.5,cn:true,col:'#0B5CAD',pops:['pek','sha','hkg','sin','tok','lon','fra','nyc','sjc'],ix:[],blurb:'The biggest network in China. Its CN-Too premium route skips the congested border, for a price.'}, {id:'cun',name:'China Unicorn',asn:4837,type:'t2',pol:'restrictive',share:.015,price:16,cn:true,col:'#D7000F',pops:['pek','sha','hkg','fra','sjc','lon'],ix:[],blurb:'Number two in China, with a horn for every backbone.'}, {id:'cmb',name:'China Moble',asn:9880,type:'eye',pol:'paid',paidFee:12000,share:.01,cn:true,col:'#0085CA',pops:['pek','sha','hkg'],ix:[],blurb:'The largest mobile network on Earth. Paid peering only.'}, @@ -654,7 +682,7 @@ NETS.push( {id:'tsf',name:'Telkom-selfie',asn:7713,type:'eye',pol:'selective',minIx:10,minPni:30,share:.01,col:'#E4002B',pops:['jkt','sin'],ix:['jkt','sin'],blurb:'Indonesia’s mobile giant. Every packet poses for a photo first.'}, {id:'pld',name:'PLDTea Time',asn:9299,type:'eye',pol:'selective',minIx:10,minPni:30,share:.008,col:'#D62027',pops:['mnl','hkg','sin'],ix:['mnl','hkg'],blurb:'Philippine giant. Peering requests are reviewed over a cup of tea.'}, {id:'spk',name:'Spark-le',asn:4771,type:'eye',pol:'open',share:.005,col:'#6A2C91',pops:['akl','syd'],ix:['akl','syd'],blurb:'New Zealand’s shiniest ISP.'}, - {id:'tsy',name:'Telstraya',asn:1221,type:'t2',pol:'selective',minIx:15,minPni:40,share:.01,price:9,col:'#0099F8',pops:['syd','per','sin','hkg','lax','tpe'],ix:['syd','per','sin','hkg'],blurb:'Australia’s big one. G’day, that will be nine dollars a megabit. Sorry, gigabit.'}); + {id:'tsy',name:'Telstraya',asn:1221,type:'t2',pol:'selective',minIx:15,minPni:40,share:.01,price:9,col:'#0099F8',pops:['syd','per','sin','hkg','lax','tpe','mel','bne','drw'],ix:['syd','per','sin','hkg','mel','bne'],blurb:'Australia’s big one. G’day, that will be nine dollars a megabit. Sorry, gigabit.'}); NETS.push( {id:'sfc',name:'Safari-Comic',asn:33771,type:'eye',pol:'selective',minIx:5,minPni:20,share:.006,col:'#4CB848',pops:['nbo'],ix:['nbo'],blurb:'Kenya’s mobile giant. Pays you in M-Pesos.'}, {id:'teg',name:'Tele-Comet Egypt',asn:8452,type:'t2',pol:'selective',minIx:15,minPni:40,share:.006,price:8,col:'#5B2D8E',pops:['cai','mrs','fra','lon'],ix:['cai','mrs'],blurb:'Owns the land crossing every Red Sea cable needs. Collects tolls like a pharaoh.'}); @@ -663,9 +691,19 @@ NETS.push( {id:'viv',name:'Vivo-ish',asn:26959,type:'eye',pol:'selective',minIx:8,minPni:25,share:.01,col:'#660099',pops:['sao','rio','for'],ix:['sao','rio','for'],blurb:'Brazil’s mobile giant. Very much alive.'}, {id:'mlv',name:'Mercado Livre-ly',asn:52850,type:'cdn',pol:'open',share:.006,col:'#FFE600',pops:['sao','rio','bue','scl','bog','lim','mia'],ix:['sao','rio','bue','scl','bog','lim'],blurb:'Ships parcels and packets, both overnight.'}, {id:'jio',name:'Jio-graphy',asn:55863,type:'eye',pol:'selective',minIx:10,minPni:30,share:.02,col:'#0F3CC9',pops:['bom','del','maa','blr','hyd'],ix:['bom','del','maa','blr','hyd'],blurb:'Gave a billion people cheap data. Knows exactly where every one of them is.'}, - {id:'atl',name:'Airtel-tale',asn:9849,type:'t2',pol:'selective',minIx:15,minPni:40,share:.01,price:7,col:'#E40000',pops:['bom','del','maa','blr','hyd','sin','lon','dxb'],ix:['bom','del','maa','blr'],blurb:'India’s other giant. Every outage comes with a story.'}, + {id:'atl',name:'Airtel-tale',asn:9849,type:'t2',pol:'selective',minIx:15,minPni:40,share:.01,price:7,col:'#E40000',pops:['bom','del','maa','blr','hyd','sin','lon','dxb','dac','cbo'],ix:['bom','del','maa','blr'],blurb:'India’s other giant. Every outage comes with a story.'}, {id:'cht',name:'Chunghwa Tele-calm',asn:3426,type:'t2',pol:'selective',minIx:10,minPni:30,share:.008,price:7,col:'#00A0E9',pops:['tpe','hkg','tok','lax','sin'],ix:['tpe','hkg'],blurb:'Taiwan’s incumbent. Stays calm while ships drag their anchors over its cables.'}, {id:'duu',name:'do-ish',asn:15820,type:'eye',pol:'paid',paidFee:6000,share:.004,col:'#00A9CE',pops:['dxb','auh','fuj'],ix:[],blurb:'The other half of the UAE duopoly. Does what Etis-a-lot does, in a different colour.'}); +NETS.push( + {id:'kdi',name:'KD-DIY',asn:2561,type:'t2',pol:'selective',minIx:10,minPni:30,share:.008,price:6,col:'#E85D04',pops:['tok','osa','lax','sin','hkg'],ix:['tok','osa'],blurb:'Japanese carrier that builds everything itself. Even the cable ships.'}, + {id:'opt',name:'Opt-Out-Us',asn:7745,type:'eye',pol:'selective',minIx:8,minPni:25,share:.006,col:'#00837E',pops:['syd','mel','bne','per'],ix:['syd','mel','bne'],blurb:'Australia’s number two. You can opt out of the marketing emails, eventually.'}, + {id:'tru',name:'Mostly-True Move',asn:7740,type:'eye',pol:'selective',minIx:5,minPni:20,share:.006,col:'#E4002B',pops:['bkk'],ix:['bkk'],blurb:'Thailand’s mobile giant. Its coverage maps are mostly true.'}, + {id:'vtl',name:'Viet-tell',asn:7525,type:'t2',pol:'selective',minIx:10,minPni:30,share:.005,price:7,col:'#EE0033',pops:['sgn','hkg','sin'],ix:['sgn'],blurb:'Vietnam’s giant. Will tell you which subsea cable is broken this week.'}, + {id:'ptc',name:'PTC-hell',asn:17577,type:'t2',pol:'selective',minIx:10,minPni:30,share:.004,price:8,col:'#00843D',pops:['khi','dxb'],ix:['khi'],blurb:'Pakistan’s incumbent. Every session comes with a firewall rule.'}, + {id:'tmy',name:'Telekom Ma-lazy-sia',asn:4877,type:'t2',pol:'selective',minIx:10,minPni:30,share:.004,price:6,col:'#1F2A6B',pops:['kul','sin'],ix:['kul'],blurb:'Malaysia’s incumbent. In no hurry whatsoever.'}, + {id:'ttk',name:'Türk Tele-komik',asn:9211,type:'t2',pol:'selective',minIx:10,minPni:30,share:.008,price:6,col:'#1D3F8F',pops:['ist','fra','sof','lon'],ix:['ist'],blurb:'Bridges Europe and Asia, and occasionally your BGP table.'}, + {id:'dgi',name:'Digi-tally Cheap',asn:8798,type:'eye',pol:'open',share:.006,col:'#2A5CAA',pops:['buh','bud','mad'],ix:['buh','bud','mad'],blurb:'Gigabit to every flat for the price of a coffee. Peers with anyone.'}, + {id:'ups',name:'UPC-You-Later',asn:6380,type:'eye',pol:'selective',minIx:8,minPni:25,share:.006,col:'#D8001B',pops:['waw','prg','vie','bud','zrh'],ix:['waw','prg','vie'],blurb:'Cable broadband across Central Europe. See you later, in a support queue.'}); const NET=Object.fromEntries(NETS.map(n=>[n.id,n])); const NSH={}; {const t=NETS.reduce((a,n)=>a+n.share,0); NETS.forEach(n=>NSH[n.id]=n.share/t);} const CN_W={ctc:.2,cun:.14,cmb:.08,tcs:.22,abc:.14,byd:.08,bdc:.08,akm:.02,msf:.02,amz:.01,drz:.01}; @@ -942,12 +980,12 @@ function compute(){ const dijk=(s0,mode)=>{const dist={[s0]:0},prev={},done=new Set();for(;;){let u=null,ud=Infinity;for(const k in dist)if(!done.has(k)&&dist[k]day, leak=ev.leak&&ev.leak.until>day?ev.leak.net:null; - for(const t of S.transit){if(!popUp(t.city)||t.down>day)continue; + for(const t of S.transit){if(!popUp(t.city)||t.down>day||siteDown(t.city,t.site||'a'))continue; E.push({k:'t',prem:!!t.premium&&t.city==='hkg',pref:t.pref||'normal',lab:NET[t.net].name+' transit',id:t.id,city:t.city,cap:lagCap(PORT[t.tier].g,t.n),used:0,rank:3,ok:n=>!(depeer&&t.net==='cog'&&n==='ggl')&&n!==leak});} - for(const c in S.ixp){if(!(popUp(c)||remote.includes(c))||(S.ev.ixdown&&S.ev.ixdown[c]>day))continue;const set=ixSessions(c);R2.sessions+=set.size; + for(const c in S.ixp){if(!(popUp(c)||remote.includes(c))||(S.ev.ixdown&&S.ev.ixdown[c]>day)||siteDown(c,(S.ixSite||{})[c]||'a'))continue;const set=ixSessions(c);R2.sessions+=set.size; E.push({k:'ix',pref:(S.ixPref&&S.ixPref[c])||'normal',lab:ixName(c)+' peering',id:c,city:c,cap:ixCap(c),used:0,rank:2,ok:n=>set.has(n)});} - for(const p of S.pni){R2.sessions++;if(!popUp(p.city))continue;E.push({k:'p',pnc:!!NET[p.net].cn,pref:p.pref||'normal',lab:'PNI with '+NET[p.net].name,id:p.id,city:p.city,cap:lagCap(PORT[p.tier].g,p.n),used:0,rank:1,ok:n=>n===p.net});} - for(const c of S.caches){if(!popUp(c.city))continue;E.push({k:'c',pref:'normal',lab:NET[c.net].cache.name+' cache',id:c.id,city:c.city,cap:CACHE_CAP,used:0,rank:0,ok:n=>n===c.net});} + for(const p of S.pni){R2.sessions++;if(!popUp(p.city)||siteDown(p.city,p.site||'a'))continue;E.push({k:'p',pnc:!!NET[p.net].cn,pref:p.pref||'normal',lab:'PNI with '+NET[p.net].name,id:p.id,city:p.city,cap:lagCap(PORT[p.tier].g,p.n),used:0,rank:1,ok:n=>n===p.net});} + for(const c of S.caches){if(!popUp(c.city)||siteDown(c.city,'a'))continue;E.push({k:'c',pref:'normal',lab:NET[c.net].cache.name+' cache',id:c.id,city:c.city,cap:CACHE_CAP,used:0,rank:0,ok:n=>n===c.net});} {const rp=ev.rpki&&ev.rpki.until>day?new Set(ev.rpki.nets):null;if(rp)for(const e of E){if(e.k==='c')continue;const o=e.ok;e.ok=n=>!rp.has(n)&&o(n);}} for(const n of NETS){R2.reachable[n.id]=E.some(e=>e.rank>0&&e.ok(n.id));if(R2.reachable[n.id])R2.reach+=NSH[n.id];} const cacheNets=new Set(S.caches.filter(c=>popUp(c.city)).map(c=>c.net)); @@ -1024,7 +1062,7 @@ function compute(){ C.pni=S.pni.reduce((a,p)=>a+PORT[p.tier].pni*(p.n||1)+(NET[p.net].pol==='paid'?NET[p.net].paidFee:0),0); C.caches=S.caches.length*CACHE_MO; C.loans=(S.loans||[]).reduce((a,l)=>a+(BANKS[l.bank].equity?0:l.pay),0); - C.extras=(S.cnLic&&S.cnLic.state==='ok'?CN_JV_MO:0)+(S.scrubAt?SCRUB_MO:0)+Object.keys(S.pops).filter(ruCity).length*RU_BOX_MO; + C.extras=(S.cnLic&&S.cnLic.state==='ok'?CN_JV_MO:0)+(S.scrubAt?SCRUB_MO:0)+Object.keys(S.pops).filter(ruCity).length*RU_BOX_MO+Object.values(S.pops).filter(p=>p.site2).length*SITE2_MO; V.eyeballs=0;V.business=0;V.ix=0; for(const c in S.pops){const sf=sfOf(R2,c);V.eyeballs+=R2.cityEye[c]*sf*EYE_RATE*(CITY[c].arpu||1);} for(const b of S.biz){const sf=BIZ_T[b.type].fiber?(fiberOk(b)?1:0):BIZ_T[b.type].l2?clamp((R2.l2[b.id]||0)/b.bw,0,1):sfOf(R2,b.city);V.business+=b.bw*b.rate*Math.min(1,sf/0.95);} @@ -1053,6 +1091,7 @@ const REQS={ gen:{l:'Backup generator in every city they touch',bonus:.15,ok:b=>[b.city,b.city2].filter(Boolean).every(c=>S.pops[c]&&S.pops[c].gen)}, routers:{l:'Insists on two routers in their city',bonus:.15,ok:b=>((S.pops[b.city]&&S.pops[b.city].routers)||1)>=2}, local:{l:'Local breakout: transit or an IX port in their own city',bonus:.2,ip:true,ok:b=>S.transit.some(t=>t.city===b.city)||S.ixp[b.city]!==undefined}, + metro:{l:'Two data centers in every metro they touch',bonus:.2,only:true,ok:b=>[b.city,b.city2].filter(Boolean).every(c=>S.pops[c]&&S.pops[c].site2)}, twoup:{l:'Wants two different transit providers (or none at all)',bonus:.15,ip:true,ok:()=>new Set(S.transit.map(t=>t.net)).size>=2||S.transit.length===0}, china:{l:'Needs low-loss reach into China',bonus:.3,ip:true,ok:()=>S.transit.some(t=>t.premium&&t.city==='hkg')||S.links.some(l=>l.premium)||S.pni.some(p=>NET[p.net].cn)}, scrubbed:{l:'Will only sign with a network that runs a DDoS scrubbing center',bonus:.15,ok:()=>!!S.scrubAt}, @@ -1116,7 +1155,10 @@ function viaSeg(a,b){const cabs=cablesOk(a,b),sub=isSub(a,b);if(!cabs.length)ret function bestLat(a,b){const ls=S.links.filter(l=>!linkDown(l));const dist={[a]:0},done=new Set();for(;;){let u=null,ud=Infinity;for(const k in dist)if(!done.has(k)&&dist[k]Route:${Object.keys(RT).map(m=>btn(RT[m],'setRoute',{id:b.id,m},(b.route||'normal')===m?'pink sm':'ghost sm')).join('')}
Path latency: ${lt!==undefined?lt.toFixed(1)+' ms one-way':'no path yet'}${b.latMax?` · budget ${b.latMax} ms`:''}
`;} -function nodeCap(c){const p=S.pops[c];if(!p)return Infinity;const eff=(p.routers||1)-(p.rdown>S.day?1:0);return RG[p.rgen||0].cap*Math.max(1,eff)*(p.hot>S.day?0.5:1);} +function nodeCap(c){const p=S.pops[c];if(!p)return Infinity;const eff=(p.routers||1)-(p.rdown>S.day?1:0);return RG[p.rgen||0].cap*Math.max(1,eff)*(p.hot>S.day?(p.site2?0.75:0.5):1)*(p.site2&&(siteDown(c,'a')||siteDown(c,'b'))?0.5:1);} +// With a second site, one building can be dark (or cut off by a ring cut) while the other carries on. +function siteDown(c,s){const p=S.pops[c];if(!p||!p.site2)return false;if(p.sdown&&p.sdown.until>S.day&&p.sdown.s===s)return true;return s==='b'&&p.ringcut>S.day;} +function siteCtl(k,id,c,cur){const p=S.pops[c];if(!p||!p.site2)return '';cur=cur||'a';return `
Site:${['a','b'].map(x=>btn(`${x.toUpperCase()} ${esc(siteName(c,x))}`,'siteSet',{k,id,s:x},cur===x?'pink sm':'ghost sm')).join('')}
`;} function portOk(c,i){const p=S.pops[c];return i<=RG[p?(p.rgen||0):0].maxP;} function waveOk(a,b,i){return [a,b].every(c=>i<=RG[S.pops[c]?(S.pops[c].rgen||0):0].maxLT);} function waveNeed(i){const g=RG.find(r=>r.maxLT>=i);return g?g.n:'?';} @@ -1150,6 +1192,7 @@ function fireFailure(){ const live=S.links.filter(l=>l.kind!=='vxc'&&!linkDown(l));const fabsUsed=[...new Set(S.links.filter(l=>l.kind==='vxc').map(l=>l.prov))]; if(live.length){opts.push(['cut',2+Math.min(6,live.length/2)]);} if(Object.keys(S.pops).length)opts.push(['crash',3],['power',2]); + if(Object.values(S.pops).some(p=>p.site2))opts.push(['ring',1.2]); if(S.transit.some(t=>!(t.down>S.day)))opts.push(['transit',3]); if(Object.keys(S.ixp).length)opts.push(['ixloop',2]); if(S.transit.length&&S.day>60)opts.push(['leak',2]); @@ -1163,6 +1206,8 @@ function fireFailure(){ if(type==='funny'){const f=['oops','cleaner','harmless','harmless','harmless','ac'];if(live.length)f.push('fatwave','fatwave','mtu','label');if(Object.keys(S.ixp).length)f.push('maxpfx');if(S.transit.length)f.push('prepend');if(S.day>30)f.push('rpki');if(lit.length)f.push('roadmff');type=pick(f);} const before=R.served; if(type==='harmless'){const m=pick(HARMLESS);S.stats.incidents++;S.stats.survived++;toast(`${m[0]}
${m[1]}`,'goal');sfx('alert');return;} + if(type==='ring'){const cs=Object.keys(S.pops).filter(c=>S.pops[c].site2),c=pick(cs),pp=S.pops[c],dur=2+Math.floor(Math.random()*3);pp.ringcut=S.day+dur; + addInc({type,ref:c,until:pp.ringcut,msg:pick([`A backhoe cut the metro ring between your two sites in ${CITY[c].name}. Turns out both fiber routes ran down the same street.`,`Someone pulled the wrong cross-connect at the meet-me room in ${CITY[c].name}, and ${siteName(c,'b')} is cut off from ${siteName(c,'a')}.`,`A tram line construction project in ${CITY[c].name} found your metro ring. Both halves of it.`]),cost:3000,fix:'Splice it tonight'});return;} if(type==='ac'){const c=pick(Object.keys(S.pops)),pp=S.pops[c];pp.hot=S.day+2; addInc({type,ref:c,until:pp.hot,msg:pick([`The A/C at ${CITY[c].dc} died on the hottest day of the year. Your routers in ${CITY[c].name} throttled to half capacity.`,`Someone set the data center thermostat in ${CITY[c].name} to Fahrenheit thinking it was Celsius. Routers are cooking at half speed.`,`The cooling contractor in ${CITY[c].name} replaced the chillers with a very confident fan. Half capacity for two days.`]),cost:2000,fix:'Buy 40 desk fans'}); }else if(type==='fatwave'||type==='label'){ @@ -1175,6 +1220,7 @@ function fireFailure(){ const l=pick(live);l.deg=S.day+3;addInc({type,ref:l.id,until:l.deg,msg:`MTU mismatch on ${CITY[l.a].name}–${CITY[l.b].name}: jumbo frames keep getting stuck in the tube. Usable capacity halved.`,cost:800,fix:'Set MTU 9216 everywhere'}); }else if(type==='oops'||type==='cleaner'){ const c=pick(Object.keys(S.pops)),pp=S.pops[c],C=CITY[c].name; + if(type==='cleaner'&&pp.site2&&(pp.routers||1)<2){S.stats.incidents++;S.stats.survived++;pp.sdown={until:S.day+1,s:'a'};toast(`Vacuum incident in ${C}
The cleaner unplugged everything at ${esc(siteName(c,'a'))}. ${esc(siteName(c,'b'))} kept the city online at half capacity.`,'good');sfx('alert');return;} if(type==='cleaner'&&(pp.routers||1)>=2){S.stats.incidents++;S.stats.survived++;toast(`Vacuum incident in ${C}
The cleaner at ${CITY[c].dc} unplugged one of your routers to plug in a vacuum. The other one kept going. The floor is spotless.`,'good');sfx('alert');return;} pp.down=Math.max(pp.down||0,S.day+1); const msg=type==='cleaner'?`The cleaner at ${CITY[c].dc} unplugged your router to plug in a vacuum. The floor is spotless.`:pick([`Your on-call engineer typed “clear bgp *” in production in ${C} at 3am. It cleared.`,`An intern pushed an ACL in ${C} that denies 0.0.0.0/0. Very secure. Very offline.`,`Someone ran “reload” on the ${C} router, thinking it was their laptop terminal.`,`A config template rendered “{{ router_id }}” literally in ${C}. The router took it personally.`,`Someone committed a config in ${C} with “commit confirmed 1” and went to lunch.`,`Someone deployed to ${C} on a Friday at 16:59.`,`A cosmic ray flipped a bit in your ${C} router. It now believes 10.0.0.0/8 lives in Antarctica.`,`An automation script in ${C} ran “sed” on the whole config instead of one line. Every interface is now named “TODO”.`]); @@ -1194,14 +1240,15 @@ function fireFailure(){ const l=pick(lit),A=CITY[l.a].name,B=CITY[l.b].name,o=pick(l.ch),dur=l.spares?1:4;l.chFail={n:1,o,until:S.day+dur}; addInc({type,ref:l.id,until:S.day+dur,msg:pick([`A ${OPT[o].n} on ${A}–${B} overheated and is now a very expensive keychain.`,`The laser in a ${OPT[o].n} on ${A}–${B} died. One channel dark.`,`A ${OPT[o].n} on ${A}–${B} started reporting a temperature of 900°C. It was wrong, but it shut down anyway.`])+(l.spares?' Swapped from your spares kit by tomorrow.':''),cost:l.spares?0:OPT[o].cost,fix:'Buy a replacement'}); }else if(type==='cut'){ - const mon=Math.floor((S.day%365)/30.42),monsoon=mon>=5&&mon<=8,tw=x=>x.sub&&(x.a==='tpe'||x.b==='tpe'),inl=x=>!x.sub&&(CITY[x.a].india||CITY[x.b].india); - const l=pick(live.flatMap(x=>{const w=(x.cable&&CAB[x.cable].age==='old'?3:1)*(tw(x)?4:1)*(!x.sub&&andesPair(x.a,x.b)?4:1)*(monsoon&&inl(x)?3:1);return Array(w).fill(x);})),dur=10+Math.floor(Math.random()*8),tr=l.trench||l.id,hit=S.links.filter(x=>(x.trench||x.id)===tr);hit.forEach(x=>x.cut=Math.max(x.cut||0,S.day+dur)); + const mon=Math.floor((S.day%365)/30.42),monsoon=mon>=5&&mon<=8,tw=x=>x.sub&&(x.a==='tpe'||x.b==='tpe'||['clion','balt'].includes(x.cable)),vn=x=>x.sub&&(x.a==='sgn'||x.b==='sgn'),inl=x=>!x.sub&&(CITY[x.a].india||CITY[x.b].india); + const l=pick(live.flatMap(x=>{const w=(x.cable&&CAB[x.cable].age==='old'?3:1)*(tw(x)?4:1)*(vn(x)?3:1)*(!x.sub&&andesPair(x.a,x.b)?4:1)*(monsoon&&inl(x)?3:1);return Array(w).fill(x);})),dur=10+Math.floor(Math.random()*8),tr=l.trench||l.id,hit=S.links.filter(x=>(x.trench||x.id)===tr);hit.forEach(x=>x.cut=Math.max(x.cut||0,S.day+dur)); const A=CITY[l.a].name,B=CITY[l.b].name; - const msg=tw(l)&&Math.random()<0.8?pick([`A cargo ship “forgot” to raise its anchor and dragged it across your ${A}–${B} cable. The owners are very sorry, and somewhat hard to reach.`,`Another anchor, another cut: your ${A}–${B} cable. The ship’s flag changed twice during the investigation.`,`A fishing boat with an unusually heavy anchor cut ${A}–${B}. It was not fishing.`]):!l.sub&&andesPair(l.a,l.b)?pick([`A landslide in the Andes buried your ${A}–${B} fiber.`,`Snow closed the mountain pass, and the repair crew with it: ${A}–${B} is down.`,`An earthquake shook your ${A}–${B} fiber loose somewhere above 4,000 metres.`,`A llama herd trampled the fiber marker on ${A}–${B}. Then a backhoe found the fiber.`]):!l.sub&&(CITY[l.a].india||CITY[l.b].india)?pick([`Road widening near ${A} cut your fiber to ${B}. It is always road widening.`,`The monsoon flooded a manhole on ${A}–${B}. The fiber is now underwater, as is the manhole.`,`A JCB-ish digger found your ${A}–${B} fiber. A different JCB-ish digger is coming to fix it.`]):l.sub?pick([`A curious shark bit your subsea cable ${A}–${B}.`,`A ship dragged its anchor across your ${A}–${B} cable.`,`An undersea landslide snapped ${A}–${B}.`]):pick([`A backhoe found your fiber between ${A} and ${B}.`,`Squirrels chewed through ${A}–${B}. They regret nothing.`,`Road works cut ${A}–${B}. Nobody called before digging.`]); + const msg=vn(l)&&Math.random()<0.8?pick([`Another of Vietnam’s subsea cables is broken: your ${A}–${B} link. The repair ship will come after the holidays. Which holidays is unclear.`,`Your ${A}–${B} cable broke in the same spot as last time. The repair crew recognised it.`]):!l.sub&&(l.a==='drw'||l.b==='drw')&&Math.random()<0.7?pick([`A crocodile took a bite out of your ${A}–${B} fiber. It was not impressed.`,`Termites ate the duct on ${A}–${B}. Then the fiber. Then the replacement duct.`]):tw(l)&&Math.random()<0.8?pick([`A cargo ship “forgot” to raise its anchor and dragged it across your ${A}–${B} cable. The owners are very sorry, and somewhat hard to reach.`,`Another anchor, another cut: your ${A}–${B} cable. The ship’s flag changed twice during the investigation.`,`A fishing boat with an unusually heavy anchor cut ${A}–${B}. It was not fishing.`]):!l.sub&&andesPair(l.a,l.b)?pick([`A landslide in the Andes buried your ${A}–${B} fiber.`,`Snow closed the mountain pass, and the repair crew with it: ${A}–${B} is down.`,`An earthquake shook your ${A}–${B} fiber loose somewhere above 4,000 metres.`,`A llama herd trampled the fiber marker on ${A}–${B}. Then a backhoe found the fiber.`]):!l.sub&&(CITY[l.a].india||CITY[l.b].india)?pick([`Road widening near ${A} cut your fiber to ${B}. It is always road widening.`,`The monsoon flooded a manhole on ${A}–${B}. The fiber is now underwater, as is the manhole.`,`A JCB-ish digger found your ${A}–${B} fiber. A different JCB-ish digger is coming to fix it.`]):l.sub?pick([`A curious shark bit your subsea cable ${A}–${B}.`,`A ship dragged its anchor across your ${A}–${B} cable.`,`An undersea landslide snapped ${A}–${B}.`]):pick([`A backhoe found your fiber between ${A} and ${B}.`,`Squirrels chewed through ${A}–${B}. They regret nothing.`,`Road works cut ${A}–${B}. Nobody called before digging.`]); addInc({type,ref:tr,until:S.day+dur,msg:msg+(hit.length>1?` All ${hit.length} links in that trench went down with it.`:''),cost:Math.max(4000,Math.round(hit.reduce((a,x)=>a+x.mo,0)*0.5))}); }else if(type==='crash'||type==='power'){ const c=pick(Object.keys(S.pops).flatMap(x=>type==='power'&&CITY[x].za?[x,x,x]:[x])),pp=S.pops[c],slow=slowBoot(c),dur=(type==='crash'?2+Math.floor(Math.random()*2):3+Math.floor(Math.random()*3))*(type==='crash'&&S.ev.sanction>S.day?2:1)+(slow?2+Math.floor(Math.random()*3):0); if(type==='crash'&&(pp.routers||1)>=2){pp.rdown=S.day+dur;S.stats.incidents++;S.stats.survived++;toast(`Router crash in ${CITY[c].name}
One router panicked and its twin took over.${slow?` The crashed one ${esc(pick(SLOW_BOOT))}.`:''} Capacity there is down one router for ${dur} days.`,'good');sfx('alert');return;} + if(type==='power'&&!pp.gen&&pp.site2){const sd=Math.random()<0.5?'a':'b';pp.sdown={until:S.day+dur,s:sd};addInc({type:'site',ref:c,until:S.day+dur,msg:`${CITY[c].za?'Load shedding':'A power cut'} took out ${siteName(c,sd)} in ${CITY[c].name}. ${siteName(c,sd==='a'?'b':'a')} kept going, so the POP runs at half capacity. Anything plugged in only at the dark site is offline.`,cost:5000,fix:'Rent a generator'});S.stats.survived++;return;} if(type==='power'&&pp.gen){S.stats.incidents++;S.stats.survived++;toast(CITY[c].za?`Load shedding in ${CITY[c].name}
Stage ${2+Math.floor(Math.random()*5)} today. Your generator coughed, then kept the lights on.`:`Power cut in ${CITY[c].name}
Your backup generator kicked in. Lights stayed on.`,'good');sfx('alert');return;} pp.down=Math.max(pp.down||0,S.day+dur); const msg=type==='crash'?(slow?`Your router in ${CITY[c].name} crashed and is rebooting. It ${pick(SLOW_BOOT)}. Boot time on this one: about ${bootMin(c)} minutes per attempt, and it is on attempt ${2+Math.floor(Math.random()*5)}.`:pick([`Your router in ${CITY[c].name} crashed. Kernel panic, packet panic.`,`A firmware update bricked your router in ${CITY[c].name}.`])):CITY[c].za?`Load shedding stage ${3+Math.floor(Math.random()*4)} in ${CITY[c].name}, and you have no generator. Buy one: here it is not optional.`:`Power outage at ${CITY[c].dc} in ${CITY[c].name}. The generator did not start.`; @@ -1230,7 +1277,7 @@ function fireFailure(){ else toast(`${incTitle(type)}
${esc(last.msg)}`,'bad',last.cost?[{l:`${last.fix||'Rush repair'} ${fmt$(last.cost)}`,act:'fixInc',args:{id:last.id}}]:[]); sfx('alert'); } -function incTitle(t){return {cut:'Fiber cut',crash:'Router crash',power:'Power outage',transit:'Upstream outage',ixloop:'IX meltdown',leak:'Route leak',ddos:'DDoS attack',fabric:'Fabric outage',depeer:'Peering spat',fatwave:'Fat-fingered wave',label:'Patch panel mishap',mtu:'MTU mismatch',oops:'Oops',cleaner:'Vacuum incident',maxpfx:'Max-prefix meltdown',prepend:'Prepend-ageddon',rpki:'RPKI invalid',amp:'Amplifier failure',roadmff:'Fat-fingered ROADM',optic:'Dead optic',maint:'Maintenance window',ac:'Cooling failure',hijack:'BGP hijack',shutdown:'Government shutdown',redsea:'Geopolitical cable cut'}[t]||'Incident';} +function incTitle(t){return {ring:'Metro ring cut',site:'Site outage',cut:'Fiber cut',crash:'Router crash',power:'Power outage',transit:'Upstream outage',ixloop:'IX meltdown',leak:'Route leak',ddos:'DDoS attack',fabric:'Fabric outage',depeer:'Peering spat',fatwave:'Fat-fingered wave',label:'Patch panel mishap',mtu:'MTU mismatch',oops:'Oops',cleaner:'Vacuum incident',maxpfx:'Max-prefix meltdown',prepend:'Prepend-ageddon',rpki:'RPKI invalid',amp:'Amplifier failure',roadmff:'Fat-fingered ROADM',optic:'Dead optic',maint:'Maintenance window',ac:'Cooling failure',hijack:'BGP hijack',shutdown:'Government shutdown',redsea:'Geopolitical cable cut'}[t]||'Incident';} const LINKCUT_TR=['cut','redsea'],LINKCUT_ID=['fatwave','label'],POPDOWN=['crash','power','oops','cleaner','maint','shutdown'],IXDOWN=['ixloop','maxpfx'],TDOWN=['transit','prepend'],LINKEQ=['mtu','amp','roadmff','optic']; function remainUntil(pred){let u=0;for(const x of S.inc)if(pred(x))u=Math.max(u,x.until);return u;} // Remove an incident, then restore each affected thing to whatever other incidents still hold it down. @@ -1246,6 +1293,8 @@ function clearInc(i){ else if(T==='ddos'){S.ev.ddos=null;} else if(T==='fabric'){if(S.ev.fab)S.ev.fab[i.ref]=remainUntil(x=>x.type==='fabric'&&x.ref===i.ref);} else if(T==='mtu'){const l=S.links.find(x=>x.id===i.ref);if(l)l.deg=remainUntil(x=>x.type==='mtu'&&x.ref===i.ref);} + else if(T==='ring'){if(S.pops[i.ref])S.pops[i.ref].ringcut=remainUntil(x=>x.type==='ring'&&x.ref===i.ref);} + else if(T==='site'){if(S.pops[i.ref])S.pops[i.ref].sdown=null;} else if(T==='ac'){if(S.pops[i.ref])S.pops[i.ref].hot=remainUntil(x=>x.type==='ac'&&x.ref===i.ref);} else if(T==='amp'||T==='roadmff'){const l=S.links.find(x=>x.id===i.ref);if(l)l.eqDown=remainUntil(x=>(x.type==='amp'||x.type==='roadmff')&&x.ref===i.ref);} else if(T==='optic'){const l=S.links.find(x=>x.id===i.ref);if(l&&!S.inc.some(x=>x.type==='optic'&&x.ref===i.ref))l.chFail=null;} @@ -1360,7 +1409,7 @@ function spawnOffer(){ if(t==='provedor')city=pick(br); if(t==='hft'){const fin=['nyc','chi','lon','fra','tok','sin','hkg','ams','ash'],mf=mine.filter(c=>fin.includes(c));city=mf.length?pick(mf):pick(mine);city2=pick(fin.filter(c=>c!==city));} const rate=T.l2?Math.round((150+kmBetween(city,city2)*0.08)*T.km):T.rate; - const reqs=T.div?['diverse']:T.lat?['lat']:[];const pool=Object.keys(REQS).filter(k=>!reqs.includes(k)&&!REQS[k].only&&(!REQS[k].l2||T.l2)&&(!REQS[k].ip||!T.l2)); + const reqs=T.div?['diverse']:T.lat?['lat']:[];if((t==='hyper'||t==='ai'||t==='gpu')&&Math.random()<0.4)reqs.push('metro');const pool=Object.keys(REQS).filter(k=>!reqs.includes(k)&&!REQS[k].only&&(!REQS[k].l2||T.l2)&&(!REQS[k].ip||!T.l2)); if(Math.random()<(T.lv>=3?0.65:0.3))reqs.push(pick(pool)); if(T.lv>=3&&Math.random()<0.35){const more=pool.filter(k=>!reqs.includes(k));if(more.length)reqs.push(pick(more));} const r2=Math.round(rate*(1+reqs.reduce((a,k)=>a+REQS[k].bonus,0))); @@ -1422,6 +1471,9 @@ const ACT={ dkWalk:()=>{const dk=dkState();dk.q=null;closeModal();toast('DE-KICKS will "circle back".
Expect an email titled "Quick question 🙂" within the hour.','');}, dkOptOut:({city,n})=>{const dk=dkState(),k='dk'+city+n;if(UI.confirm!==k){UI.confirm=k;renderPanel();return;}dk.add[city]=(dk.add[city]||[]).filter(x=>x.n!==n);UI.confirm=null;toast(`Opted out of ${esc(n)}.
It took four clicks, a survey and a "we're sad to see you go" page.`,'good');after();}, dkStay:({city})=>{const dk=dkState();dk.ret[city]=S.day+180;dk.retUsed[city]=true;UI.confirm=null;closeModal();toast(`40% off ${esc(ixName(city))} for 6 months.
Your account manager is relieved. Read the small print later.`,'good');after();}, + addSite:({city})=>{const p=S.pops[city];if(!p||p.site2)return;if(!spend(SITE2_COST))return;p.site2=true;p.site2Day=S.day;toast(`Second site live in ${CITY[city].name}.
${esc(siteName(city,'b'))} is joined to ${esc(siteName(city,'a'))} by your own metro ring. Move some uplinks there from the Transit and Peering tabs.`,'good');sfx('build');after();}, + rmSite:({city})=>{const p=S.pops[city];if(!p||!p.site2)return;if(UI.confirm!=='site'+city){UI.confirm='site'+city;renderPanel();return;}UI.confirm=null;p.site2=0;p.sdown=null;p.ringcut=0;for(const t of S.transit)if(t.city===city)t.site='a';for(const x of S.pni)if(x.city===city)x.site='a';if(S.ixSite)delete S.ixSite[city];after();}, + siteSet:({k,id,s})=>{if(s!=='a'&&s!=='b')return;if(k==='t'){const t=S.transit.find(x=>x.id===id);if(t)t.site=s;}else if(k==='p'){const x=S.pni.find(x=>x.id===id);if(x)x.site=s;}else if(k==='ix'&&S.ixp[id]!==undefined){S.ixSite=S.ixSite||{};S.ixSite[id]=s;}after();}, peer:({city,net})=>{const r=peerOk(net,'ix',city);if(!r.ok){toast(`${esc(NET[net].name)} declined.
${esc(r.why)}`,'bad');sfx('err');return;}S.peers[net+'@'+city]=true; toast(`${esc(NET[net].name)} accepted!
${NET[net].pol==='selective'?'They checked your PearingDB page and liked the traffic numbers.':'BGP session established.'}`,'good');sfx('build');after();}, unpeer:({city,net})=>{delete S.peers[net+'@'+city];after();}, @@ -1680,7 +1732,7 @@ function cityPanel(c){ for(const n of prov){const t=S.transit.find(x=>x.city===c&&x.net===n.id);const pr=n.price*S.priceMul*(t&&t.premium&&c==='hkg'?n.premium:1)*regionMult(c); h+=`
${logo(n)}
${esc(n.name)} ${TYPE_L[n.type]}
$${pr.toFixed(2)} per Gbps / month · billed on 95th percentile
`; if(t){const u=R.useT[t.id]||0,cap=lagCap(PORT[t.tier].g,t.n),tdown=t.down>S.day; - h+=`
${lagName(t.tier,t.n)}${tdown?' · OUTAGE':''}${fmtG(u)}
${prefCtl('t',t.id,t.pref)}${n.premium&&c==='hkg'?`
${btn(t.premium?'CN-Too premium on ✓':`Switch to CN-Too premium ${n.premium}× price · ~3% loss into China`,'togglePrem',{id:t.id},t.premium?'green sm':'sm')}
`:''}
95th pct ${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))}/mo
+ h+=`
${lagName(t.tier,t.n)}${tdown?' · OUTAGE':''}${fmtG(u)}
${prefCtl('t',t.id,t.pref)}${siteCtl('t',t.id,c,t.site)}${n.premium&&c==='hkg'?`
${btn(t.premium?'CN-Too premium on ✓':`Switch to CN-Too premium ${n.premium}× price · ~3% loss into China`,'togglePrem',{id:t.id},t.premium?'green sm':'sm')}
`:''}
95th pct ${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))}/mo
${PORT.map((P2,i)=>i>t.tier?btn(`Upgrade ${(t.n||1)>1?'all to ':''}${P2.n} ${fmt$(P2.setup*(t.n||1))} + ${fmt$(P2.tmo*(t.n||1))}/mo`,'buyTransit',{city:c,net:n.id,tier:i},'sm',S.cash${fmt$(PORT[t.tier].setup)} + ${fmt$(PORT[t.tier].tmo)}/mo`,'lagT',{id:t.id,d:1},'sm',S.cash1?btn('− member','lagT',{id:t.id,d:-1},'ghost sm'):''}${btn(UI.confirm===t.id?'Really cancel?':'Cancel','cancelTransit',{id:t.id},'ghost sm')}
`;} else h+=`
${PORT.map((P2,i)=>btn(`${P2.n} ${fmt$(P2.setup)} + ${fmt$(P2.tmo)}/mo`,'buyTransit',{city:c,net:n.id,tier:i},'sm',S.cash`; h+=`
`;} @@ -1692,7 +1744,7 @@ function cityPanel(c){ const here=NETS.filter(n=>n.pops.includes(c)); for(const n of here){const pn=S.pni.find(x=>x.city===c&&x.net===n.id),chk=peerOk(n.id,'pni',c); h+=`
${logo(n)}
${esc(n.name)} ${n.pol}
`; - if(pn){const u=R.usePni[pn.id]||0,cap=lagCap(PORT[pn.tier].g,pn.n);h+=`
${(pn.n||1)>1?`${pn.n}×${PORT[pn.tier].n} LAG`:PORT[pn.tier].n} PNI${fmtG(u)}
${prefCtl('p',pn.id,pn.pref)}
${PORT.map((P2,i)=>i>pn.tier?btn(`Upgrade ${(pn.n||1)>1?'all to ':''}${P2.n}`,'pni',{city:c,net:n.id,tier:i},'sm',!portOk(c,i)):'').join('')}${(pn.n||1)${fmt$(1500+PORT[pn.tier].setup/2)} + ${fmt$(PORT[pn.tier].pni)}/mo`,'lagP',{id:pn.id,d:1},'sm',S.cash<1500+PORT[pn.tier].setup/2):''}${(pn.n||1)>1?btn('− member','lagP',{id:pn.id,d:-1},'ghost sm'):''}${btn(UI.confirm===pn.id?'Really remove?':'Remove','cancelPni',{id:pn.id},'ghost sm')}
`;} + if(pn){const u=R.usePni[pn.id]||0,cap=lagCap(PORT[pn.tier].g,pn.n);h+=`
${(pn.n||1)>1?`${pn.n}×${PORT[pn.tier].n} LAG`:PORT[pn.tier].n} PNI${fmtG(u)}
${prefCtl('p',pn.id,pn.pref)}${siteCtl('p',pn.id,c,pn.site)}
${PORT.map((P2,i)=>i>pn.tier?btn(`Upgrade ${(pn.n||1)>1?'all to ':''}${P2.n}`,'pni',{city:c,net:n.id,tier:i},'sm',!portOk(c,i)):'').join('')}${(pn.n||1)${fmt$(1500+PORT[pn.tier].setup/2)} + ${fmt$(PORT[pn.tier].pni)}/mo`,'lagP',{id:pn.id,d:1},'sm',S.cash<1500+PORT[pn.tier].setup/2):''}${(pn.n||1)>1?btn('− member','lagP',{id:pn.id,d:-1},'ghost sm'):''}${btn(UI.confirm===pn.id?'Really remove?':'Remove','cancelPni',{id:pn.id},'ghost sm')}
`;} else{h+=chk.ok?`
${PORT.map((P2,i)=>btn(`${P2.n} ${fmt$(1500+P2.setup/2)}`,'pni',{city:c,net:n.id,tier:i},'sm',S.cash<1500+P2.setup/2||!portOk(c,i))).join('')}
${chk.fee?`
Paid peering: ${fmt$(chk.fee)}/mo on top
`:''}`:`
${esc(chk.why)}
`;} h+=`
`;} h+=`

Embedded caches

CDNs put free cache servers inside your POP. Most of their traffic is then served right here, with no transit and no IX port.

`; @@ -1711,6 +1763,10 @@ function cityPanel(c){
${N?btn(N.lvl>lvl()?`${esc(N.n)} level ${N.lvl}`:`Upgrade to ${esc(N.n)} ${fmt$(N.cost*rt)} + ${fmt$(N.mo*rt)}/mo`,'upRouter',{city:c},'pink',N.lvl>lvl()||S.cash${fmt$(routerCost(g))} + ${fmt$(ROUTER_MO+G.mo)}/mo`,'addRouter',{city:c},'',S.cash1?btn('Remove one','rmRouter',{city:c},'ghost sm'):''}
${N?`

${rt>1?'Rolling upgrade: one router at a time, no downtime.':'With one router, the upgrade needs a maintenance window: this POP goes dark for a day.'}

`:''}

${rt>=2?'A crash here only costs one router’s capacity for a few days.':'One router is a single point of failure.'}

+

Metro diversity

${p.site2?(()=>{const up=s=>[...S.transit.filter(t=>t.city===c&&(t.site||'a')===s).map(t=>NET[t.net].name+' transit'),...S.pni.filter(x=>x.city===c&&(x.site||'a')===s).map(x=>'PNI '+NET[x.net].name),...(S.ixp[c]!==undefined&&((S.ixSite||{})[c]||'a')===s?[ixName(c)+' port']:[]),...(s==='a'?S.caches.filter(x=>x.city===c).map(x=>NET[x.net].cache.name):[])]; + const row=s=>{const dn=siteDown(c,s),u=up(s);return `
${esc(siteName(c,s))}${dn?' DOWN':''}
${u.length?esc(u.join(', ')):'Nothing plugged in here yet'}
`;}; + return `

Two buildings joined by your own metro ring. A power cut or cleaner in one leaves the other running at half capacity. Uplinks only work while their site is up.

${row('a')}${row('b')}${up('b').length&&up('a').length?'':`

Everything is in one building. Move some uplinks to the other site from the Transit and Peering tabs.

`}
Second site and metro ring${fmt$(SITE2_MO)}/mo
${btn(UI.confirm==='site'+c?'Really close it?':'Close site B','rmSite',{city:c},'ghost sm')}
`;})() + :`

Right now ${esc(CITY[c].name)} is one building. A power cut, an A/C failure or a cleaner with a vacuum takes the whole city dark, and a second router does not help with that. A second data center across town, joined by your own metro ring, keeps half the POP up.

${btn(`Add a second site ${fmt$(SITE2_COST)} + ${fmt$(SITE2_MO)}/mo`,'addSite',{city:c},'pink',S.cash`}

Power

Backup generator${p.gen?'Installed':'None'}
${p.gen?'

Power cuts are covered.

':`
${btn(`Install generator ${fmt$(GEN_COST)} + ${fmt$(GEN_MO)}/mo`,'addGen',{city:c},'',S.cash`}
`; h+=`

DDoS scrubbing center

${S.scrubAt===c?`

Online here. Attack traffic anywhere on your network is cleaned before it hurts, and you can sell DDoS protection to businesses.

${btn(UI.confirm==='scrub'?'Really shut it down?':'Shut down','scrub',{city:c},'ghost sm')}`:S.scrubAt?`

You already run one in ${CITY[S.scrubAt].name}.

`:`

Absorbs DDoS attacks for your whole network and unlocks DDoS protection contracts for businesses.

${btn(`Build scrubbing center ${fmt$(SCRUB_COST)} + ${fmt$(SCRUB_MO)}/mo`,'scrub',{city:c},'',S.cash`; const fabs=FABS.filter(f=>f.cities.includes(c)); @@ -1735,7 +1791,7 @@ function ixSection(c){const C=CITY[c],ix=ixName(c);let h=''; else if(!ix){h+=`

There's no IX in ${C.name} yet. Found one: networks join over time, pay you for ports, and peer with you for free.

${S.pops[c]?btn(`Found your own IX ${fmt$(MYIX_COST)} + ${fmt$(MYIX_MO)}/mo`,'foundIx',{city:c},'pink',S.cashBuild a POP here first.

'}`;} else if(S.ixp[c]===undefined){h+=`

${esc(ix)} is a shared switch. One port lets you peer with every member for free. Members: ${ixMembers(c).map(id=>esc(NET[id].name)).join(', ')||'nobody yet'}.

${S.pops[c]?'':REMOTE_WARN}${CITY[c].ixCheap?`

Run by a nonprofit. Public prices at a fraction of what other exchanges charge, and almost everyone is here.

`:''}${isDk(c)?`

Run by DE-KICKS Group. No public price list. Ask sales for a personalised quote and bring your haggling face.

`:''}
${PORT.map((P2,i)=>btn(`${P2.n} port ${isDk(c)?'Price on request ☎':fmt$(ixPortMo(c,i))+'/mo'}`,'buyIx',{city:c,tier:i},'',(!isDk(c)&&S.cash1))).join('')}
`;} else{const mine=!!S.myIx[c],u=R.useIx[c]||0,cap=ixCap(c),set=ixSessions(c),xdown=S.ev.ixdown&&S.ev.ixdown[c]>S.day; - h+=`
${mine?'Your own fabric · 400G':lagName(S.ixp[c],(S.ixn||{})[c])}${xdown?' · FABRIC DOWN':''}${fmtG(u)}
${prefCtl('ix',c,S.ixPref&&S.ixPref[c])}`; + h+=`
${mine?'Your own fabric · 400G':lagName(S.ixp[c],(S.ixn||{})[c])}${xdown?' · FABRIC DOWN':''}${fmtG(u)}
${prefCtl('ix',c,S.ixPref&&S.ixPref[c])}${S.pops[c]?siteCtl('ix',c,c,(S.ixSite||{})[c]):''}`; if(isDk(c)&&S.dk){const ad=S.dk.add[c]||[],rt=S.dk.ret[c];h+=`

DE-KICKS personalised pricing: ${Math.round(dkMult(c)*100)}% of what a normal IX would charge${rt&&rt>S.day?` (promo, ${rt-S.day} days left)`:''}.

`; for(const x of ad)h+=`
${esc(x.n)}
${esc(x.blurb)} · ${fmt$(x.mo)}/mo
${btn(UI.confirm==='dk'+c+x.n?'Lose exclusive benefits?':'Opt out','dkOptOut',{city:c,n:x.n},'ghost sm')}
`;} if(isRemote(c))h+=`

Remote port via a reseller: 1.5× price, 80% usable, and ${ixMembers(c).filter(noRemote).length} member${ixMembers(c).filter(noRemote).length===1?'':'s'} here refuse remote peers.

`; @@ -1940,7 +1996,7 @@ function showHelp(){
Embedded cache
A CDN's server in your rack. Serves most of that CDN's traffic locally, for the price of power.
DE-KICKS
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.
Remote peering
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.
Peering policy
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.
Waves
Your fiber links are leased waves at a flat monthly rate. Longer and bigger costs more (10G → 6.4T), and subsea is 1.8× the price.
95th percentile
Transit bills sample your usage every day and charge the 95th percentile of the last 30 days, so short spikes are forgiven but long ones are not.
Routers
Each POP's router model caps its fastest port (100G, 400G, 800G, 1.6T) and how much it can forward. Bigger waves and ports need better routers at both ends. Better models unlock with your customer level. With one router, upgrades mean a day of downtime.
Dark fiber
Lease an IRU or build your own (slow, with delays), then buy a line system with amplifiers and light channels with 400ZR+, 800ZR+ or 1.6T transponders. Much cheaper than waves at scale, but the gear can fail. A spares kit speeds up repairs.
Subsea cables
Subsea waves can only follow real-ish cable systems, drawn faintly on the map (tap a city to highlight its cables). Teal ones are new and cheap, purple ones pricey, dashed ones old and cut-prone. All your waves on one cable die together when it is cut. Between continents on land, you can often choose overland (2.5×, many borders) or a cable.
Latency
Every link has latency. High-frequency traders pay a fortune for a circuit within their latency budget; route them “Lowest latency”. Bulk backup customers do not care, so route them “Scenic” over your quiet links to keep busy ones free.
NOC dashboard
The chart button at the top opens traffic graphs by exit (caches, PNIs, IX, transit), money over time, per-ASN traffic with how it reaches you and what its transit costs, plus your busiest links and routers.
Asia
A weird, underserved market. Transit costs 2.5× what it does in Europe (Africa 2×, Oceania 1.8×), local incumbents mostly peer only for pay, and IXs are fragmented. But demand is enormous and users sign up 60% faster than anywhere else. Peering and caches pay off most here.
Russia
Moscow needs a mandatory government box in every POP, Western CDNs are mostly gone, Goggle video is throttled to half speed, and the sovereign internet drills now and then cut Moscow off for a day.
Events, chains and wholesale
Event networks (a final, a festival, a keynote) need a burst of capacity in one city for a few days and pay once at the end, prorated by how much of the crowd you served; below 70% you pay a penalty. SD-WAN chains connect 3–6 of your POPs hub-and-spoke, so one broken spoke upsets the whole contract. Once you run your own dark fiber, carriers want to rent spare channels as alien waves, and on fiber you built yourself, a spare pair.
Bank
Tap your cash to open the bank. Lenders make offers now and then, and much more often when you are in the red. Each loan has a monthly payment and some odd conditions; break one and you pay a penalty. Your credit rating decides which banks talk to you. The loan shark is always there. Do not be late.
LAGs
Out of port speed? Bundle up to 8 identical ports to the same transit provider, IX or PNI into a LAG. Each member costs a full port; flow hashing is never perfectly even, so a bundle carries about 95% of the sum.
Traffic engineering
Tap a link to see which networks, which entry points and which customer cities fill it. Raise a link's metric to steer traffic around it, or set an egress (transit, IX, PNI) to Prefer or Backup only.
China
Mainland China needs a license and a local joint venture. Many foreign services are blocked there, and traffic crossing the border loses packets unless you pay for premium routes.
Weird requirements
Some customers come with conditions: no Cogentle anywhere, no subsea cables because of sharks, two routers, a generator, NetChill on-net, low-loss China reach and more. Each pays a bonus. Unmet ones make them grumpy until you fix it or they leave.
Customer levels
As your peak traffic and footprint grow, bigger customers show up: streaming startups and universities, then AI GPU data centers and cloud on-ramps, then AI training interconnects and hyperscaler DCI deals measured in terabits. Pink $$ bubbles mark the big ones.
L2VPN & DDoS protection
Businesses may want a private circuit between two of your POPs (it rides your backbone), or DDoS protection (needs your own scrubbing center).
NNI fabrics
Megapork, PocketFabric and Consolation Connect sell a port plus virtual circuits between cities. Great for small links and remote peering at an IX where you have no POP.
-
Regional quirks
South America hangs off Miami: transit is pricier, nothing crosses the Darién Gap by land, and fiber over the Andes costs double and breaks often. IX.brrr in Brazil is run by a nonprofit with cheap public prices, and small Brazilian provedores buy transit in bulk. Inside the UAE only the duopoly may run fiber, so no dark fiber and 3× waves. Taiwan’s cables meet a lot of anchors, Indian fiber meets road widening and the monsoon, and South Africa has load shedding: bring a generator.
Boot times
Some routers take forever to boot. The Infra tab shows how long yours takes. Slow booters make crashes last longer and turn a one-router swap into a three-day outage. Bigger chassis, especially anything with a PacketOinker™ inside, are slow more often. Twin routers make it someone else’s problem.
Failures
Things break all the time: fiber cuts, router crashes, power cuts, IX loops, fabric outages, route leaks, DDoS, fat fingers, cooling failures, and geopolitics: sanctions, tariffs, BGP hijacks, landing permit disputes, exam-day shutdowns and Red Sea cable cuts. Traffic reroutes automatically over other paths and upstreams. Parallel links on diverse routes, a second router and a backup generator all help. Or pay to rush repairs.
+
Metro diversity
A POP is one building until you add a second site in the Infra tab. Then a power cut, cleaner or A/C failure only takes out half the city, and you choose which site each transit, PNI and IX port plugs into. Spread them out, or both halves of your redundancy will sit in the same dark room. Watch out for metro ring cuts, which cut site B off.
Regional quirks
South America hangs off Miami: transit is pricier, nothing crosses the Darién Gap by land, and fiber over the Andes costs double and breaks often. IX.brrr in Brazil is run by a nonprofit with cheap public prices, and small Brazilian provedores buy transit in bulk. Inside the UAE only the duopoly may run fiber, so no dark fiber and 3× waves. Taiwan’s cables meet a lot of anchors, Indian fiber meets road widening and the monsoon, and South Africa has load shedding: bring a generator.
Boot times
Some routers take forever to boot. The Infra tab shows how long yours takes. Slow booters make crashes last longer and turn a one-router swap into a three-day outage. Bigger chassis, especially anything with a PacketOinker™ inside, are slow more often. Twin routers make it someone else’s problem.
Failures
Things break all the time: fiber cuts, router crashes, power cuts, IX loops, fabric outages, route leaks, DDoS, fat fingers, cooling failures, and geopolitics: sanctions, tariffs, BGP hijacks, landing permit disputes, exam-day shutdowns and Red Sea cable cuts. Traffic reroutes automatically over other paths and upstreams. Parallel links on diverse routes, a second router and a backup generator all help. Or pay to rush repairs.
${btn(UI.started?'Back to the map':'Got it','helpClose',{},'big')}${RELEASE_NOTES.length?btn(`What’s new in ${esc(APP_VERSION)}`,'whatsNewShow',{},'ghost'):''}${UI.started&&S&&!S.lost?btn('Start a new network','resetAsk',{},'ghost sm'):''}
${UI.started&&S&&!S.lost?btn('Export save','exportSave',{},'ghost sm'):''}${btn('Import a save','importPick',{},'ghost sm')}
`); } function showWin(){openModal(`

You're a Tier 1!

${esc(S.name)} (AS${S.asn}) is transit-free. You peer with every giant on the planet and pay nobody to reach the internet. Took you ${S.day} days and ${S.stats.incidents} incidents.

${btn('Keep building','keepPlaying',{},'pink big')}`);sfx('coin');} diff --git a/tests/regions.test.js b/tests/regions.test.js index cbaf851..67d2fce 100644 --- a/tests/regions.test.js +++ b/tests/regions.test.js @@ -88,3 +88,36 @@ test('every new city panel renders', () => { } assert.deepEqual(errors, []); }); + +test('Asia-Pacific and Eastern Europe POPs exist with sellers', () => { + const { ev } = load(); + start(ev); + for (const c of ['mel', 'bne', 'drw', 'osa', 'kul', 'bkk', 'sgn', 'khi', 'dac', 'cbo', 'waw', 'prg', 'vie', 'bud', 'buh', 'tll', 'ist']) + assert.ok(ev(`!!CITY['${c}']&&NETS.some(n=>n.price&&n.pops.includes('${c}'))`), c); + assert.ok(ev("CABLE_PAIRS.some(p=>p.cid==='balt')&&CABLE_PAIRS.some(p=>p.cid==='darwin')&&CABLE_PAIRS.some(p=>p.cid==='smw4')")); +}); + +test('metro diversity: a second site keeps half the POP up and uplinks follow their site', () => { + const { ev, errors } = load(); + start(ev); + ev("ACT.launchBB({city:'fra'});ACT.buyTransit({city:'fra',net:'cog',tier:1});ACT.buyTransit({city:'fra',net:'lvl',tier:1});compute()"); + const cap0 = ev("nodeCap('fra')"); + ev("ACT.addSite({city:'fra'})"); + assert.ok(ev("S.pops.fra.site2")); + ev("ACT.siteSet({k:'t',id:S.transit[1].id,s:'b'})"); + assert.equal(ev("S.transit[1].site"), 'b'); + // a power cut in site A: the POP stays up at half capacity, only site-B transit works + ev("S.pops.fra.sdown={until:S.day+3,s:'a'};compute()"); + assert.equal(ev("popUp('fra')"), true); + assert.equal(ev("nodeCap('fra')"), cap0 / 2); + assert.equal(ev("R.useT[S.transit[0].id]||0"), 0, 'site A transit is dark'); + assert.ok(ev("R.useT[S.transit[1].id]") > 0, 'site B transit carries traffic'); + // the incident path also uses the second site + ev("S.pops.fra.sdown=null;S.pops.fra.gen=false;for(let i=0;i<500&&!S.inc.some(x=>x.type==='site'||x.type==='ring');i++){fireFailure();S.inc=S.inc.filter(x=>x.type==='site'||x.type==='ring');for(const c in S.pops)S.pops[c].down=0;}"); + assert.ok(ev("S.inc.some(x=>x.type==='site'||x.type==='ring')"), 'site outages and ring cuts happen'); + ev("selectCity('fra');ACT.tab({t:'infra'})"); + assert.match(ev("document.getElementById('panelBody').textContent"), /Metro diversity/); + ev("selectCity('fra');ACT.tab({t:'up'})"); + assert.match(ev("document.getElementById('panelBody').textContent"), /Site:/); + assert.deepEqual(errors, []); +});