Every capital in Europe: Tirana to Ljubljana, Malta and Cyprus on their cables, and Bern
Sixteen capitals and Bern. National telcos with their real ASNs (One Albania, Andorra Telecom, Beltelecom, BH Telecom, Hrvatski Telekom, Cyta, Cablenet, FL1, Hoi, Telia Lietuva, Bite, GO, Melita, Moldtelecom, Monaco Telecom, Crnogorski Telekom, Slovak Telekom, Telekom Slovenije, Telenet San Marino), and the groups already in the game take the countries they really run (A1, Orange, Vodafone, Telekom Srbija, Magyar Telekom, TIM). Andorra and Monaco have one operator each (W2), San Marino buys its transit in Italy (W3). Malta and Cyprus are islands on PEACE, MedNautilus, Blue and Malta's own lines to Sicily; Malta's coastline from Natural Earth. Exchanges only where PeeringDB has one with members. The capitals test covers Europe's 44.
This commit is contained in:
parent
c5c0d853ae
commit
296392fb96
18 changed files with 306 additions and 21 deletions
|
|
@ -1,13 +1,15 @@
|
|||
// Every UN member's capital is a city on the map (Vatican City is served from Rome, five kilometres away). Each region's
|
||||
// list grows as its capitals arrive; a capital is there when a city of that country sits within 25 km of it.
|
||||
// list grows as its capitals arrive; a capital is there when a city of that country sits within 25 km of it, or carries
|
||||
// its name (Tallinn is drawn south of its real spot so it does not sit on Helsinki).
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
|
||||
const { ev } = load();
|
||||
const cities = JSON.parse(ev('JSON.stringify(CITIES.filter(c=>!c.off).map(c=>({id:c.id,cc:c.cc,ll:[c.lon,c.lat],capital:!!c.capital})))'));
|
||||
const cities = JSON.parse(ev('JSON.stringify(CITIES.filter(c=>!c.off).map(c=>({id:c.id,name:c.name,cc:c.cc,ll:[c.lon,c.lat],capital:!!c.capital})))'));
|
||||
const R = Math.PI / 180, km = (a, b) => 6371 * Math.acos(Math.min(1, Math.sin(a[1] * R) * Math.sin(b[1] * R) + Math.cos(a[1] * R) * Math.cos(b[1] * R) * Math.cos((a[0] - b[0]) * R)));
|
||||
const missing = (caps) => Object.entries(caps).filter(([k, ll]) => !cities.some((c) => c.cc === k.slice(0, 2) && km(c.ll, ll) < 25)).map(([k]) => k);
|
||||
const at = (k, ll) => cities.find((c) => c.cc === k.slice(0, 2) && (km(c.ll, ll) < 25 || c.name === k.slice(3)));
|
||||
const missing = (caps) => Object.entries(caps).filter(([k, ll]) => !at(k, ll)).map(([k]) => k);
|
||||
|
||||
const AMERICAS = {
|
||||
'AG Saint John\'s': [-61.85, 17.12], 'BS Nassau': [-77.35, 25.05], 'BB Bridgetown': [-59.62, 13.10], 'BZ Belmopan': [-88.77, 17.25], 'BO Sucre': [-65.26, -19.03],
|
||||
|
|
@ -20,13 +22,33 @@ const AMERICAS = {
|
|||
'AR Buenos Aires': [-58.38, -34.60],
|
||||
};
|
||||
|
||||
const EUROPE = {
|
||||
'AL Tirana': [19.82, 41.33], 'AD Andorra la Vella': [1.52, 42.51], 'AT Vienna': [16.37, 48.21], 'BY Minsk': [27.56, 53.90], 'BE Brussels': [4.35, 50.85],
|
||||
'BA Sarajevo': [18.41, 43.86], 'BG Sofia': [23.32, 42.70], 'HR Zagreb': [15.98, 45.81], 'CY Nicosia': [33.38, 35.19], 'CZ Prague': [14.44, 50.08],
|
||||
'DK Copenhagen': [12.57, 55.68], 'EE Tallinn': [24.75, 59.44], 'FI Helsinki': [24.94, 60.17], 'FR Paris': [2.35, 48.86], 'DE Berlin': [13.40, 52.52],
|
||||
'GR Athens': [23.73, 37.98], 'HU Budapest': [19.04, 47.50], 'IS Reykjavik': [-21.94, 64.15], 'IE Dublin': [-6.26, 53.35], 'IT Rome': [12.50, 41.90],
|
||||
'LV Riga': [24.11, 56.95], 'LI Vaduz': [9.52, 47.14], 'LT Vilnius': [25.28, 54.69], 'LU Luxembourg': [6.13, 49.61], 'MT Valletta': [14.51, 35.90],
|
||||
'MD Chișinău': [28.86, 47.01], 'MC Monaco': [7.42, 43.74], 'ME Podgorica': [19.26, 42.44], 'NL Amsterdam': [4.90, 52.37], 'MK Skopje': [21.43, 41.99],
|
||||
'NO Oslo': [10.75, 59.91], 'PL Warsaw': [21.01, 52.23], 'PT Lisbon': [-9.14, 38.72], 'RO Bucharest': [26.10, 44.43], 'RU Moscow': [37.62, 55.76],
|
||||
'SM San Marino': [12.45, 43.94], 'RS Belgrade': [20.46, 44.79], 'SK Bratislava': [17.11, 48.15], 'SI Ljubljana': [14.51, 46.06], 'ES Madrid': [-3.70, 40.42],
|
||||
'SE Stockholm': [18.07, 59.33], 'CH Bern': [7.45, 46.95], 'UA Kyiv': [30.52, 50.45], 'GB London': [-0.13, 51.51],
|
||||
};
|
||||
|
||||
test('every capital of Europe is a city', () => {
|
||||
assert.equal(Object.keys(EUROPE).length, 44, 'the 44 UN members in Europe (Turkey is with the Middle East)');
|
||||
assert.deepEqual(missing(EUROPE), []);
|
||||
// the islands land their real cables, and the group networks really serve the new countries
|
||||
for (const c of ['mla', 'nic']) assert.ok(ev(`CABLE_PAIRS.some(p=>p.cid==='peace'&&(p.a==='${c}'||p.b==='${c}'))`), `${c} on PEACE`);
|
||||
for (const [n, cc] of [['aat', 'HR'], ['tng', 'MD'], ['mts', 'BA'], ['mgt', 'MK'], ['vdp', 'AL'], ['tim', 'SM']]) assert.ok(ev(`[].concat(NET.${n}.cc).includes('${cc}')`), `${n} serves ${cc}`);
|
||||
});
|
||||
|
||||
test('every capital of the Americas is a city', () => {
|
||||
assert.equal(Object.keys(AMERICAS).length, 35, 'the 35 UN members of the Americas');
|
||||
assert.deepEqual(missing(AMERICAS), []);
|
||||
});
|
||||
|
||||
test('capitals are flagged, so the density rule lets small ones sit near a big city', () => {
|
||||
const unflagged = Object.entries(AMERICAS).map(([k, ll]) => cities.find((c) => c.cc === k.slice(0, 2) && km(c.ll, ll) < 25))
|
||||
const unflagged = Object.entries(AMERICAS).map(([k, ll]) => at(k, ll))
|
||||
.filter((c) => c && !['BS', 'BB', 'BR', 'CA', 'CL', 'CO', 'CR', 'CU', 'DO', 'EC', 'GT', 'JM', 'MX', 'PA', 'PY', 'PE', 'TT', 'US', 'UY', 'VE', 'AR'].includes(c.cc)).filter((c) => !c.capital).map((c) => c.id);
|
||||
assert.deepEqual(unflagged, []);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,9 +11,11 @@ const { load } = require('./harness');
|
|||
const EXCEPTIONS = {
|
||||
// W2: countries with fewer than two consumer networks of their own, because real life has fewer.
|
||||
W2: {
|
||||
AD: 'Andorra Telecom is by law the only telecom operator',
|
||||
CU: 'Cuba has one state operator (ETECSA); Cubacel is its own mobile brand',
|
||||
DJ: 'Djibouti Telecom is the monopoly for homes and phones',
|
||||
GL: 'Greenland has one operator (Tusass), for homes, phones and the cables',
|
||||
MC: "Monaco Telecom is the principality's only fixed and mobile operator",
|
||||
MH: 'the Marshall Islands have one telco (NTA)',
|
||||
PN: 'Pitcairn has no network at all: land your own cable (#124)',
|
||||
SH: 'St Helena has one operator (Sure South Atlantic)',
|
||||
|
|
@ -23,6 +25,7 @@ const EXCEPTIONS = {
|
|||
ivc: 'Invercargill waits for its AI campus; nobody sells transit there yet',
|
||||
pcn: 'Pitcairn: no cable, no network, land your own (#124)',
|
||||
prr: 'Prince Rupert is a remote town with no carrier in it',
|
||||
smr: 'San Marino buys its transit from Italian carriers in Bologna and Rimini; nobody sells it in the town',
|
||||
sre: "Sucre has no exchange or carrier facility: Bolivia's transit is bought in La Paz",
|
||||
stg: 'Stuttgart is the Only Spätzle-IX scenario city: peering only, by design (#114)',
|
||||
yfb: 'Iqaluit has no fiber, only satellite: land your own cable (the real plan runs from Nuuk)',
|
||||
|
|
@ -96,11 +99,11 @@ const REAL_NAMES = [
|
|||
// content and clouds
|
||||
'Akamai', 'Alibaba Cloud', 'Amazon', 'Amazon Web Services', 'AWS', 'Baidu', 'ByteDance', 'Cloudflare', 'Facebook', 'Fastly', 'Google', 'Mercado Libre', 'Meta', 'Microsoft', 'Netflix', 'Tencent', 'TikTok', 'VK', 'VKontakte', 'Yandex',
|
||||
// eyeballs and incumbents
|
||||
', ', 'A1', 'A1 Telekom Austria', 'Airtel', 'AIS', 'Algérie Télécom', 'Altibox', 'Altice', 'America Movil', 'Angola Cables', 'Antel', 'ASTCA', 'Aussie Broadband', 'Belize Telemedia', 'Bell', 'Bell Canada', 'Belong', 'Bemobile', 'Brisanet', 'BT', 'BTC', 'Cable & Wireless', 'Cable Bahamas', 'Guyana Telephone & Telegraph', 'L", ', 'Natcom', 'SMART', 'Speednet', 'Telesur',
|
||||
', ', 'A1', 'A1 Telekom Austria', 'Airtel', 'AIS', 'Algérie Télécom', 'Altibox', 'Altice', 'America Movil', 'Andorra Telecom', 'Angola Cables', 'Antel', 'ASTCA', 'Aussie Broadband', 'Belize Telemedia', 'Bell', 'Bell Canada', 'Belong', 'Beltelecom', 'Bemobile', 'BH Telecom', 'Bitė', 'Brisanet', 'BT', 'BTC', 'Cable & Wireless', 'Cable Bahamas', 'Cablenet', 'Crnogorski Telekom', 'Cyta', 'FL1', 'GO', 'Guyana Telephone & Telegraph', 'Hoi Internet', 'Hrvatski Telekom', 'L", ', 'Melita', 'Moldtelecom', 'Monaco Telecom', 'Natcom', 'One Albania', 'Slovak Telekom', 'SMART', 'Speednet', 'Telecom Liechtenstein', 'Telekom Slovenije', 'Telenet San Marino', 'Telesur', 'Telia Lietuva',
|
||||
// exchanges and data centers
|
||||
'AMS-IX', 'Any2', 'BCIX', 'CoreSite', 'DANIX', 'DE-CIX', 'DigiCo', 'Digital Realty', 'Equinix', 'France-IX', 'GREX', 'HIX', 'Interxion', 'iseek', 'IX.br', 'IXP-HN', 'JPIX', 'LINX', 'NAPAfrica', 'NetIX', 'NEXTDC', 'NIX', 'NL-ix', 'SIX', 'SKNIX', 'SUR-IX', 'SVGIX', 'Telehouse',
|
||||
'AMS-IX', 'ANIX', 'Any2', 'BALT-IX', 'BCIX', 'BHNIX', 'BY-IX', 'CIX', 'CoreSite', 'CyIX', 'DANIX', 'DE-CIX', 'DigiCo', 'Digital Realty', 'Equinix', 'France-IX', 'GREX', 'HIX', 'Interxion', 'iseek', 'IX.br', 'IXP-HN', 'IXP.mk', 'JPIX', 'KIVIX', 'LINX', 'MD-IX', 'MIXP', 'NAPAfrica', 'NetIX', 'NEXTDC', 'NIX', 'NIX.SK', 'NL-ix', 'SIX', 'SIX.SK', 'SKNIX', 'SUR-IX', 'SVGIX', 'Telehouse',
|
||||
// cables
|
||||
'2Africa', 'Amitié', 'BDSNi', 'CARCIP', 'Darwin-Jakarta-Singapore Cable', 'Deep Blue One', 'Dunant', 'Eastern Caribbean Fiber System', 'EllaLink', 'Equiano', 'Fibralink', 'Grace Hopper', 'Greenland Connect', 'Greenland Connect North', 'Hibernia Express', 'Jupiter', 'MAREA', 'North West Cable System', 'PEACE', 'SEA-ME-WE 6', 'SG-SCS', 'Southern Caribbean Fiber', 'X-Link',
|
||||
'2Africa', 'Amitié', 'BDSNi', 'CARCIP', 'Darwin-Jakarta-Singapore Cable', 'Deep Blue One', 'Dunant', 'Eastern Caribbean Fiber System', 'EllaLink', 'Epic Malta-Sicily Cable System', 'Equiano', 'Fibralink', 'GO-1', 'Grace Hopper', 'Greenland Connect', 'Greenland Connect North', 'Hibernia Express', 'Jupiter', 'MAREA', 'MedNautilus', 'Melita 1', 'North West Cable System', 'PEACE', 'SEA-ME-WE 6', 'SG-SCS', 'Southern Caribbean Fiber', 'X-Link',
|
||||
// cable ships, their operators and maintenance clubs
|
||||
'ACMA', 'ASEAN Explorer', 'ASEAN Protector', 'ASEAN Restorer', 'Cable Innovator', 'Cable Retriever', 'Global Marine', 'Léon Thévenin', 'MECMA', 'Orange Marine', 'Pierre de Fermat', 'René Descartes', 'SEAIOCMA', 'Sophie Germain', 'Sovereign', 'Wave Sentinel', 'Yokohama Zone',
|
||||
// vendors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue