Merge #153: Overhaul the DDOS Attack system (FHRNet)
This commit is contained in:
commit
624f12bfd4
28 changed files with 901 additions and 159 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -12,6 +12,16 @@ All notable changes to this project are documented here. The project follows
|
|||
- Check a selected link’s redundancy against current demand: see disconnected endpoints, additional service loss and full fallback links without changing the live network.
|
||||
- Links can now use a custom routing metric, set either as a multiplier or as an exact cost. Pick Custom under Routing metric to fine-tune where your traffic goes; it explains how a link's cost is worked out and what each preset comes to on that link.
|
||||
- Prices now follow how connected each city really is, based on PeeringDB and Hurricane Electric data. Transit costs up to 1.8× more in cities where few networks are present, a POP costs 1.25× to 1.5× where there is little or no carrier-neutral data center, and countries with thousands of networks, like Brazil and the US, bring more ISP customers. Big hubs such as Frankfurt, Amsterdam, New York and São Paulo keep their prices.
|
||||
- Attacks are more varied: sizes, lengths and ingress ports change from one attack to the next, and several can hit at once. Hosting game servers or cloud gaming makes attacks more frequent, as it does in real life.
|
||||
- The link traffic breakdown now shows the correct source city for scrubbing traffic. Cities using the same center no longer overwrite each other's labels.
|
||||
- Live attacks now show one scrubbing detour from the attacked city to its nearest active scrubbing center, using the links' one-way latency.
|
||||
- Game server and cloud gaming customers now carry a “Gaming attracts attacks” note on their offers and customer lists, so you can see the DDoS risk before signing them.
|
||||
- Live attacks now show how much traffic Flowspec actually drops at the ingress routers. Routers without TCAM no longer claim to filter attacks, mixed router capabilities are called out, and Flowspec drops are counted separately from other edge filters.
|
||||
- Hosting game servers or cloud gaming brings RackNet and TeamSpooked attacks. Both bypass Flowspec and require dedicated mitigation.
|
||||
- Flood Season keeps sending ever larger attacks when you keep playing after winning or running out of time. Finishing the challenge no longer switches the floods off.
|
||||
- Each live attack in the NOC now shows incoming bandwidth, upstream scrubbing, edge filtering, scrubbing-center use and any traffic still leaking through.
|
||||
- DDoS bandwidth now adds up: upstream scrubbing, edge filters and scrubbing centers work in sequence. The NOC uses the same figures as traffic routing, including floods that cannot reach a remote center.
|
||||
- Attacks can now use Memcached amplification or an ACK flood. Flowspec catches the former; the latter need mitigation.
|
||||
|
||||
## [1.36.0] — 2026-10-28
|
||||
|
||||
|
|
|
|||
|
|
@ -780,6 +780,7 @@
|
|||
"common.95th_percentile":"95. Perzentil",
|
||||
"common.about_average":"etwa durchschnittlich",
|
||||
"common.accept":"Annehmen",
|
||||
"common.ack_flood":"ACK-Flood",
|
||||
"common.ad_campaign":"Werbekampagne!",
|
||||
"common.africa":"Afrika",
|
||||
"common.all_cities":"Alle Städte",
|
||||
|
|
@ -903,6 +904,7 @@
|
|||
"common.demand":"Nachfrage",
|
||||
"common.deploy":"Deployen",
|
||||
"common.deployed":"deployt",
|
||||
"common.distributed_ingress":"Verteilter Eingang",
|
||||
"common.diverse":"redundant",
|
||||
"common.diverse_route":"redundante Route",
|
||||
"common.dns_reflection":"DNS-Reflection",
|
||||
|
|
@ -1060,6 +1062,7 @@
|
|||
"common.may":"Mai",
|
||||
"common.member":"− Mitglied",
|
||||
"common.member_fef5":"Mitglied",
|
||||
"common.memcached_amplification":"Memcached-Amplification",
|
||||
"common.merchant_silicon":"Merchant Silicon",
|
||||
"common.mercury":"Merkur",
|
||||
"common.metaverse_platform":"Metaverse-Plattform",
|
||||
|
|
@ -1162,6 +1165,7 @@
|
|||
"common.price_lock":"Preisbindung",
|
||||
"common.price_mo":"{price}/Monat",
|
||||
"common.provisioning_n_d_grace":"in Bereitstellung, {n} T. Schonfrist",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Rang",
|
||||
"common.rare":"Selten",
|
||||
"common.reach":"Reichweite",
|
||||
|
|
@ -1276,6 +1280,7 @@
|
|||
"common.subsea_cables":"Seekabel",
|
||||
"common.supply_chain":"Lieferkette",
|
||||
"common.syn_flood":"SYN-Flood",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestrisch",
|
||||
"common.terrestrial_19e4":"Terrestrisch",
|
||||
"common.terrestrial_fiber":"Terrestrische Glasfaser",
|
||||
|
|
@ -1407,6 +1412,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>Du brauchst zuerst einen POP in jeder Stadt aus dem Vertrag.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} extra für {d} Tage, {when} · zahlt {fee}, wenn es vorbei ist",
|
||||
"customers_and_events.day_n_of_d":"Tag {n} von {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"Gaming zieht Angriffe an",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} Faserpaare in deinem Graben {a}–{b}. Das Graben war der teure Teil, also wollen sie alles",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} Standorte: {list} · {bw} pro Standort · {price}/Monat",
|
||||
"customers_and_events.name_at_site":"{name} in {site}",
|
||||
|
|
@ -1623,6 +1629,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"Ein Trawler vor Ostende hat sein Netz direkt durch dein Kabel {a}–{b} gezogen. Die Nordsee ist etwa dreißig Meter tief und voller Boote.",
|
||||
"failures.a_visiting_engineer_from_london":"Ein Gast-Ingenieur aus London hat Marmite ins NOC in {city} mitgebracht. Die diplomatischen Beziehungen sind zusammengebrochen, und dein Router auch, während alle stritten.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"Ein Windpark-Serviceschiff hat auf deinem Kabel {a}–{b} Anker geworfen. Es war da, um eine Turbine zu reparieren.",
|
||||
"failures.across_n_transit_and_peering_ports":", über {n} Transit- und Peering-Ports",
|
||||
"failures.all_n_links_in_that_trench":"Alle {n} Links in diesem Graben sind mit ausgefallen.",
|
||||
"failures.an_automation_script_in_city_ran":"Ein Automatisierungsskript in {city} hat „sed“ auf die ganze Config losgelassen statt auf eine Zeile. Jedes Interface heißt jetzt „TODO“.",
|
||||
"failures.an_earthquake_shook_your_a_b":"Ein Erdbeben hat deine Glasfaser {a}–{b} irgendwo oberhalb von 4.000 Metern losgerüttelt.",
|
||||
|
|
@ -1985,13 +1992,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"Eine Schaltsekunde hat einen deiner Router überzeugt, es sei 1970. Die Uptime zeigt jetzt minus 56 Jahre. Der Traffic ist okay.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"Eine Route, die du in Jahr 1 zurückgezogen hast, ist irgendwo im Internet immer noch sichtbar. Niemand weiß, wo. Alles gut. Wahrscheinlich.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"Ein zweistündiges Meeting über Router-Hostnamen endete mit einer Abstimmung für „router-final-v2-NEU“.",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"Nach Upstream-Scrubbing: {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"Ein Prüfer wollte einen Netzplan. Du hast die Spielkarte geschickt. Er hat sie abgenickt.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Angriff vollständig abgewehrt",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Ziel blackholen (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"Geblackholt: Der Müll ist weg, und {city} auch. Der Angriff hat bekommen, was er wollte.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Eingedämmt auf deinem geopferten {net}-PNI",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec kann keinen {vec} abfangen (Anwendungsebene)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"Flowspec auf deinem {model} verwirft {vec} am Edge",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"Flowspec auf deinem {model} stutzt {vec}, aber sein TCAM ist klein",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Edge-Filter verwerfen: {g}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec fängt {vec} nicht ab",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec verwirft: {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec verwirft: {g}; manche Eingangs-Router haben kein TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} kommen trotzdem durch",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"Es war DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"IX-Blackhole <small>~die Hälfte respektiert es</small>",
|
||||
|
|
@ -2002,29 +2013,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Tragender Tippfehler",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"Das Management hat einen Change Freeze verhängt. Jemand hat einen Change gemacht, um den Change Freeze anzukündigen.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"{name}-Transit-LAG in {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} scrubbt ihn beim Upstream (Clean-Pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"Kein Flowspec-Filter: Die Eingangs-Router haben kein TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"Kein Scrubbing-Center",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"Nach der Abwehr am Edge ist kein Scrubbing nötig",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"On-Demand-Scrubbing leitet um, aktiv in {n} T.",
|
||||
"incidents_and_ddos.open_to_work":"Open to Work",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"PNI-LAG mit {name} in {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Erreicht dein Netz: {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"RTBH ist kostenlos und sofort, verwirft aber alles zum Opfer, Angriff und Kunde gleichermaßen. Ein IX-Blackhole hält den Kunden online, aber nur etwa die Hälfte der Mitglieder respektiert es. Der HackBack 3000™ von Skynot AI beendet es manchmal, und manchmal plättet er einen Unschuldigen und bringt dir eine Strafe ein.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Scrubbing-Center nicht erreichbar oder voll",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Scrubbing in {city}: {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Scrubbing-Traffic über dein Backbone: {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · noch {n} T.",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Jemand hat den DNS-Eintrag für das interne Wiki gelöscht. Das Runbook zum Reparieren von DNS lag im Wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Jemand hat ein VLAN „prodcution“ genannt. Es ist jetzt tragend und kann nie umbenannt werden.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"Das TLS-Zertifikat deines NOC-Dashboards ist abgelaufen. Niemand kann Graphen sehen, also gibt es technisch gesehen keine Probleme.",
|
||||
"incidents_and_ddos.this_attack_g":"Dieser Angriff: {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Ticket der Woche",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"{tier}-Scrubbing in {city} reinigt ihn, über deinen Backbone geschleppt (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"{tier}-Scrubbing in {city} reinigt ihn",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"Der Hersteller-Support hat dich gebeten, „es mal aus- und wieder einzuschalten“. Für den Router, den du schon neu gestartet hast. Ticket geschlossen.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"Du hast im Inventar einen 10G-Link gefunden, den niemand bestellt hat, für den niemand zahlt und der 3 Gbps von irgendwas transportiert.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Dein Backbone kann nur {g} davon nach {city} schleppen: Der Rest wird nicht gescrubbt",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Deine IP-Adress-Tabelle hat 1.048.576 Zeilen erreicht. Excel hat dazu eine Meinung.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Dein IPv6-Traffic ist um 400 % gewachsen. Von einem Paket auf fünf.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Dein {model} hier hat kein Flowspec-TCAM",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Dein Monitoring ist ausgefallen. Du hast es gemerkt, weil nichts alarmiert hat. Sehr friedliche Woche.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Dein Peering-Koordinator hat sein Profil auf „Open to Work“ gestellt. Drei Tier 1s wollen plötzlich plaudern. Passiert ist nichts, aber es hat sich gut angefühlt.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"Deine Scrubbing-Center sind voll: {g} rutschen durch",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"Die Support-Hotline deines Upstreams spielt immer dieselben 11 Sekunden Warteschleifenmusik. Dein Bereitschaftsingenieur kann sie jetzt in vier Tonarten summen.",
|
||||
"install.before_you_start":"Bevor du anfängst",
|
||||
"install.best_played_as_an_app":"Am besten als App spielen",
|
||||
|
|
|
|||
|
|
@ -778,6 +778,7 @@
|
|||
"common.95th_percentile":"Percentil 95",
|
||||
"common.about_average":"más o menos la media",
|
||||
"common.accept":"Aceptar",
|
||||
"common.ack_flood":"Inundación ACK",
|
||||
"common.ad_campaign":"¡Campaña publicitaria!",
|
||||
"common.africa":"África",
|
||||
"common.all_cities":"Todas las ciudades",
|
||||
|
|
@ -901,6 +902,7 @@
|
|||
"common.demand":"Demanda",
|
||||
"common.deploy":"Desplegar",
|
||||
"common.deployed":"desplegado",
|
||||
"common.distributed_ingress":"Entrada distribuida",
|
||||
"common.diverse":"diversa",
|
||||
"common.diverse_route":"ruta diversa",
|
||||
"common.dns_reflection":"Reflexión DNS",
|
||||
|
|
@ -1058,6 +1060,7 @@
|
|||
"common.may":"May",
|
||||
"common.member":"− miembro",
|
||||
"common.member_fef5":"Miembro",
|
||||
"common.memcached_amplification":"Amplificación Memcached",
|
||||
"common.merchant_silicon":"silicio comercial",
|
||||
"common.mercury":"Mercurio",
|
||||
"common.metaverse_platform":"Plataforma de metaverso",
|
||||
|
|
@ -1160,6 +1163,7 @@
|
|||
"common.price_lock":"Precio fijo",
|
||||
"common.price_mo":"{price}/mes",
|
||||
"common.provisioning_n_d_grace":"aprovisionando, {n} d de gracia",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Rango",
|
||||
"common.rare":"Raro",
|
||||
"common.reach":"Alcance",
|
||||
|
|
@ -1274,6 +1278,7 @@
|
|||
"common.subsea_cables":"Cables submarinos",
|
||||
"common.supply_chain":"Cadena de suministro",
|
||||
"common.syn_flood":"Inundación SYN",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestre",
|
||||
"common.terrestrial_19e4":"Terrestre",
|
||||
"common.terrestrial_fiber":"Fibra terrestre",
|
||||
|
|
@ -1405,6 +1410,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>Primero necesitas un POP en cada ciudad del contrato.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} extra durante {d} días, {when} · paga {fee} al terminar",
|
||||
"customers_and_events.day_n_of_d":"día {n} de {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"El gaming atrae ataques",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} pares de fibra en tu zanja {a}–{b}. La zanja era lo caro, así que quieren todo",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} sedes: {list} · {bw} por sede · {price}/mes",
|
||||
"customers_and_events.name_at_site":"{name} en {site}",
|
||||
|
|
@ -1621,6 +1627,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"Un arrastrero frente a Ostende arrastró sus aparejos directo por tu cable {a}–{b}. El Mar del Norte tiene unos treinta metros de profundidad y está lleno de barcos.",
|
||||
"failures.a_visiting_engineer_from_london":"Un ingeniero visitante de Londres llevó Marmite al NOC de {city}. Se rompieron las relaciones diplomáticas, y tu router también mientras todos discutían.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"Un barco de servicio de un parque eólico echó el ancla sobre tu cable {a}–{b}. Estaba allí para arreglar una turbina.",
|
||||
"failures.across_n_transit_and_peering_ports":", por {n} puertos de tránsito y peering",
|
||||
"failures.all_n_links_in_that_trench":"Los {n} enlaces de esa zanja cayeron con ella.",
|
||||
"failures.an_automation_script_in_city_ran":"Un script de automatización en {city} ejecutó «sed» sobre toda la configuración en lugar de una línea. Ahora todas las interfaces se llaman «TODO».",
|
||||
"failures.an_earthquake_shook_your_a_b":"Un terremoto soltó tu fibra {a}–{b} en algún punto por encima de los 4000 metros.",
|
||||
|
|
@ -1983,13 +1990,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"Un segundo intercalar convenció a uno de tus routers de que es 1970. El uptime marca ahora menos 56 años. El tráfico va bien.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"Una ruta que retiraste en el Año 1 sigue visible en algún lugar de internet. Nadie sabe dónde. Está bien. Probablemente.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"Una reunión de dos horas sobre nombres de host de routers terminó con un voto por «router-final-v2-NUEVO».",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"Tras la depuración upstream: {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"Un auditor pidió un diagrama de red. Enviaste el mapa del juego. Lo aprobaron.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Ataque mitigado por completo",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Hacer blackhole al objetivo (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"Blackhole hecho: la basura se fue, y {city} también. El ataque consiguió lo que quería.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Contenido en tu PNI de sacrificio con {net}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec no puede atrapar un {vec} (capa de aplicación)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"Flowspec en tu {model} está descartando {vec} en el borde",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"Flowspec en tu {model} recorta {vec}, pero su TCAM es pequeña",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Filtros en el borde descartan: {g}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec no puede atrapar {vec}",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec descarta: {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec descarta: {g}; algunos routers de entrada no tienen TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} se cuelan igualmente",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"Era el DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"Blackhole en IX <small>~la mitad lo respeta</small>",
|
||||
|
|
@ -2000,29 +2011,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Errata de la que depende todo",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"La dirección declaró una congelación de cambios. Alguien hizo un cambio para anunciar la congelación de cambios.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"LAG de tránsito de {name} en {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} lo está depurando aguas arriba (clean-pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"Sin filtrado Flowspec: los routers de entrada no tienen TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"Sin centro de depuración",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"No hace falta depurar tras la mitigación en el borde",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"Depuración bajo demanda desviando, activa en {n} d",
|
||||
"incidents_and_ddos.open_to_work":"Abierto a ofertas",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"LAG de PNI con {name} en {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Llegando a tu red: {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"El RTBH es gratis e instantáneo, pero descarta todo hacia la víctima, ataque y cliente por igual. Un blackhole en IX mantiene al cliente en pie, pero solo la mitad de los miembros lo respeta. HackBack 3000™ de Skynot AI a veces lo termina, y a veces arrasa a un inocente y te gana una multa.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Centros de depuración no disponibles o llenos",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Depuración en {city}: {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Tráfico de depuración por tu backbone: {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · quedan {n} d",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Alguien borró el registro DNS de la wiki interna. El runbook para arreglar el DNS estaba en la wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Alguien llamó a una VLAN «prodcution». Ahora todo depende de él y nunca se podrá renombrar.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"El certificado TLS de tu panel del NOC caducó. Nadie ve ninguna gráfica, así que técnicamente no hay problemas.",
|
||||
"incidents_and_ddos.this_attack_g":"Este ataque: {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Ticket de la semana",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"La depuración {tier} en {city} lo está limpiando, transportado por tu backbone (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"La depuración {tier} en {city} lo está limpiando",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"El soporte del fabricante te pidió «probar a apagarlo y encenderlo». Para el router que ya reiniciaste. Ticket cerrado.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"Encontraste en el inventario un enlace de 10G que nadie pidió, nadie paga y que lleva 3 Gbps de algo.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Tu backbone solo puede llevar {g} de eso a {city}: el resto no se depura",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Tu hoja de cálculo de direcciones IP llegó a 1 048 576 filas. Excel tiene opiniones.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Tu tráfico IPv6 creció un 400 %. De un paquete a cinco.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Tu {model} aquí no tiene TCAM de Flowspec",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Tu sistema de monitorización se cayó. Te enteraste porque nada alertó. Semana muy tranquila.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Tu coordinador de peering cambió su perfil a «abierto a ofertas». Tres Tier 1 de pronto quieren charlar. No pasó nada, pero sentó bien.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"Tus centros de depuración están llenos: {g} se cuelan",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"La línea de soporte de tu upstream reproduce los mismos 11 segundos de música de espera. Tu ingeniero de guardia ya puede tararearla en cuatro tonos.",
|
||||
"install.before_you_start":"Antes de empezar",
|
||||
"install.best_played_as_an_app":"Mejor jugado como app",
|
||||
|
|
|
|||
|
|
@ -778,6 +778,7 @@
|
|||
"common.95th_percentile":"95e percentile",
|
||||
"common.about_average":"dans la moyenne",
|
||||
"common.accept":"Accepter",
|
||||
"common.ack_flood":"Flood ACK",
|
||||
"common.ad_campaign":"Campagne de pub !",
|
||||
"common.africa":"Afrique",
|
||||
"common.all_cities":"Toutes les villes",
|
||||
|
|
@ -901,6 +902,7 @@
|
|||
"common.demand":"Demande",
|
||||
"common.deploy":"Déployer",
|
||||
"common.deployed":"déployé",
|
||||
"common.distributed_ingress":"Arrivée distribuée",
|
||||
"common.diverse":"diversifié",
|
||||
"common.diverse_route":"chemin diversifié",
|
||||
"common.dns_reflection":"réflexion DNS",
|
||||
|
|
@ -1058,6 +1060,7 @@
|
|||
"common.may":"mai",
|
||||
"common.member":"− membre",
|
||||
"common.member_fef5":"Membre",
|
||||
"common.memcached_amplification":"Amplification Memcached",
|
||||
"common.merchant_silicon":"merchant silicon",
|
||||
"common.mercury":"Mercure",
|
||||
"common.metaverse_platform":"Plateforme de métavers",
|
||||
|
|
@ -1160,6 +1163,7 @@
|
|||
"common.price_lock":"Blocage des prix",
|
||||
"common.price_mo":"{price}/mois",
|
||||
"common.provisioning_n_d_grace":"mise en service, {n} j de grâce",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Rang",
|
||||
"common.rare":"Rare",
|
||||
"common.reach":"Couverture",
|
||||
|
|
@ -1274,6 +1278,7 @@
|
|||
"common.subsea_cables":"Câbles sous-marins",
|
||||
"common.supply_chain":"Chaîne d’approvisionnement",
|
||||
"common.syn_flood":"SYN flood",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestre",
|
||||
"common.terrestrial_19e4":"Terrestre",
|
||||
"common.terrestrial_fiber":"Fibre terrestre",
|
||||
|
|
@ -1405,6 +1410,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>Il te faut d’abord un POP dans chaque ville du contrat.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} en plus pendant {d} jours, {when} · paie {fee} à la fin",
|
||||
"customers_and_events.day_n_of_d":"jour {n} sur {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"Le gaming attire les attaques",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} paires de fibre dans ta tranchée {a}–{b}. Le génie civil, c’était le plus cher, alors ils veulent tout",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} sites : {list} · {bw} par site · {price}/mois",
|
||||
"customers_and_events.name_at_site":"{name} à {site}",
|
||||
|
|
@ -1621,6 +1627,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"Un chalutier au large d’Ostende a traîné son chalut en plein sur ton câble {a}–{b}. La mer du Nord fait une trentaine de mètres de fond et grouille de bateaux.",
|
||||
"failures.a_visiting_engineer_from_london":"Un ingénieur de passage venu de Londres a apporté de la Marmite au NOC de {city}. Les relations diplomatiques ont rompu, et ton routeur aussi, pendant que tout le monde se disputait.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"Un navire de maintenance d’un parc éolien a jeté l’ancre sur ton câble {a}–{b}. Il était là pour réparer une éolienne.",
|
||||
"failures.across_n_transit_and_peering_ports":", via {n} ports de transit et de peering",
|
||||
"failures.all_n_links_in_that_trench":"Les {n} liens de cette tranchée sont tombés avec elle.",
|
||||
"failures.an_automation_script_in_city_ran":"Un script d’automatisation à {city} a lancé « sed » sur toute la config au lieu d’une ligne. Toutes les interfaces s’appellent maintenant « TODO ».",
|
||||
"failures.an_earthquake_shook_your_a_b":"Un séisme a déboîté ta fibre {a}–{b} quelque part au-dessus de 4 000 mètres.",
|
||||
|
|
@ -1983,13 +1990,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"Une seconde intercalaire a convaincu un de tes routeurs qu’on est en 1970. L’uptime affiche moins 56 ans. Le trafic va bien.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"Une route que tu as retirée en année 1 est encore visible quelque part sur Internet. Personne ne sait où. Tout va bien. Probablement.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"Une réunion de deux heures sur les hostnames des routeurs s’est conclue par un vote pour « router-final-v2-NEW ».",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"Après le scrubbing en amont : {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"Un auditeur a demandé un schéma réseau. Tu lui as envoyé la carte du jeu. Il l’a validée.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Attaque entièrement neutralisée",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Blackholer la cible (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"Blackholé : les déchets ont disparu, et {city} aussi. L’attaque a obtenu ce qu’elle voulait.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Contenu sur ton PNI sacrificiel {net}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec ne peut pas arrêter un {vec} (couche applicative)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"Flowspec sur ton {model} élimine le trafic {vec} en bordure",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"Flowspec sur ton {model} rogne le trafic {vec}, mais sa TCAM est petite",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Filtres en bordure : {g} supprimés",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec ne peut pas arrêter {vec}",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec supprime {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec supprime {g} ; certains routeurs d’entrée n’ont pas de TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} passent encore",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"C’était le DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"Blackhole IX <small>~la moitié le respecte</small>",
|
||||
|
|
@ -2000,29 +2011,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Coquille porteuse",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"La direction a décrété un gel des changements. Quelqu’un a fait un changement pour annoncer le gel des changements.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"LAG de transit {name} à {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} le nettoie en amont (clean-pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"Aucun filtrage Flowspec : les routeurs d’entrée n’ont pas de TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"Pas de centre de scrubbing",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"Aucun scrubbing nécessaire après la protection en bordure",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"Scrubbing à la demande en cours de redirection, actif dans {n} j",
|
||||
"incidents_and_ddos.open_to_work":"Open to work",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"LAG PNI avec {name} à {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Ce qui atteint ton réseau : {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"Le RTBH est gratuit et instantané, mais il jette tout ce qui va vers la victime, attaque comme client. Un blackhole IX garde le client en ligne, mais seule la moitié environ des membres le respecte. HackBack 3000™ de Skynot AI y met parfois fin, et parfois écrase un innocent et te vaut une amende.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Centres de scrubbing indisponibles ou saturés",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Scrubbing à {city} : {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Trafic de scrubbing acheminé par ton backbone : {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · {n} j restants",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Quelqu’un a supprimé l’enregistrement DNS du wiki interne. La procédure pour réparer le DNS était sur le wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Quelqu’un a nommé un VLAN « prodcution ». Désormais, tout repose dessus et il ne pourra jamais être renommé.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"Le certificat TLS de ton tableau de bord NOC a expiré. Plus personne ne voit les graphes, donc techniquement il n’y a aucun problème.",
|
||||
"incidents_and_ddos.this_attack_g":"Cette attaque : {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Le ticket de la semaine",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"Le scrubbing {tier} à {city} le nettoie, acheminé par ton backbone (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"Le scrubbing {tier} à {city} le nettoie",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"Le support du constructeur t’a demandé « d’essayer d’éteindre et de rallumer ». Pour le routeur que tu avais déjà redémarré. Ticket fermé.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"Tu as trouvé dans l’inventaire un lien 10G que personne n’a commandé, que personne ne paie, et qui transporte 3 Gbps de quelque chose.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Ton backbone ne peut en acheminer que {g} jusqu’à {city} : le reste n’est pas nettoyé",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Ton tableur d’adresses IP a atteint 1 048 576 lignes. Excel a un avis sur la question.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Ton trafic IPv6 a augmenté de 400 %. D’un paquet à cinq.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Ton {model} ici n’a pas de TCAM Flowspec",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Ta supervision est tombée. Tu l’as découvert parce que rien n’a alerté. Semaine très paisible.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Ton peering coordinator a mis « open to work » sur son profil. Trois Tier 1 veulent soudain discuter. Il ne s’est rien passé, mais ça fait plaisir.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"Tes centres de scrubbing sont pleins : {g} passent quand même",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"Le support de ton upstream passe en boucle les mêmes 11 secondes de musique d’attente. Ton ingé d’astreinte sait maintenant la fredonner dans quatre tonalités.",
|
||||
"install.before_you_start":"Avant de commencer",
|
||||
"install.best_played_as_an_app":"Mieux en appli",
|
||||
|
|
|
|||
|
|
@ -778,6 +778,7 @@
|
|||
"common.95th_percentile":"95° percentile",
|
||||
"common.about_average":"nella media",
|
||||
"common.accept":"Accetta",
|
||||
"common.ack_flood":"Flood ACK",
|
||||
"common.ad_campaign":"Pubblicità!",
|
||||
"common.africa":"Africa",
|
||||
"common.all_cities":"Tutte le città",
|
||||
|
|
@ -901,6 +902,7 @@
|
|||
"common.demand":"Domanda",
|
||||
"common.deploy":"Deploy",
|
||||
"common.deployed":"in produzione",
|
||||
"common.distributed_ingress":"Ingresso distribuito",
|
||||
"common.diverse":"diversificato",
|
||||
"common.diverse_route":"percorso diverso",
|
||||
"common.dns_reflection":"riflessione DNS",
|
||||
|
|
@ -1058,6 +1060,7 @@
|
|||
"common.may":"mag",
|
||||
"common.member":"− membro",
|
||||
"common.member_fef5":"Membro",
|
||||
"common.memcached_amplification":"Amplificazione Memcached",
|
||||
"common.merchant_silicon":"merchant silicon",
|
||||
"common.mercury":"Mercurio",
|
||||
"common.metaverse_platform":"Piattaforma metaverso",
|
||||
|
|
@ -1160,6 +1163,7 @@
|
|||
"common.price_lock":"Blocco dei prezzi",
|
||||
"common.price_mo":"{price}/mese",
|
||||
"common.provisioning_n_d_grace":"in attivazione, {n}g di tolleranza",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Rango",
|
||||
"common.rare":"Raro",
|
||||
"common.reach":"Copertura",
|
||||
|
|
@ -1274,6 +1278,7 @@
|
|||
"common.subsea_cables":"Cavi sottomarini",
|
||||
"common.supply_chain":"Catena di fornitura",
|
||||
"common.syn_flood":"flood SYN",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestre",
|
||||
"common.terrestrial_19e4":"Terrestre",
|
||||
"common.terrestrial_fiber":"Fibra terrestre",
|
||||
|
|
@ -1405,6 +1410,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>Prima ti serve un POP in ogni città del contratto.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} in più per {d} giorni, {when} · paga {fee} alla fine",
|
||||
"customers_and_events.day_n_of_d":"giorno {n} di {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"Il gaming attira attacchi",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} coppie di fibra nel tuo scavo {a}–{b}. Lo scavo era la parte costosa, quindi le vogliono tutte",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} sedi: {list} · {bw} per sede · {price}/mese",
|
||||
"customers_and_events.name_at_site":"{name} presso {site}",
|
||||
|
|
@ -1621,6 +1627,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"Un peschereccio al largo di Ostenda ha trascinato le reti dritte sul tuo cavo {a}–{b}. Il Mare del Nord è profondo una trentina di metri e pieno di barche.",
|
||||
"failures.a_visiting_engineer_from_london":"Un ingegnere in visita da Londra ha portato la Marmite nel NOC di {city}. Le relazioni diplomatiche sono saltate, e mentre tutti litigavano è saltato anche il tuo router.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"Una nave di servizio di un parco eolico ha gettato l'ancora sul tuo cavo {a}–{b}. Era lì per riparare una turbina.",
|
||||
"failures.across_n_transit_and_peering_ports":", su {n} porte di transit e peering",
|
||||
"failures.all_n_links_in_that_trench":"Tutti i {n} link in quello scavo sono caduti insieme.",
|
||||
"failures.an_automation_script_in_city_ran":"Uno script di automazione a {city} ha lanciato “sed” su tutta la config invece che su una riga. Ora ogni interfaccia si chiama “TODO”.",
|
||||
"failures.an_earthquake_shook_your_a_b":"Un terremoto ha scollegato la tua fibra {a}–{b} da qualche parte sopra i 4.000 metri.",
|
||||
|
|
@ -1983,13 +1990,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"Un secondo intercalare ha convinto uno dei tuoi router che siamo nel 1970. L’uptime ora segna meno 56 anni. Il traffico va benissimo.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"Una route che hai ritirato nell’Anno 1 è ancora visibile da qualche parte su internet. Nessuno sa dove. Va tutto bene. Probabilmente.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"Una riunione di due ore sugli hostname dei router si è chiusa con un voto per “router-final-v2-NEW”.",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"Dopo lo scrubbing a monte: {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"Un auditor ha chiesto uno schema della rete. Gli hai mandato la mappa del gioco. L’ha approvata.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Attacco completamente mitigato",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Metti il bersaglio in buco nero (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"In buco nero: la spazzatura è sparita, e anche {city}. L’attacco ha ottenuto ciò che voleva.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Contenuto sulla tua PNI sacrificale {net}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec non può fermare un {vec} (livello applicativo)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"Il Flowspec sul tuo {model} sta scartando {vec} all’edge",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"Il Flowspec sul tuo {model} lima {vec}, ma la sua TCAM è piccola",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Filtri al bordo: {g} scartati",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec non può fermare {vec}",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec scarta {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec scarta {g}; alcuni router di ingresso non hanno TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} superano le difese",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"Era il DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"Blackhole IX <small>~metà lo rispetta</small>",
|
||||
|
|
@ -2000,29 +2011,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Refuso portante",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"Il management ha dichiarato un change freeze. Qualcuno ha fatto una change per annunciare il change freeze.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"LAG di transit {name} a {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} lo sta ripulendo a monte (clean-pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"Nessun filtraggio Flowspec: i router di ingresso non hanno TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"Nessun centro di scrubbing",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"Nessuno scrubbing necessario dopo la mitigazione al bordo",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"Scrubbing on-demand in deviazione, attivo tra {n}g",
|
||||
"incidents_and_ddos.open_to_work":"Open to work",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"LAG PNI con {name} a {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Arriva alla tua rete: {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"L’RTBH è gratis e immediato, ma scarta tutto ciò che va alla vittima: attacco e cliente insieme. Un blackhole IX tiene su il cliente ma solo circa metà dei membri lo rispetta. HackBack 3000™ di Skynot AI a volte lo ferma, e a volte travolge un innocente e ti becca una multa.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Centri di scrubbing non disponibili o al completo",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Scrubbing a {city}: {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Traffico di scrubbing trasportato sul tuo backbone: {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · {n}g rimasti",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Qualcuno ha cancellato il record DNS del wiki interno. Il runbook per sistemare il DNS stava sul wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Qualcuno ha chiamato una VLAN “prodcution”. Ora è portante e non potrà mai più essere rinominata.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"Il certificato TLS della dashboard del NOC è scaduto. Nessuno vede più i grafici, quindi tecnicamente non ci sono problemi.",
|
||||
"incidents_and_ddos.this_attack_g":"Questo attacco: {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Ticket della settimana",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"Lo scrubbing {tier} a {city} lo sta pulendo, portato lì sul tuo backbone (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"Lo scrubbing {tier} a {city} lo sta pulendo",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"Il supporto del vendor ti ha chiesto di “provare a spegnere e riaccendere”. Il router che avevi già riavviato. Ticket chiuso.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"Hai trovato in inventario un link da 10G che nessuno ha ordinato, nessuno paga, e che porta 3 Gbps di qualcosa.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Il tuo backbone riesce a portarne solo {g} a {city}: il resto non viene pulito",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Il foglio di calcolo degli indirizzi IP ha raggiunto 1.048.576 righe. Excel ha qualcosa da ridire.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Il tuo traffico IPv6 è cresciuto del 400%. Da un pacchetto a cinque.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Il tuo {model} qui non ha TCAM per il Flowspec",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Il tuo sistema di monitoraggio è andato giù. Te ne sei accorto perché non è scattato nessun allarme. Settimana tranquillissima.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Il tuo peering coordinator ha aggiornato il profilo con “open to work”. Tre Tier 1 all’improvviso vogliono fare due chiacchiere. Non è successo niente, ma è stato bello.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"I tuoi centri di scrubbing sono pieni: {g} passano lo stesso",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"Il supporto del tuo upstream ha sempre gli stessi 11 secondi di musica d’attesa. Il tuo reperibile ora sa canticchiarla in quattro tonalità.",
|
||||
"install.before_you_start":"Prima di iniziare",
|
||||
"install.best_played_as_an_app":"Meglio come app",
|
||||
|
|
|
|||
|
|
@ -778,6 +778,7 @@
|
|||
"common.95th_percentile":"Percentil 95",
|
||||
"common.about_average":"na média",
|
||||
"common.accept":"Aceitar",
|
||||
"common.ack_flood":"Flood ACK",
|
||||
"common.ad_campaign":"Campanha!",
|
||||
"common.africa":"África",
|
||||
"common.all_cities":"Todas as cidades",
|
||||
|
|
@ -901,6 +902,7 @@
|
|||
"common.demand":"Demanda",
|
||||
"common.deploy":"Deploy",
|
||||
"common.deployed":"em produção",
|
||||
"common.distributed_ingress":"Entrada distribuída",
|
||||
"common.diverse":"diverso",
|
||||
"common.diverse_route":"rota diversa",
|
||||
"common.dns_reflection":"reflexão DNS",
|
||||
|
|
@ -1058,6 +1060,7 @@
|
|||
"common.may":"mai",
|
||||
"common.member":"− membro",
|
||||
"common.member_fef5":"Membro",
|
||||
"common.memcached_amplification":"Amplificação Memcached",
|
||||
"common.merchant_silicon":"merchant silicon",
|
||||
"common.mercury":"Mercúrio",
|
||||
"common.metaverse_platform":"Plataforma de metaverso",
|
||||
|
|
@ -1160,6 +1163,7 @@
|
|||
"common.price_lock":"Congelamento de preços",
|
||||
"common.price_mo":"{price}/mês",
|
||||
"common.provisioning_n_d_grace":"em ativação, {n}d de carência",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Ranking",
|
||||
"common.rare":"Raro",
|
||||
"common.reach":"Alcance",
|
||||
|
|
@ -1274,6 +1278,7 @@
|
|||
"common.subsea_cables":"Cabos submarinos",
|
||||
"common.supply_chain":"Cadeia de suprimentos",
|
||||
"common.syn_flood":"flood SYN",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestre",
|
||||
"common.terrestrial_19e4":"Terrestre",
|
||||
"common.terrestrial_fiber":"Fibra terrestre",
|
||||
|
|
@ -1405,6 +1410,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>Primeiro você precisa de um POP em cada cidade do contrato.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} a mais por {d} dias, {when} · paga {fee} no final",
|
||||
"customers_and_events.day_n_of_d":"dia {n} de {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"Gaming atrai ataques",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} pares de fibra na sua vala {a}–{b}. Cavar foi a parte cara, então eles querem todos",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} sites: {list} · {bw} por site · {price}/mês",
|
||||
"customers_and_events.name_at_site":"{name} em {site}",
|
||||
|
|
@ -1621,6 +1627,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"Um barco de arrasto ao largo de Ostende arrastou as redes bem em cima do seu cabo {a}–{b}. O Mar do Norte tem uns trinta metros de profundidade e é cheio de barcos.",
|
||||
"failures.a_visiting_engineer_from_london":"Um engenheiro de Londres em visita levou Marmite para o NOC de {city}. As relações diplomáticas caíram, e seu roteador também, enquanto todo mundo discutia.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"Um navio de serviço de um parque eólico jogou âncora no seu cabo {a}–{b}. Ele estava lá para consertar uma turbina.",
|
||||
"failures.across_n_transit_and_peering_ports":", por {n} portas de transit e peering",
|
||||
"failures.all_n_links_in_that_trench":"Todos os {n} links daquela vala caíram junto.",
|
||||
"failures.an_automation_script_in_city_ran":"Um script de automação em {city} rodou “sed” na config inteira em vez de uma linha. Toda interface agora se chama “TODO”.",
|
||||
"failures.an_earthquake_shook_your_a_b":"Um terremoto soltou sua fibra {a}–{b} em algum ponto acima de 4.000 metros.",
|
||||
|
|
@ -1983,13 +1990,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"Um segundo bissexto convenceu um dos seus routers de que estamos em 1970. O uptime agora marca menos 56 anos. O tráfego está ótimo.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"Uma rota que você retirou no Ano 1 ainda aparece em algum lugar da internet. Ninguém sabe onde. Tudo bem. Provavelmente.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"Uma reunião de duas horas sobre hostnames de routers terminou com votação em “router-final-v2-NOVO”.",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"Após o scrubbing upstream: {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"Um auditor pediu um diagrama da rede. Você mandou o mapa do jogo. Ele aprovou.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Ataque totalmente mitigado",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Blackhole no alvo (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"Em blackhole: o lixo sumiu, e {city} também. O ataque conseguiu o que queria.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Contido no seu PNI sacrificial com {net}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec não pega um {vec} (camada de aplicação)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"O Flowspec no seu {model} está descartando {vec} na borda",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"O Flowspec no seu {model} reduz {vec}, mas a TCAM é pequena",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Filtros de borda descartando: {g}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec não consegue filtrar {vec}",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec descarta {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec descarta {g}; alguns roteadores de entrada não têm TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} estão passando",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"Foi o DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"Blackhole IX <small>~metade respeita</small>",
|
||||
|
|
@ -2000,29 +2011,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Erro de digitação estrutural",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"A gerência decretou um change freeze. Alguém fez uma change para anunciar o change freeze.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"LAG de transit {name} em {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} está limpando upstream (clean-pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"Sem filtragem Flowspec: os roteadores de entrada não têm TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"Sem centro de scrubbing",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"Scrubbing desnecessário após a mitigação na borda",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"Scrubbing on-demand desviando, ativo em {n}d",
|
||||
"incidents_and_ddos.open_to_work":"Open to work",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"LAG de PNI com {name} em {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Chegando na sua rede: {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"RTBH é grátis e instantâneo, mas descarta tudo que vai para a vítima, ataque e cliente juntos. Um blackhole no IX mantém o cliente no ar, mas só cerca de metade dos membros respeita. O HackBack 3000™ da Skynot AI às vezes resolve, e às vezes derruba um inocente e te rende uma multa.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Centros de scrubbing indisponíveis ou lotados",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Scrubbing em {city}: {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Tráfego de scrubbing levado pelo seu backbone: {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · faltam {n}d",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Alguém apagou o registro DNS da wiki interna. O runbook para consertar DNS estava na wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Alguém chamou uma VLAN de “prodcution”. Agora ela é estrutural e nunca mais pode ser renomeada.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"O certificado TLS do dashboard do NOC expirou. Ninguém consegue ver gráfico nenhum, então tecnicamente não há problemas.",
|
||||
"incidents_and_ddos.this_attack_g":"Este ataque: {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Ticket da semana",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"O scrubbing {tier} em {city} está limpando, levado pelo seu backbone (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"O scrubbing {tier} em {city} está limpando",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"O suporte do fabricante pediu para você “desligar e ligar de novo”. O router que você já tinha reiniciado. Ticket fechado.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"Você achou no inventário um link de 10G que ninguém pediu, ninguém paga e que carrega 3 Gbps de alguma coisa.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Seu backbone só consegue levar {g} até {city}: o resto não é limpo",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Sua planilha de endereços IP chegou a 1.048.576 linhas. O Excel tem opiniões.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Seu tráfego IPv6 cresceu 400%. De um pacote para cinco.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Seu {model} aqui não tem TCAM para Flowspec",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Seu sistema de monitoramento caiu. Você descobriu porque nenhum alarme tocou. Semana bem tranquila.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Seu peering coordinator atualizou o perfil para “open to work”. Três Tier 1 de repente querem bater um papo. Nada aconteceu, mas foi bom.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"Seus centros de scrubbing estão cheios: {g} passam direto",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"O suporte do seu upstream toca os mesmos 11 segundos de música de espera. Seu plantonista já cantarola em quatro tons.",
|
||||
"install.before_you_start":"Antes de começar",
|
||||
"install.best_played_as_an_app":"Melhor jogar como app",
|
||||
|
|
|
|||
|
|
@ -38,9 +38,13 @@ const FS_RES=[1,0.4,0.15];
|
|||
const DDOS_VEC={
|
||||
dns:{n:tr('common.dns_reflection'),fs:true},
|
||||
ntp:{n:tr('common.ntp_amplification'),fs:true},
|
||||
memcached:{n:tr('common.memcached_amplification'),fs:true},
|
||||
ack:{n:tr('common.ack_flood'),fs:false},
|
||||
cldap:{n:tr('common.cldap_flood'),fs:true},
|
||||
syn:{n:tr('common.syn_flood'),fs:true},
|
||||
http:{n:tr('common.http_flood'),fs:false},
|
||||
racknet:{n:tr('common.racknet'),fs:false,gaming:true},
|
||||
teamspooked:{n:tr('common.teamspooked'),fs:false,gaming:true},
|
||||
};
|
||||
const MYIX_COST=80000, MYIX_MO=3000, MYIX_FEE=1500, START_CASH=200000;
|
||||
// Your own exchange's switching fabric. Bigger fabrics carry more and attract more members.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* ================= BUSINESSES ================= */
|
||||
const BIZ_T={
|
||||
dia:{l:tr('common.enterprise_dia'),opts:[1,2,5,10],rate:600},
|
||||
game:{l:tr('common.game_servers'),opts:[5,10,20,40],rate:120},
|
||||
game:{l:tr('common.game_servers'),gaming:true,opts:[5,10,20,40],rate:120},
|
||||
host:{l:tr('common.hosting'),opts:[10,20,40,80],rate:60},
|
||||
isp:{l:tr('businesses.downstream_isp_buys_transit'),opts:[100,200,400,800],rate:15,lv:2},
|
||||
l2vpn:{l:tr('common.l2vpn_circuit'),opts:[1,10,40,100],rate:0,l2:true,km:1,lv:1},
|
||||
|
|
@ -26,7 +26,7 @@ const BIZ_T={
|
|||
pairs:{l:tr('businesses.hundreds_of_fiber_pairs'),opts:[1],rate:0,fiber:true,mega:true,lv:4,names:['A Hyperscaler Who Shall Not Be Named','Planet-Scale AI WAN Team','The Fiber-Hungry Giant','Project Very Long Glass']},
|
||||
esport:{l:tr('businesses.esports_world_final'),opts:[400,800,1600,3200],rate:0,event:true,lv:5,names:['League of Lag Finals','Counter-Ping Major','Fortnightly World Cup','Dota Two Many Viewers','Rocket Leak Championship','Street Frighter Evo']},
|
||||
sov:{l:tr('businesses.sovereign_cloud_region'),opts:[400,800,1600],rate:0,l2:true,div:true,km:0.6,lv:6,names:['Gaia-Ex Sovereign Cloud','Bundeswolke (Very Secure)','Le Cloud Souverain','Datenschutz Deluxe','Your Data Stays Here, Probably','A Cloud With a Flag on It','Data Residency Is a State of Mind']},
|
||||
cgame:{l:tr('businesses.cloud_gaming_platform'),opts:[800,1600,3200],rate:45,lv:8,names:['Stadia-ium (Back Again)','GeForce Later','Ping Station Now','Luna-tick Gaming','Shadow of a Doubt Cloud PC','Input Lag Arcade','Bufferbloat Bros. Streaming']},
|
||||
cgame:{l:tr('businesses.cloud_gaming_platform'),gaming:true,opts:[800,1600,3200],rate:45,lv:8,names:['Stadia-ium (Back Again)','GeForce Later','Ping Station Now','Luna-tick Gaming','Shadow of a Doubt Cloud PC','Input Lag Arcade','Bufferbloat Bros. Streaming']},
|
||||
metav:{l:tr('common.metaverse_platform'),opts:[1600,3200,6400],rate:35,lv:9,names:['Meh-taverse','Second Second Life','Horizon Worlds Apart','The Oasis (Ready Player Done)','Legs Finally Shipped Inc.','Decentra-landlocked']},
|
||||
agi:{l:tr('businesses.agi_lab_allegedly'),opts:[12800,25600],rate:0,l2:true,div:true,mega:true,km:0.4,lv:11,names:['Almost General Intelligence Inc.','Superintelligence Pending','The Lab That Said Two More Years','Paperclip Maximizer Labs','Deep Thought Two','Benevolent Overlord Research']},
|
||||
mars:{l:tr('businesses.mars_mission_ground_station'),opts:[100,200,400],rate:0,l2:true,lat:true,km:4,lv:13,names:['Red Planet Relay','Ares Ground Segment','Olympus Mons Uplink','Mars or Bust Mission Control','Interplanetary Ping Society','Light-Minute Logistics','RFC 1149 Avian Carriers (Mars Division)']},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
function newGame(name,home){
|
||||
S={v:1,name,asn:200000+Math.floor(_rand()*15000),home,day:0,cash:START_CASH,
|
||||
ltv:2,t1v:3,auV:1,seen:NETS.map(n=>n.id),spares:{},pops:{[home]:{day:0,bb:null,boost:0,down:0,routers:1,gen:false}},links:[],nni:[],transit:[],ixp:{},rs:{},peers:{},pni:[],caches:[],biz:[],offers:[],myIx:{},pairMet:{},
|
||||
done:{},inc:[],ev:{},priceMul:1,nextFail:45,nextEvent:40,usedNames:[],stats:{survived:0,incidents:0,peak:0},cnLic:{state:'none'},scrubs:[],scrubMode:'always',capDeal:null,won:false,lost:false,neg:0,loans:[],loanOffers:[],loanStrikes:0,inbox:{items:[],down:{},tiny:{},rep:0,bot:false,log:[],seq:0},hw:{}};
|
||||
done:{},inc:[],ev:{ddosMore:[]},ddosStarts:[],priceMul:1,nextFail:45,nextEvent:40,usedNames:[],stats:{survived:0,incidents:0,peak:0},cnLic:{state:'none'},scrubs:[],scrubMode:'always',capDeal:null,won:false,lost:false,neg:0,loans:[],loanOffers:[],loanStrikes:0,inbox:{items:[],down:{},tiny:{},rep:0,bot:false,log:[],seq:0},hw:{}};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ function teOptimize(){const L=[tr('routescript.suggested_by_the_optimizer_from_l
|
|||
return L.join('\n');}
|
||||
// Ready-made RouteScripts, filled in from the live network. Players load them from the help; the AI button picks them too.
|
||||
const teUps=()=>[...new Set(S.transit.map(t=>t.net))].map(n=>({n,p:Math.min(...S.transit.filter(t=>t.net===n).map(t=>NET[n].price*netMult(NET[n],t.city)))})).sort((a,b)=>a.p-b.p);
|
||||
const teNm=n=>NET[n].name.toLowerCase(),teAtk=()=>!!(S.ev.ddos&&S.ev.ddos.until>S.day);
|
||||
const teNm=n=>NET[n].name.toLowerCase(),teAtk=()=>ddosAll().length>0;
|
||||
const teSad=()=>S.biz.some(b=>!BIZ_T[b.type].l2&&!BIZ_T[b.type].fiber&&!BIZ_T[b.type].event&&sfOf(R,b.city)<0.95);
|
||||
const TE_RECIPES=[
|
||||
{id:'shield',n:N_('common.shields_up'),d:N_('routescript.for_a_ddos_drop_the_junk'),fit:()=>teAtk()?9:0.3,
|
||||
|
|
|
|||
|
|
@ -33,18 +33,18 @@ function compute(){
|
|||
// ok() cannot change during one compute, so ask each exit once per network, not once per flow and rank.
|
||||
// okBy[net] lists the exits that reach it in E's order, like E.filter(e=>e.ok(net)).
|
||||
const okBy={};for(const id of NET_IDS)okBy[id]=[];
|
||||
const ekN={};for(const e of E){e.ek=e.k+':'+e.id;ekN[e.ek]=(ekN[e.ek]||0)+1;}
|
||||
R2.ingressPorts={};const ekN={};for(const e of E){e.ek=e.k+':'+e.id;if(e.k!=='c'){const p=R2.ingressPorts[e.ek]||(R2.ingressPorts[e.ek]={k:e.k,id:e.id,city:e.city,lab:e.lab,cap:0,traffic:0});p.cap+=e.cap;}ekN[e.ek]=(ekN[e.ek]||0)+1;}
|
||||
// dup: shares its key with another exit (a hand-edited save), so R.egDesc shows whichever pushed last.
|
||||
for(const e of E){e.desc={lab:e.lab,city:e.city,k:e.k};e.dup=ekN[e.ek]>1;e.told=false;e.hp=e.pref==='high'?0:1;e.ci=CIDX[e.city];e.cn=cnCity(e.city);e.vis=0;for(const n of e.nets||NET_IDS){const L=okBy[n];if(L&&L[L.length-1]!==e&&e.ok(n))L.push(e);}}
|
||||
for(const n of NETS){R2.reachable[n.id]=okBy[n.id].some(e=>e.rank>0);if(R2.reachable[n.id])R2.reach+=NSH[n.id];if(okBy[n.id].some(e=>e.rank>0&&e.k!=='t')){R2.nt[n.id]=1;R2.reachNT+=NSH[n.id];}}
|
||||
const cacheNets=new Set(S.caches.filter(c=>popUp(c.city)).map(c=>c.net));
|
||||
const viral=(ev.viral>day?1.25:1)*(ev.php&&ev.php>day?0.7:1);
|
||||
// Every flow has the same shape and carries what routing asks about it again and again (nj: its network's index).
|
||||
const NN=NETS.length,flows=[],flow=(c,ci,cn,j,rem,cache,junk,bz=false)=>{const n=NETS[j];flows.push({c,n:n.id,rem,cache,junk,bz,ci,cn,ncn:!!n.cn,nj:j,nr:junk?NN:j});};
|
||||
const NN=NETS.length,flows=[],flow=(c,ci,cn,j,rem,cache,junk,bz=false)=>{const n=NETS[j],f={c,n:n.id,rem,cache,junk,bz,ci,cn,ncn:!!n.cn,nj:j,nr:junk?NN:j};flows.push(f);return f;};
|
||||
// Customer demand per city, added up in S.biz order (what filtering S.biz for each city would give).
|
||||
const bizBw={};for(const b of S.biz){const T=BIZ_T[b.type];if(!T.l2&&!T.fiber&&(!T.event||eventLive(b))){const v=bizBw[b.city];bizBw[b.city]=(v===undefined?0:v)+b.bw;}}
|
||||
// Traffic shares by network index, and their sums, for each share table (and with Russia's throttle).
|
||||
const shArr=new Map(),shSum=new Map(),DEMTO=new Float64Array(NN),loc=scnRule('local'),HAUL=[];R2.haul=[];
|
||||
const shArr=new Map(),shSum=new Map(),DEMTO=new Float64Array(NN),loc=scnRule('local'),scrubRoom={},atkBy={},junkGroups=[],bhCities=new Set(ddosAll().filter(a=>a.bh).map(a=>a.city));R2.haul=[];R2.ddos=[];for(const a of ddosAll())for(const part of ddosSlices(a))(atkBy[part.city]||(atkBy[part.city]=[])).push(part);
|
||||
for(const c of Object.keys(S.pops)){
|
||||
const p=S.pops[c],ci=CIDX[c],cn=cnCity(c),SH=cn?NSH_CN:ruCity(c)?NSH_RU:CITY[c].kr&&S.krExit?NSH_KRX:NSH;const eye=(p.bb?p.bb.d:0)*viral*(cn&&ev.golden>day?1.4:1);const biz=bizBw[c]??0;const d0=eye+biz;
|
||||
// Goggle video is throttled in Russia (#70): people there get half of it, so they ask for half. It is not
|
||||
|
|
@ -53,26 +53,18 @@ function compute(){
|
|||
const tt=sm[+ru]||(sm[+ru]=[NETS.reduce((t,n,j)=>t+sa[j]*thr(n.id),0),NETS.reduce((t,n,j)=>t+sa[j],0)]),lf=loc?NETS.reduce((t,n,j)=>t+(R2.reachable[n.id]?sa[j]*thr(n.id):0),0)/(tt[0]||1):1,d=d0*tt[0]/(tt[1]||1)*lf;
|
||||
R2.cityEye[c]=eye;R2.cityDem[c]=d;R2.citySrv[c]=0;R2.demand+=d;
|
||||
for(let j=0;j<NN;j++)DEMTO[j]=(DEMTO[j]||0)+d0*sa[j]*thr(NETS[j].id);
|
||||
if(!popUp(c))continue;
|
||||
// A shaped attack: `rtbh` is the player pulling the plug on the victim IP (junk gone, customer dark too);
|
||||
// `edge` is the crude RouteScript `blackhole ddos` filter (junk gone, 10% of real traffic with it). Flowspec
|
||||
// (a standing licence) and a scrubbing center each knock the flood down before it reaches the sim.
|
||||
const atk=ev.ddos&&ev.ddos.city===c&&ev.ddos.until>day?ev.ddos:null;
|
||||
const rtbh=!!(atk&&atk.bh), edge=!!(atk&&TRX&&TRX.blackhole&&!rtbh);
|
||||
const attacks=atkBy[c]||[],rtbh=bhCities.has(c),edge=!!(attacks.length&&TRX&&TRX.blackhole&&!rtbh);
|
||||
let dd=0;
|
||||
if(atk&&!rtbh){let mult=1;const en=atk.entry||{};
|
||||
if(DDOS_VEC[atk.vec]&&DDOS_VEC[atk.vec].fs){const cap=fsAt(atk.city);if(cap)mult=Math.min(mult,FS_RES[cap]);}
|
||||
if(en.k==='t'){const t=S.transit.find(x=>x.id===en.id);if(t&&t.clean)mult=Math.min(mult,0.1);}
|
||||
if(atk.ixbh&&hasIxAt(atk.city))mult=Math.min(mult,0.5);
|
||||
if(edge)mult=0;
|
||||
// Scrubbing is used when it beats the edge tools; floods for a center in another city are hauled after the circuits below.
|
||||
const sp=edge?null:scrubPlan(atk);
|
||||
if(sp&&scrubIdeal(sp)<atk.gbps*mult){dd=scrubIdeal(sp);for(const x of sp.parts)if(x.city!==c)HAUL.push({c,to:x.city,tier:x.tier,a:x.a,v:d*0.1});}
|
||||
else dd=atk.gbps*mult;
|
||||
if(en.k==='p'){const p=S.pni.find(x=>x.id===en.id);if(p&&p.sacrif)dd=Math.min(dd,liveCap(pniG(p),p.city,p.site,p.n)*0.9);}}
|
||||
for(const atk of attacks){const m=ddosMitigation(atk,{},bhCities.has((atk.parent||atk).city),false);R2.ddos.push(m);dd+=m.leak;
|
||||
const group={m,flows:[]};junkGroups.push(group);
|
||||
if(atk.entries?.length){for(const q of m.ingress){const f=flow(c,ci,cn,0,q.g,false,true);f.pin=q.entry.k+':'+q.entry.id;group.flows.push({f,share:m.leak>0?q.g/m.leak:0});}}
|
||||
else for(let j=0;j<NN;j++)group.flows.push({f:flow(c,ci,cn,j,m.leak*NSH[NETS[j].id],false,true),share:NSH[NETS[j].id]});}
|
||||
if(!popUp(c)){for(const m of R2.ddos.filter(m=>m.attack.city===c))m.offline=true;continue;}
|
||||
const bh=rtbh||edge;
|
||||
if(dd>0)for(let j=0;j<NN;j++)flow(c,ci,cn,j,dd*NSH[NETS[j].id],false,true);
|
||||
if(edge)R2.teBlack+=atk.gbps*0.15+d*0.1;if(rtbh)R2.teBlack+=atk.gbps+d;
|
||||
if(edge)R2.teBlack+=attacks.reduce((n,a)=>n+a.gbps,0)+d*0.1;if(rtbh)R2.teBlack+=attacks.reduce((n,a)=>n+a.gbps,0)+d;
|
||||
R2.cityBlocked=R2.cityBlocked||{};
|
||||
const mtuH=ev.pmtud&&ev.pmtud.until>day?ev.pmtud:null,kr=CITY[c].kr;
|
||||
for(let j=0;j<NN;j++){const n=NETS[j],a=(loc&&!R2.reachable[n.id]?0:d0)*sa[j]*thr(n.id)*(rtbh?0:edge?0.9:1)*(mtuH&&mtuH.net===n.id?mtuH.f:1)*(kr&&ev.krroute>day&&n.id==='fbk'?0.8:1);if(a<=0)continue;
|
||||
|
|
@ -135,18 +127,28 @@ function compute(){
|
|||
if((b.reqs||[]).includes('diverse')){const k=b.city+'>'+b.city2;R2.div[b.id]=divMemo[k]??(divMemo[k]=disjointI(b.city,b.city2));}}
|
||||
/* A flood for a scrubbing center elsewhere rides the backbone there, with the victim's own traffic (#117).
|
||||
What the links cannot carry is not scrubbed and lands on the city after all. */
|
||||
for(const H of HAUL){const A=H.c,B=H.to,Ai=CIDX[A],Bi=CIDX[B];let h=0,ms=null;
|
||||
if(popUp(A)&&popUp(B)&&SPD[A]&&SPD[A][Bi]<Infinity){const {path,ni}=walkI(SPP[A],Ai,Bi);let room=Infinity;for(const l of path)room=Math.min(room,l.res);for(const i of ni)if(HAS[i])room=Math.min(room,NRES[i]);
|
||||
const want=H.a+H.v,take=Math.max(0,Math.min(want,room));h=want>0?H.a*take/want:0;ms=path.reduce((x,e)=>x+e.lat,0)*2;
|
||||
const ek='scrub:'+B;R2.egDesc[ek]={lab:labOf(N_('compute.attack_hauled_to_scrubbing_in_city'),'city',CITY[B].name),city:A,k:'l2'};
|
||||
for(const i of ni)if(HAS[i])nodeTake(i,take);for(const l of path){l.res-=take;l.ld+=take;carry(l,ek,NN,Ai,take);}}
|
||||
R2.haul.push({city:A,to:B,tier:H.tier,a:H.a,h,ms});const left=(H.a-h)*0.85;if(left>1e-6)for(let j=0;j<NN;j++)flow(A,Ai,cnCity(A),j,left*NSH[NETS[j].id],false,true);}
|
||||
const scrubNear=new Map();
|
||||
for(const m of R2.ddos){const atk=m.attack,A=atk.city,Ai=CIDX[A];
|
||||
m.sp=!m.offline&&m.leak>0?scrubPlan(atk,m.leak,scrubRoom,(x,want)=>{const B=x.city,Bi=CIDX[B];if(A===B)return want;let h=0,ms=null;
|
||||
if(popUp(A)&&popUp(B)&&SPD[A]&&SPD[A][Bi]<Infinity){const {path,ni}=walkI(SPP[A],Ai,Bi);let room=Infinity;for(const l of path)room=Math.min(room,l.res);for(const i of ni)if(HAS[i])room=Math.min(room,NRES[i]);
|
||||
const v=R2.cityDem[A]*0.1*want/Math.max(m.leak,1)/atkBy[A].length,total=want+v,take=Math.max(0,Math.min(total,room));h=total>0?want*take/total:0;ms=path.reduce((n,e)=>n+e.lat,0)*2;
|
||||
// Sources sharing a center need separate labels in link breakdowns and map highlights.
|
||||
const ek='scrub:'+A+'>'+B;R2.egDesc[ek]={lab:labOf(N_('compute.attack_hauled_to_scrubbing_in_city'),'city',CITY[B].name),city:A,k:'l2'};
|
||||
for(const i of ni)if(HAS[i])nodeTake(i,take);for(const l of path){l.res-=take;l.ld+=take;carry(l,ek,NN,Ai,take);}}
|
||||
R2.haul.push({city:A,to:B,tier:x.tier||0,a:want,h,ms,attack:atk.id});return h;}):null;
|
||||
if(m.sp){m.leak=m.sp.leak;
|
||||
// The card describes the victim's nearest center, separately from distributed ingress hauling above.
|
||||
const c=(atk.parent||atk).city;let near=scrubNear.get(c);if(near===undefined){near=null;
|
||||
for(const x of S.scrubs)if(popUp(x.city)&&SPD[c]&&SPD[c][CIDX[x.city]]<Infinity){const ms=c===x.city?0:walkI(SPP[c],CIDX[c],CIDX[x.city]).path.reduce((n,e)=>n+e.lat,0);if(!near||ms<near.ms)near={city:x.city,ms};}
|
||||
scrubNear.set(c,near);}m.near=near;}}
|
||||
for(const group of junkGroups)for(const q of group.flows)q.f.rem=group.m.offline?0:group.m.leak*q.share;
|
||||
const TE=!!(S.te&&S.te.on),TR=teRules();R2.teMoved=0;const teCache=new Map(),SPILL=TR&&TR.spill?TR.spill:1;
|
||||
const altPath=(src,dst,base)=>{const key=src*NC+dst,c0=teCache.get(key);
|
||||
if(c0===false)return null;if(c0&&c0.path.every(l=>l.res>1e-3)&&c0.ni.every(i=>!HAS[i]||NRES[i]>1e-3))return c0;
|
||||
const {D,P}=dijkstra(adj,src,wW,(v,e)=>e.res<=1e-3||(HAS[v]&&NRES[v]<=1e-3),dst);
|
||||
if(D[dst]===Infinity||D[dst]>2*base+60){teCache.set(key,false);return null;}
|
||||
const Q=walkI(P,src,dst);teCache.set(key,Q);return Q;};
|
||||
const ingressE={};for(const e of E)(ingressE[e.ek]||(ingressE[e.ek]=[])).push(e);
|
||||
const base=e=>e.pref==='low'?4:e.rank;
|
||||
// LOCAL_PREF on an upstream moves it ahead of or behind the other transits, never ahead of peering (#96).
|
||||
const eff=(e,n)=>{let r=base(e);if(TR){if(e.k==='t'&&TR.up[e.net])r=TR.up[e.net]==='prefer'?2.9:3.5;if(e.prep)r=4.4;if(e.k!=='c'&&TR.drain.has(e.city))r=4.6;const o=TR.net[n];if(o){if(o.prefer===e.k)r=0.5;else if(o.avoid===e.k)r=4.5;}}return r;};
|
||||
|
|
@ -172,7 +174,7 @@ function compute(){
|
|||
const ek=e.ek,nr=f.nr,ci=f.ci;if(!e.told||e.dup){R2.egDesc[ek]=e.desc;e.told=true;}
|
||||
for(const l of path){l.res-=amt;l.ld+=amt;carry(l,ek,nr,ci,amt);}
|
||||
e.used+=amt;f.rem-=amt;
|
||||
if(!f.junk){let ok=amt;const cf=f.cn,ce=e.cn,cn=f.ncn;
|
||||
if(!f.junk){if(e.k!=='c')R2.ingressPorts[ek].traffic+=amt;let ok=amt;const cf=f.cn,ce=e.cn,cn=f.ncn;
|
||||
if(cf!==ce||(cf&&!cn)||(!cf&&cn&&e.k==='t')){const prem=(e.k==='t'&&e.prem)||(e.k==='p'&&e.pnc)||path.some(x=>x.links&&x.links.some(y=>y.premium));const loss=prem?0.03:(ev.gfw>day?0.35:0.2);R2.gfwLost+=amt*loss;R2.gfwCross+=amt;ok=amt*(1-loss);}
|
||||
SRV[f.ci]+=ok;R2.served+=ok;if(f.bz)R2.bizSrv[f.c]+=ok;if(e.rank<=2)R2.peered+=ok;if(e.k==='t'){const m=R2.tNet[e.id]||(R2.tNet[e.id]={});m[f.n]=(m[f.n]||0)+ok;
|
||||
// Backhaul to transit: users notice the round trip to the exit. Up to 20 ms (about 1,500 km) is free, then
|
||||
|
|
@ -204,8 +206,9 @@ function compute(){
|
|||
// Index loops in here: plain for…of allocates an iterator per loop until V8 has optimised compute().
|
||||
for(let fi=0,FN=flows.length;fi<FN;fi++){f=flows[fi];
|
||||
if(f.rem<=1e-6||(rank===0&&!f.cache)||(pass&&!pass(f)))continue;
|
||||
const lst=byRank[f.n][rank];if(!lst)continue;
|
||||
Dv=SDi[f.ci];Pv=SPi[f.ci];PP=walked[f.ci]||(walked[f.ci]=[]);vis++;
|
||||
if(f.pin){for(const e of ingressE[f.pin]||[])if(base(e)===rank&&e.used<e.cap&&Dv[e.ci]<Infinity)send(e,f.rem);continue;}
|
||||
const lst=byRank[f.n][rank];if(!lst)continue;
|
||||
/* Groups are tried nearest first, preferred exits before the rest, in the order a stable sort of the usable
|
||||
exits gives. Exits only fill up once tried, so the usable ones stay the same until then. Nearly every flow
|
||||
fits in its first group: find that one with a scan (nothing is visited yet), and sort only what is left
|
||||
|
|
|
|||
|
|
@ -60,10 +60,15 @@ function sanitize(s){
|
|||
if(!Array.isArray(s.scrubs))s.scrubs=s.scrubAt&&isCity(s.scrubAt)?[{city:s.scrubAt,tier:s.scrubTier}]:[];delete s.scrubAt;delete s.scrubTier;
|
||||
{const seen=new Set();s.scrubs=s.scrubs.filter(x=>x&&typeof x==='object'&&isCity(x.city)&&s.pops[x.city]&&!seen.has(x.city)&&seen.add(x.city)).map(x=>({city:x.city,tier:int(x.tier,0,SCRUB_TIERS.length-1,0)}));}
|
||||
s.scrubMode=s.scrubMode==='ondemand'?'ondemand':'always';
|
||||
if(s.ev&&s.ev.ddos){const a=s.ev.ddos;
|
||||
if(!a||typeof a!=='object'||!isCity(a.city)||!own(DDOS_VEC,a.vec))delete s.ev.ddos;
|
||||
else{a.gbps=num(a.gbps,2);a.until=num(a.until,s.day);a.bh=!!a.bh;a.ixbh=!!a.ixbh;a.start=num(a.start,s.day);
|
||||
if(!a.entry||typeof a.entry!=='object')a.entry={k:'edge',lab:''};else{a.entry.lab=String(a.entry.lab||'').slice(0,60);a.entry.id=a.entry.id==null?undefined:String(a.entry.id).slice(0,40);}}}
|
||||
// Keep the legacy primary attack so old saves and imports remain compatible; additional floods overlap it.
|
||||
const repairAttack=a=>{if(!a||typeof a!=='object'||!isCity(a.city)||!s.pops[a.city]||!own(DDOS_VEC,a.vec))return null;
|
||||
a.id=sid(a.id);a.gbps=Math.max(0,num(a.gbps,2));a.until=num(a.until,s.day);a.bh=!!a.bh;a.ixbh=!!a.ixbh;a.start=Math.max(0,Math.min(s.day,num(a.start,s.day)));a.until=Math.min(a.until,a.start+7);
|
||||
if(Array.isArray(a.entries)){a.entries=a.entries.filter(en=>en&&['t','ix','p'].includes(en.k)&&isCity(en.city)&&typeof en.id==='string'&&Number.isFinite(+en.share)&&+en.share>0).slice(0,3000).map(en=>({k:en.k,id:en.id.slice(0,40),city:en.city,lab:String(en.lab||'').slice(0,60),share:+en.share}));const sum=a.entries.reduce((n,en)=>n+en.share,0);if(Number.isFinite(sum)&&sum>0)for(const en of a.entries)en.share/=sum;else delete a.entries;}else delete a.entries;
|
||||
a.sla=Array.isArray(a.sla)?a.sla.filter(x=>typeof x==='string').slice(0,s.biz.length):[];
|
||||
if(!a.entry||typeof a.entry!=='object')a.entry={k:'edge',lab:''};else{a.entry.lab=String(a.entry.lab||'').slice(0,60);a.entry.id=a.entry.id==null?undefined:String(a.entry.id).slice(0,40);}return a;};
|
||||
const attacks=[s.ev.ddos,...(Array.isArray(s.ev.ddosMore)?s.ev.ddosMore:[])].map(repairAttack).filter(Boolean).slice(0,14);
|
||||
if(attacks.length)s.ev.ddos=attacks[0];else delete s.ev.ddos;s.ev.ddosMore=attacks.slice(1);
|
||||
s.ddosStarts=(Array.isArray(s.ddosStarts)?s.ddosStarts:attacks.map(a=>a.start)).filter(d=>typeof d==='number'||typeof d==='string').map(Number).filter(d=>Number.isFinite(d)&&d>s.day-7&&d<=s.day).sort((a,b)=>a-b).slice(-14);
|
||||
s.auV=s.auV===1?1:0;if(s.auNews!==true)delete s.auNews;
|
||||
if(s.merged){const o={};if(typeof s.merged==='object')for(const m of MERGERS)if(isFinite(s.merged[m.id]))o[m.id]=+s.merged[m.id];s.merged=Object.keys(o).length?o:undefined;}
|
||||
if(s.te){if(typeof s.te!=='object')s.te=null;else{s.te.on=!!s.te.on;s.te.script=typeof s.te.script==='string'?s.te.script.slice(0,4000):'';}}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ function bizSfOf(r,c){const d=r.bizDem&&r.bizDem[c];return teRules()&&teRules().
|
|||
function bCities(o){return o.sites?o.sites.slice():[o.city,o.city2].filter(Boolean);}
|
||||
function bHas(o){return !!BIZ_T[o.type].cap||bCities(o).every(c=>S.pops[c]);}
|
||||
function eventLive(b){return BIZ_T[b.type].event&&S.day>=b.start&&S.day<b.start+b.dur;}
|
||||
function bRisk(b){return BIZ_T[b.type]?.gaming?`<div class="meta">⚠️ ${tr('customers_and_events.gaming_attracts_attacks')}</div>`:'';}
|
||||
function bTerms(o){const T=BIZ_T[o.type];if(T.cap)return capTerms(o);
|
||||
if(T.event){const live=S.day>=o.start;return tr('customers_and_events.bw_extra_for_d_days_when',{bw:fmtG(o.bw),d:o.dur,when:live?tr('customers_and_events.day_n_of_d',{n:S.day-o.start+1,d:o.dur}):tr('customers_and_events.starting_in_n_d',{n:o.start-S.day}),fee:fmt$(o.fee)});}
|
||||
if(T.sdwan)return tr('customers_and_events.n_sites_list_bw_per_site',{n:o.sites.length,list:o.sites.map(c=>CITY[c].name).join(', '),bw:fmtG(o.bw),price:fmt$(o.bw*o.rate)});
|
||||
|
|
|
|||
|
|
@ -25,58 +25,82 @@ function lagsN(){const o=[];for(const t of S.transit)if((t.n||1)>=2&&!(t.down>S.
|
|||
for(const p of S.pni)if((p.n||1)>=2)o.push({k:'p',id:p.id,o:p,n:p.n,lab:tr('incidents_and_ddos.pni_lag_with_name_in_city',{name:NET[p.net].name,city:CITY[p.city].name})});
|
||||
for(const x in S.ixp){const n=(S.ixn||{})[x]||1;if(n>=2&&!S.myIx[x])o.push({k:'ix',id:x,n,lab:ixNamesCity(x)?tr('incidents_and_ddos.ix_lag',{ix:ixName(x)}):tr('incidents_and_ddos.ix_lag_in_city',{ix:ixName(x),city:CITY[ixCity(x)].name})});}return o;}
|
||||
// Where the junk comes in: one of the city's live uplinks, or just "the edge" if it has none yet.
|
||||
// The primary slot remains compatible with older saves; every system uses the full live set.
|
||||
function ddosAll(s=S,live=true){return [s.ev.ddos,...(s.ev.ddosMore||[])].filter(a=>a&&(!live||a.until>s.day));}
|
||||
const ddosFind=id=>ddosAll().find(a=>id===undefined||a.id===id);
|
||||
function ddosDrop(a){const left=ddosAll(S,false).filter(x=>x!==a);S.ev.ddos=left[0]||null;S.ev.ddosMore=left.slice(1);}
|
||||
function ddosExpire(){for(const a of ddosAll(S,false))if(a.until<=S.day||!S.pops[a.city]){ddosDone(a);ddosDrop(a);}}
|
||||
function ddosEntries(){const ports=Object.values(R.ingressPorts||{}).filter(p=>p.cap>0),busy=ports.some(p=>p.traffic>1e-6),weight=p=>busy?p.traffic:p.cap,total=ports.reduce((n,p)=>n+weight(p),0);
|
||||
return total>0?ports.filter(p=>weight(p)>0).map(p=>({k:p.k,id:p.id,city:p.city,lab:p.lab,share:weight(p)/total})):[];}
|
||||
function ddosSlices(a){if(!a.entries?.length)return [a];const groups={};
|
||||
for(const en of a.entries){const c=S.pops[en.city]?en.city:a.city;(groups[c]||(groups[c]=[])).push(en);}
|
||||
return Object.entries(groups).map(([city,entries])=>({...a,parent:a,city,entries,gbps:a.gbps*entries.reduce((n,en)=>n+en.share,0)}));}
|
||||
const ddosCities=a=>[...new Set([a.city,...(a.entries||[]).map(en=>en.city)])].filter(c=>S.pops[c]);
|
||||
const ddosHasIx=a=>ddosCities(a).some(hasIxAt);
|
||||
const ddosSf=a=>Math.min(1,...ddosCities(a).map(c=>sfOf(R,c)));
|
||||
function ddosReport(a){const ms=(R.ddos||[]).filter(m=>m.attack===a||m.attack.parent===a);if(!ms.length)return ddosMitigation(a);
|
||||
const parts={};for(const m of ms)for(const x of m.sp?.parts||[]){const q=parts[x.city]||(parts[x.city]={city:x.city,tier:x.tier,a:0,cleaned:0});q.a+=x.a;q.cleaned+=x.cleaned;}
|
||||
return {attack:a,blackhole:ms.some(m=>m.blackhole),upstream:ms.some(m=>m.upstream),reaching:ms.reduce((n,m)=>n+m.reaching,0),flowspec:ms.reduce((n,m)=>n+m.flowspec,0),fsMissing:ms.some(m=>m.fsMissing),filtered:ms.reduce((n,m)=>n+m.filtered,0),sp:Object.keys(parts).length?{parts:Object.values(parts)}:null,near:ms.find(m=>m.near)?.near||null,leak:ms.reduce((n,m)=>n+m.leak,0)};}
|
||||
function ddosEntry(c){const o=[];
|
||||
for(const t of S.transit)if(t.city===c&&!(t.down>S.day))o.push({k:'t',id:t.id,lab:tr('common.net_transit',{net:NET[t.net].name})});
|
||||
for(const x of ixIdsIn(c))if(S.ixp[x]!==undefined)o.push({k:'ix',id:x,lab:tr('common.ix_peering',{ix:ixName(x)})});
|
||||
for(const p of S.pni)if(p.city===c)o.push({k:'p',id:p.id,lab:tr('common.pni_with_net',{net:NET[p.net].name})});
|
||||
return o.length?pick(o):{k:'edge',lab:''};}
|
||||
// Flowspec capability of the router in a city: 0 none, 1 basic, 2 full. The flood is filtered where the
|
||||
// victim POP's own router has the TCAM for it.
|
||||
// Flowspec capability at each ingress POP: 0 none, 1 basic, 2 full.
|
||||
const fsAt=c=>{const p=S.pops[c];return p?(RG[p.rgen||0].fs||0):0;};
|
||||
// Scrubbing residual for an attack: clean up to the center's capacity (to 15%), overflow leaks. On-demand
|
||||
// Scrubbing removes attack traffic up to the center's capacity; overflow leaks. On-demand
|
||||
// does nothing for the first couple of days while traffic is being diverted.
|
||||
function scrubEngaged(atk){return hasScrub()&&(S.scrubMode==='always'||(S.day-(atk.start||S.day))>=SCRUB_DELAY);}
|
||||
function scrubEngaged(atk){return hasScrub()&&(S.scrubMode==='always'||(S.day-(atk.start??S.day))>=SCRUB_DELAY);}
|
||||
// Several centers (#117): the flood goes to the nearest working one, and what it cannot take spills to the next.
|
||||
// A center in another city only helps if the backbone can carry the flood there; routing works that out.
|
||||
const scrubFar=c=>{const a=S.ev&&S.ev.ddos;return a&&a.until>S.day&&a.city===c&&(R.haul||[]).find(q=>q.city===c&&q.ms!==null&&q.ms>=SCRUB_FAR_MS)||null;};
|
||||
function scrubPlan(atk){if(!scrubEngaged(atk))return null;const c=atk.city;let g=atk.gbps||0;const parts=[];
|
||||
for(const x of S.scrubs.filter(x=>popUp(x.city)&&(x.city===c||pathExists(c,x.city))).sort((a,b)=>(a.city===c?0:kmBetween(c,a.city))-(b.city===c?0:kmBetween(c,b.city)))){if(g<=0)break;const a=Math.min(g,SCRUB_TIERS[x.tier||0].g);parts.push({city:x.city,tier:x.tier||0,a});g-=a;}
|
||||
const scrubFar=c=>ddosAll().some(a=>ddosCities(a).includes(c))&&(R.haul||[]).find(q=>q.city===c&&q.ms!==null&&q.ms>=SCRUB_FAR_MS)||null;
|
||||
function scrubPlan(atk,g=atk.gbps||0,room={},take=null){if(!scrubEngaged(atk))return null;const c=atk.city;const parts=[];
|
||||
for(const x of S.scrubs.filter(x=>popUp(x.city)&&(x.city===c||pathExists(c,x.city))).sort((a,b)=>(a.city===c?0:kmBetween(c,a.city))-(b.city===c?0:kmBetween(c,b.city)))){if(g<=0)break;const cap=SCRUB_TIERS[x.tier||0].g,a=Math.min(g,room[x.city]??cap);if(a<=0)continue;const cleaned=take?take(x,a):a;room[x.city]=(room[x.city]??cap)-cleaned;parts.push({city:x.city,tier:x.tier||0,a,cleaned});g-=cleaned;}
|
||||
return parts.length?{parts,leak:g}:null;}
|
||||
// What still lands on the city if every haul gets through: 15% of what is scrubbed, plus whatever no center can take.
|
||||
const scrubIdeal=p=>p?p.parts.reduce((s,x)=>s+x.a*0.15,0)+p.leak:Infinity;
|
||||
// One accounting pipeline for routing and the NOC: upstream -> edge -> scrubbing -> leakage.
|
||||
function ddosMitigation(a,room={},blackhole=a.bh,plan=true){const entries=a.entries?.length?a.entries:[{...(a.entry||{}),share:1}],total=entries.reduce((n,en)=>n+en.share,0),ingress=[];
|
||||
let upstream=false,reaching=0,g=0,flowspec=0,fsMissing=false;
|
||||
for(const en of entries){const t=en.k==='t'?S.transit.find(x=>x.id===en.id):null,p=en.k==='p'?S.pni.find(x=>x.id===en.id):null,clean=!!(t&&t.clean);
|
||||
upstream=upstream||clean;let part=blackhole?0:a.gbps*en.share/total*(clean?0.1:1);reaching+=part;
|
||||
if(DDOS_VEC[a.vec]?.fs){const cap=fsAt(S.pops[en.city]?en.city:a.city),before=part;part*=FS_RES[cap];flowspec+=before-part;if(cap===0&&before>0)fsMissing=true;}
|
||||
if(a.ixbh&&hasIxAt(a.city))part*=0.5;
|
||||
if(p&&p.sacrif)part=Math.min(part,liveCap(pniG(p),p.city,p.site,p.n)*0.9);
|
||||
if(teRules()?.blackhole&&!blackhole)part=0;
|
||||
g+=part;ingress.push({entry:en,g:part});}
|
||||
const filtered=reaching-g,sp=plan&&g>0?scrubPlan(a,g,room):null;
|
||||
return {attack:a,blackhole,upstream,reaching,flowspec,fsMissing,filtered,ingress,sp,leak:sp?sp.leak:g};}
|
||||
// The NOC's live attack view: what is hitting you, what each tool would do about it right now, and the buttons.
|
||||
function ddosPanel(){
|
||||
const a=S&&S.ev&&S.ev.ddos;if(!a||a.until<=S.day||!S.pops[a.city])return '';
|
||||
const V=DDOS_VEC[a.vec]||{n:'?',fs:false},cap=fsAt(a.city),model=RG[(S.pops[a.city].rgen||0)].n,en=a.entry||{};
|
||||
const cleanT=en.k==='t'?S.transit.find(x=>x.id===en.id):null, sacP=en.k==='p'?S.pni.find(x=>x.id===en.id):null;
|
||||
let mult=1;
|
||||
if(V.fs&&cap)mult=Math.min(mult,FS_RES[cap]);
|
||||
if(cleanT&&cleanT.clean)mult=Math.min(mult,0.1);
|
||||
if(a.ixbh&&hasIxAt(a.city))mult=Math.min(mult,0.5);
|
||||
const sp=scrubPlan(a),useS=!!sp&&scrubIdeal(sp)<a.gbps*mult,hl=x=>(R.haul||[]).find(q=>q.city===a.city&&q.to===x.city);
|
||||
let land=a.bh?0:useS?sp.parts.reduce((t,x)=>{const q=x.city===a.city?null:hl(x);return t+x.a*0.15+(q?(q.a-q.h)*0.85:0);},sp.leak):a.gbps*mult;
|
||||
if(sacP&&sacP.sacrif)land=Math.min(land,liveCap(PORT[sacP.tier].g,sacP.city,sacP.site,sacP.n)*0.9);
|
||||
land=Math.round(land);
|
||||
const fsLine=!V.fs?'— '+tr('incidents_and_ddos.flowspec_cannot_catch_an_vec',{vec:esc(V.n)})
|
||||
:cap>=2?'✓ '+tr('incidents_and_ddos.flowspec_on_your_model_is_dropping',{model:esc(model),vec:esc(V.n)})
|
||||
:cap===1?'~ '+tr('incidents_and_ddos.flowspec_on_your_model_trims_vec',{model:esc(model),vec:esc(V.n)})
|
||||
:'— '+tr('incidents_and_ddos.your_model_here_has_no_flowspec',{model:esc(model)});
|
||||
const scrOne=x=>{const T=SCRUB_TIERS[x.tier],q=x.city===a.city?null:hl(x);
|
||||
return q&&q.h<q.a-0.5?'~ '+tr('incidents_and_ddos.your_backbone_can_only_haul_g',{g:fmtG(q.h),city:esc(CITY[x.city].name)})
|
||||
:q&&q.ms!==null?'✓ '+tr('incidents_and_ddos.tier_scrubbing_in_city_is_cleaning',{tier:T.n,city:esc(CITY[x.city].name),ms:Math.round(q.ms)})
|
||||
:'✓ '+tr('incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6',{tier:T.n,city:esc(CITY[x.city].name)});};
|
||||
function ddosPanel(){return S?ddosAll().filter(a=>S.pops[a.city]).map(ddosOne).join(''):'';}
|
||||
function ddosOne(a){
|
||||
const V=DDOS_VEC[a.vec]||{n:'?',fs:false},en=a.entry||{};
|
||||
const sacP=en.k==='p'?S.pni.find(x=>x.id===en.id):null;
|
||||
const m=ddosReport(a),sp=m.sp,hl=x=>{const qs=(R.haul||[]).filter(q=>q.to===x.city&&q.attack===a.id);return qs.length?{a:qs.reduce((n,q)=>n+q.a,0),h:qs.reduce((n,q)=>n+q.h,0)}:null;};
|
||||
const landLine=m.blackhole?'~ '+tr('incidents_and_ddos.blackholed_the_junk_is_gone_and',{city:esc(CITY[a.city].name)})
|
||||
:m.upstream?'✓ '+tr('incidents_and_ddos.after_upstream_scrubbing_g',{g:fmtG(m.reaching)}):'';
|
||||
const fsLine=!V.fs?'— '+tr('incidents_and_ddos.flowspec_cannot_catch_vec',{vec:esc(V.n)})
|
||||
:m.flowspec<=1e-6?'— '+tr('incidents_and_ddos.no_flowspec_filtering_ingress')
|
||||
:m.fsMissing?'~ '+tr('incidents_and_ddos.flowspec_dropping_g_some_ingress',{g:fmtG(m.flowspec)})
|
||||
:'✓ '+tr('incidents_and_ddos.flowspec_dropping_g',{g:fmtG(m.flowspec)});
|
||||
const used=c=>(R.ddos||[m]).reduce((n,q)=>n+(q.sp?.parts||[]).filter(x=>x.city===c).reduce((t,x)=>t+x.cleaned,0),0);
|
||||
const scrOne=x=>{const T=SCRUB_TIERS[x.tier],q=hl(x),total=used(x.city);
|
||||
return (x.cleaned>1e-6?'✓ ':'~ ')+tr('incidents_and_ddos.scrubbing_in_city_used_capacity',{city:esc(CITY[x.city].name),used:fmtG(total),capacity:T.n})
|
||||
+(total>x.cleaned+1e-6?' · '+tr('incidents_and_ddos.this_attack_g',{g:fmtG(x.cleaned)}):'')
|
||||
+(q&&q.h<q.a-0.5?'<br>~ '+tr('incidents_and_ddos.your_backbone_can_only_haul_g',{g:fmtG(q.h),city:esc(CITY[x.city].name)}):'');};
|
||||
const scrLine=!hasScrub()?'— '+tr('incidents_and_ddos.no_scrubbing_center')
|
||||
:!scrubEngaged(a)?'… '+tr('incidents_and_ddos.on_demand_scrubbing_diverting_live',{n:Math.max(1,SCRUB_DELAY-(S.day-(a.start||S.day)))})
|
||||
:!sp?'— '+tr('incidents_and_ddos.no_scrubbing_center')
|
||||
:sp.parts.map(scrOne).join('<br>')+(sp.leak>0.5?'<br>~ '+tr('incidents_and_ddos.your_scrubbing_centers_are_full_g',{g:fmtG(sp.leak)}):'');
|
||||
const entryLine=cleanT&&cleanT.clean?'✓ '+tr('incidents_and_ddos.net_is_scrubbing_it_upstream_clean',{net:esc(NET[cleanT.net].name)})
|
||||
:sacP&&sacP.sacrif?'✓ '+tr('incidents_and_ddos.contained_on_your_sacrificial_net',{net:esc(NET[sacP.net].name)}):'';
|
||||
:!scrubEngaged(a)?'… '+tr('incidents_and_ddos.on_demand_scrubbing_diverting_live',{n:Math.max(1,SCRUB_DELAY-(S.day-(a.start??S.day)))})
|
||||
:!sp?'— '+(m.leak<=1e-6?tr('incidents_and_ddos.no_scrubbing_needed_after_edge'):tr('incidents_and_ddos.scrubbing_centers_unavailable_or_at'))
|
||||
:sp.parts.map(scrOne).join('<br>');
|
||||
const haulLine=m.near&&m.near.ms>0&&sp?.parts.some(x=>x.cleaned>1e-6)?'✓ '+tr('incidents_and_ddos.scrubbing_traffic_hauled_over_your',{city:esc(CITY[a.city].name),to:esc(CITY[m.near.city].name),ms:m.near.ms.toFixed(1)}):'';
|
||||
const entryLine=sacP&&sacP.sacrif?'✓ '+tr('incidents_and_ddos.contained_on_your_sacrificial_net',{net:esc(NET[sacP.net].name)}):'';
|
||||
let h=`<div class="inc" style="background:#FFE2E6;border:1px solid #FF8A9A">
|
||||
<div class="nm">🚨 ${tr('incidents_and_ddos.live_attack_city',{city:esc(CITY[a.city].name)})}</div>
|
||||
<div class="meta">${tr('incidents_and_ddos.size_vec_entry_n_d_left',{size:fmtG(a.gbps),vec:esc(V.n),entry:a.entry&&a.entry.lab?' · '+esc(a.entry.lab):'',n:a.until-S.day})}</div>
|
||||
<div class="meta"><b>${a.bh?tr('incidents_and_ddos.blackholed_the_junk_is_gone_and',{city:esc(CITY[a.city].name)}):tr('incidents_and_ddos.reaching_your_network_g',{g:fmtG(land)})}</b></div>
|
||||
${landLine?`<div class="meta"><b>${landLine}</b></div>`:''}
|
||||
${m.blackhole?'':`<div class="meta">${fsLine}</div>${entryLine?`<div class="meta">${entryLine}</div>`:''}
|
||||
${m.filtered-m.flowspec>1e-6?`<div class="meta">✓ ${tr('incidents_and_ddos.edge_filters_dropping_g',{g:fmtG(m.filtered-m.flowspec)})}</div>`:''}
|
||||
<div class="meta">${scrLine}</div>
|
||||
<div class="meta">${fsLine}</div>${entryLine?`\n <div class="meta">${entryLine}</div>`:''}
|
||||
<div class="btns">${a.bh?btn(tr('common.stop_blackholing'),'unrtbh',{},'ghost sm'):btn(tr('incidents_and_ddos.blackhole_the_target_rtbh'),'rtbh',{},'red sm')}${hasIxAt(a.city)&&!a.bh?btn(a.ixbh?tr('incidents_and_ddos.ix_blackhole_on'):tr('incidents_and_ddos.ix_blackhole_half_honour_it'),'ixbh',{},a.ixbh?'green sm':'sm'):''}${btn(tr('incidents_and_ddos.hackback_3000tm_20k'),'hackback',{},'sm',S.cash<20000)}</div>
|
||||
${haulLine?`<div class="meta">${haulLine}</div>`:''}
|
||||
<div class="meta">${m.leak>1e-6?'~ '+tr('incidents_and_ddos.g_is_leaking_through',{g:fmtG(m.leak)}):'✓ '+tr('incidents_and_ddos.attack_fully_mitigated')}</div>`}
|
||||
<div class="btns">${m.blackhole?btn(tr('common.stop_blackholing'),'unrtbh',{id:a.id},'ghost sm'):btn(tr('incidents_and_ddos.blackhole_the_target_rtbh'),'rtbh',{id:a.id},'red sm')}${ddosHasIx(a)&&!m.blackhole?btn(a.ixbh?tr('incidents_and_ddos.ix_blackhole_on'):tr('incidents_and_ddos.ix_blackhole_half_honour_it'),'ixbh',{id:a.id},a.ixbh?'green sm':'sm'):''}${btn(tr('incidents_and_ddos.hackback_3000tm_20k'),'hackback',{id:a.id},'sm',S.cash<20000)}</div>
|
||||
<p class="meta">${tr('incidents_and_ddos.rtbh_is_free_and_instant_but')}</p></div>`;
|
||||
return h;}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ function fireFailure(){
|
|||
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]);
|
||||
if(S.day>40&&!scnRule('ddos'))opts.push(['ddos',2]); // Flood Season brings its own
|
||||
// Spicy chaos or gaming customers put DDoS on its own, busier schedule (ddosTick); otherwise it stays one incident among many.
|
||||
if(S.day>40&&!scnRule('ddos')&&!ddosSpicy())opts.push(['ddos',2]);
|
||||
if(fabsUsed.length)opts.push(['fabric',1.5]);
|
||||
const lit=S.links.filter(l=>l.kind==='df'&&dfCap(l)>0&&!linkDown(l));if(lit.length)opts.push(['amp',1.5+lit.length*0.3],['optic',1.5+lit.length*0.3]);
|
||||
opts.push(['funny',4]);
|
||||
|
|
@ -111,27 +112,54 @@ function fireFailure(){
|
|||
else{const paused=pref('pauseIncident')&&autoPause();toast(`<b>${incTitle(type)}</b><br>${esc(last.msg)}${paused?`<br><b>${tr('common.game_paused')}</b>`:''}`,'bad',(last.cost?[{l:`${last.fix||tr('common.rush_repair')} ${fmt$(last.cost)}`,act:'fixInc',args:{id:last.id}}]:[]).concat(paused?[resumeAct()]:[]),incOpen(last));}
|
||||
sfx('alert');
|
||||
}
|
||||
// A DDoS attack: mostly short, modest spikes; now and then a "botnet of toasters" monster into the terabits.
|
||||
// In Flood Season (scenario rule ddos) they come more often, a third are monsters, and they grow over the year.
|
||||
function ddosAttack(){const type='ddos',fl=scnRule('ddos'),grow=fl?1+S.day/180:1;if(S.ev.ddos&&S.ev.ddos.until>S.day)ddosDone(S.ev.ddos);
|
||||
const c=pick(Object.keys(S.pops)),vec=pick(Object.keys(DDOS_VEC)),V=DDOS_VEC[vec];
|
||||
const monster=Math.random()<(fl?0.33:0.15),base=Math.max(R.cityDem[c]||0,4);
|
||||
const gbps=Math.round((monster?800+Math.random()*2600:2+Math.random()*Math.max(18,base*0.9))*grow);
|
||||
const dur=2+Math.floor(Math.random()*4),entry=ddosEntry(c);
|
||||
S.ev.ddos={city:c,vec,gbps,until:S.day+dur,entry,bh:false,start:S.day};
|
||||
const gamingCount=()=>S.biz.reduce((n,b)=>n+(BIZ_T[b.type]?.gaming?1:0),0);
|
||||
const ddosVectors=()=>Object.keys(DDOS_VEC).filter(k=>!DDOS_VEC[k].gaming||gamingCount()>0);
|
||||
// Expected starts per week in normal play; the rolling 14-start limit is a separate ceiling.
|
||||
// Spread gaming exposure over dozens of customers, including the first, rather than switching baselines.
|
||||
const ddosRate=()=>0.5+6.5*(1-Math.exp(-gamingCount()/50*(1+Math.max(1,S.lvl||1)/LEVELS.length)));
|
||||
const ddosPressure=()=>1-Math.exp(-(.01+Math.max(0,(S.lvl||1)-1)/12+gamingCount()/10+(scnRule('ddos')?.2+S.day/365:0)));
|
||||
// Normalize the vector mix so smaller gaming-only floods do not lower the advertised overall mean.
|
||||
function ddosSizeMean(){const stage=Math.max(1,S.lvl||1)/LEVELS.length,games=gamingCount(),fl=scnRule('ddos');
|
||||
const base=Math.max(10,(R.demand||0)*4/3*stage,fl?1400:0);
|
||||
if(fl)return base*(1+0.2*games/(games+10))*(1+S.day/365);
|
||||
// Relative to no gaming: 3x at one customer, 8x at 50, approaching the existing 12x balance.
|
||||
const mean=base*(games?1.2-0.9*Math.pow(4/9,(games-1)/49):0.1),vectors=ddosVectors(),weight=vectors.reduce((n,k)=>n+(DDOS_VEC[k].gaming?1/3:1),0)/vectors.length;
|
||||
return mean/weight;}
|
||||
// Normal rolls: 98% uniform 0.2–2, 2% uniform 8–12. Their mean is 1.278, so spikes do not inflate the balance.
|
||||
const ddosSizeMax=()=>ddosSizeMean()*(scnRule('ddos')?1.5:12/1.278);
|
||||
function ddosSize(vec){const fl=scnRule('ddos'),r=Math.random(),roll=fl?1/3+r*2/3:(r<.98?.2+1.8*r/.98:8+4*(r-.98)/.02)/12;
|
||||
const raw=ddosSizeMax()*(DDOS_VEC[vec].gaming?1/3:1)*roll;
|
||||
return fl?Math.max(2,Math.floor(raw)):Math.max(0.001,Math.floor(raw*1000)/1000);}
|
||||
// More frequent attacks are opt-in: the spicy chaos setting, or hosting gamers (who attract them in real life).
|
||||
const ddosSpicy=()=>(typeof rule==='function'&&rule('chaos')==='spicy')||gamingCount()>0;
|
||||
function ddosTick(){if(S.mode==='sandbox')return;if(scnRule('ddos')){let next=+S.scn.nextDdos||3,n=0;
|
||||
// Unless spicy, floods take turns as they always did: the next one waits until the last is over.
|
||||
if(!ddosSpicy()&&ddosAll().length)return;
|
||||
while(S.day>=next&&n++<2){ddosAttack(false);next+=floodGap();}S.scn.nextDdos=next<S.day?S.day+floodGap():next;}
|
||||
else if(ddosSpicy()&&(S.day>40||gamingCount()))for(let i=0;i<2;i++)if(Math.random()<ddosRate()/14)ddosAttack(false);}
|
||||
// Size, duration and starts are randomized independently; overlapping floods never replace each other.
|
||||
function ddosAttack(recompute=true){const type='ddos',fl=scnRule('ddos');ddosExpire();
|
||||
S.ddosStarts=(S.ddosStarts||[]).filter(d=>d>S.day-7&&d<=S.day);if(S.ddosStarts.length>=14||!Object.keys(S.pops).length)return;S.ddosStarts.push(S.day);
|
||||
const c=pick(Object.keys(S.pops)),vec=pick(ddosVectors()),V=DDOS_VEC[vec];
|
||||
const gbps=ddosSize(vec);
|
||||
const dur=1+Math.floor(Math.random()*(1+6*ddosPressure())),entry=ddosEntry(c);
|
||||
const entries=ddosEntries(),a={id:uid(),city:c,vec,gbps,until:S.day+dur,entry:entries.length>1?{k:'distributed',lab:tr('common.distributed_ingress')}:entries[0]||entry,entries,bh:false,start:S.day};
|
||||
if(!S.ev.ddos)S.ev.ddos=a;else(S.ev.ddosMore||(S.ev.ddosMore=[])).push(a);
|
||||
const soaked=(V.fs&&fsAt(c))||hasScrub();
|
||||
const how=entry&&entry.lab?tr('failures.in_via_e',{e:entry.lab}):'';
|
||||
const how=entries.length>1?tr('failures.across_n_transit_and_peering_ports',{n:entries.length}):entry&&entry.lab?tr('failures.in_via_e',{e:entry.lab}):'';
|
||||
const msg=tr('failures.a_size_vec_attack_is_hitting',{size:fmtG(gbps),vec:V.n,city:CITY[c].name,how})+' '+(soaked?tr('failures.your_mitigation_is_eating_most_of'):tr('failures.junk_traffic_is_eating_your_capacity'));
|
||||
if(fl)S.ev.ddos.who=pick(FLOOD_WHO);
|
||||
addInc({type,ref:c,until:S.day+dur,msg:fl?msg+' '+tr('failures.attacker_who',{who:tr(S.ev.ddos.who)}):msg,cost:0});
|
||||
if(fl)a.who=pick(FLOOD_WHO);
|
||||
addInc({type,ref:c,atk:a.id,until:S.day+dur,msg:fl?msg+' '+tr('failures.attacker_who',{who:tr(a.who)}):msg,cost:0});
|
||||
if(soaked){S.stats.survived++;S.stats.ddosHeld=(S.stats.ddosHeld||0)+1;if(gbps>=1000)S.stats.ddosMonster=(S.stats.ddosMonster||0)+1;}
|
||||
compute();
|
||||
toast(`<b>${incTitle('ddos')}: ${esc(CITY[c].name)}</b><br>${esc(msg)}${fl?`<br><i>${esc(tr('failures.attacker_who',{who:tr(S.ev.ddos.who)}))}</i>`:''}`,soaked?'goal':'bad',[{l:tr('common.open_noc'),act:'leftTab',args:{t:'noc'}}],{a:'city',v:c});
|
||||
if(recompute){compute();a.worst=ddosSf(a);}
|
||||
toast(`<b>${incTitle('ddos')}: ${esc(CITY[c].name)}</b><br>${esc(msg)}${fl?`<br><i>${esc(tr('failures.attacker_who',{who:tr(a.who)}))}</i>`:''}`,soaked?'goal':'bad',[{l:tr('common.open_noc'),act:'leftTab',args:{t:'noc'}}],{a:'city',v:c});
|
||||
sfx('alert');}
|
||||
// When an attack is over: was it held? Held means the city under attack got at least 97% of its traffic every day.
|
||||
function ddosDone(a){if(!a||a.done)return;a.done=1;if(a.worst===undefined&&S.pops[a.city])a.worst=sfOf(R,a.city);const ok=(a.worst===undefined?1:a.worst)>=0.97;
|
||||
function ddosDone(a){if(!a||a.done)return;a.done=1;if(a.worst===undefined&&S.pops[a.city])a.worst=ddosSf(a);const ok=(a.worst===undefined?1:a.worst)>=0.97;
|
||||
if(ok){S.stats.ddosOk=(S.stats.ddosOk||0)+1;if(a.gbps>=1000)S.stats.ddosOkBig=(S.stats.ddosOkBig||0)+1;}else S.stats.ddosLost=(S.stats.ddosLost||0)+1;
|
||||
if(scnRule('ddos')){const who=tr(a.who||FLOOD_WHO[0]);toast(ok?tr('failures.flood_held_g_who_gave_up',{g:fmtG(a.gbps),who:who.charAt(0).toUpperCase()+who.slice(1)}):tr('failures.that_one_got_through_g_city',{g:fmtG(a.gbps),city:CITY[a.city]?CITY[a.city].name:tr('common.your_network'),p:pct(a.worst||0),who}),ok?'goal':'bad');}}
|
||||
// Flood Season: 3 to 7 days apart as before, shrinking with age, level and gamers only when attacks are spicy.
|
||||
const floodGap=()=>!ddosSpicy()?3+Math.floor(Math.random()*5):Math.max(0.05,(3+Math.random()*5)/(Math.sqrt(1+S.day/180)*(1+gamingCount()/10+Math.max(0,(S.lvl||1)-1)/12)));
|
||||
const FLOOD_WHO=[N_('failures.a_botnet_of_40_000_smart'),N_('failures.every_unpatched_baby_monitor_in'),N_('failures.a_gaming_clan_that_lost_one'),N_('failures.a_fridge_that_achieved_sentience_and'),N_('failures.a_crypto_bro_shorting_your_stock'),N_('failures.a_teenager_with_a_stolen_credit'),N_('failures.a_rival_isp_s_stress_test'),N_('failures.ten_thousand_smart_light_bulbs'),N_('failures.a_printer_just_one_printer_nobody'),N_('failures.a_botnet_run_from_a_cloud'),N_('failures.somebody_who_did_not_like_your'),N_('failures.the_internet_connected_kettles_of_a')];
|
||||
function incTitle(t){return {ring:tr('failures.metro_ring_cut'),site:tr('common.site_outage'),cut:tr('common.fiber_cut'),crash:tr('common.router_crash'),power:tr('common.power_outage'),transit:tr('common.upstream_outage'),ixloop:tr('common.ix_meltdown'),leak:tr('common.route_leak'),ddos:tr('common.ddos_attack'),fabric:tr('common.fabric_outage'),depeer:tr('common.peering_spat'),fatwave:tr('failures.fat_fingered_wave'),label:tr('failures.patch_panel_mishap'),mtu:tr('common.mtu_mismatch'),krroute:tr('failures.rerouted_via_hong_kong'),ctrlplane:tr('failures.control_plane_meltdown'),lacp:tr('common.lacp_trouble'),loss:tr('common.packet_loss'),pmtud:tr('failures.pmtud_black_hole'),oops:tr('common.oops'),cleaner:tr('common.vacuum_incident'),maxpfx:tr('failures.max_prefix_meltdown'),prepend:tr('common.prepend_ageddon'),rpki:tr('common.rpki_invalid'),amp:tr('common.amplifier_failure'),roadmff:tr('failures.fat_fingered_roadm'),optic:tr('common.dead_optic'),maint:tr('common.maintenance_window_3a92'),ac:tr('common.cooling_failure'),hijack:tr('common.bgp_hijack'),shutdown:tr('common.government_shutdown'),redsea:tr('failures.geopolitical_cable_cut')}[t]||tr('common.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'];
|
||||
|
|
@ -146,7 +174,7 @@ function clearInc(i){
|
|||
else if(TDOWN.includes(T)){const t=S.transit.find(x=>x.id===i.ref);if(t)t.down=remainUntil(x=>TDOWN.includes(x.type)&&x.ref===i.ref);}
|
||||
else if(T==='rpki'||T==='hijack'){if(!S.inc.some(x=>x.type==='rpki'||x.type==='hijack'))S.ev.rpki=null;}
|
||||
else if(T==='leak'){S.ev.leak=null;}
|
||||
else if(T==='ddos'){const a=S.ev.ddos;if(a&&a.city===i.ref&&(a.start===undefined||a.start===i.start)){ddosDone(a);S.ev.ddos=null;}}
|
||||
else if(T==='ddos'){const a=ddosAll(S,false).find(a=>i.atk?a.id===i.atk:a.city===i.ref&&(a.start===undefined||a.start===i.start));if(a){ddosDone(a);ddosDrop(a);}}
|
||||
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==='loss'){const l=S.links.find(x=>x.id===i.ref);if(l&&!S.inc.some(x=>x.type==='loss'&&x.ref===i.ref))l.loss=null;}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@ function dayTick(){
|
|||
if(R&&R.teMoved)S.stats.teMax=Math.max(S.stats.teMax||0,R.teMoved);
|
||||
{const t1=!!S.won&&isTier1();if(S.t1Now&&!t1)toast(tr('day_tick.you_are_no_longer_tier_1',{why:t1Why()}),'bad');S.t1Now=t1;}
|
||||
if(S.grace&&S.grace.until===d){toast(tr('day_tick.the_courtesy_route_has_ended_new'),'bad',[{l:tr('common.open_noc'),act:'leftTab',args:{t:'noc'}}]);}
|
||||
{const a=S.ev.ddos;if(a&&a.until>d&&R&&S.pops[a.city])a.worst=Math.min(a.worst===undefined?1:a.worst,sfOf(R,a.city));}
|
||||
if(scnRule('ddos')&&!(S.scn.done||S.scn.failed)&&d>=(+S.scn.nextDdos||3)&&!(S.ev.ddos&&S.ev.ddos.until>d)){ddosAttack();S.scn.nextDdos=d+3+Math.floor(Math.random()*5);}
|
||||
for(const a of ddosAll(S,false))if(a.until>=d&&R&&S.pops[a.city])a.worst=Math.min(a.worst===undefined?1:a.worst,ddosSf(a));
|
||||
ddosExpire();
|
||||
ddosTick();
|
||||
if(R&&R.demand>0)S.stats.clean=R.served/R.demand>=0.995?(S.stats.clean||0)+1:0;
|
||||
if(S.scn&&S.scn.id==='redsea')S.stats.asiaRun=asiaG()>=RS_G?(S.stats.asiaRun||0)+1:0;
|
||||
if(S.ev.php===d)toast(tr('day_tick.the_internet_is_back_half_of'),'good');
|
||||
|
|
@ -24,6 +25,7 @@ function dayTick(){
|
|||
if(sf>=0.9){const g=(CITY[c].be&&!(p.boost>d)?0.35:1)*0.025*(scnRule('boom')?1.5:1)*(p.boost>d?2:1)*sf*(0.7+0.6*(R.peerShare||0))*(CITY[c].reg==='AS'&&!CITY[c].cn?1.6:1);p.bb.d+=g*p.bb.d*(1-p.bb.d/P);}
|
||||
else p.bb.d=Math.max(Math.min(3,P),p.bb.d*(1-(0.9-sf)*0.04));}
|
||||
compute();
|
||||
for(const a of ddosAll())a.worst=Math.min(a.worst??1,ddosSf(a));
|
||||
for(const t of S.transit){(t.hist=t.hist||[]).push(R.useT[t.id]||0);if(t.hist.length>30)t.hist.shift();}
|
||||
S.cash+=(R.revMo-R.costMo)/30;
|
||||
S.stats.peak=Math.max(S.stats.peak,R.served);
|
||||
|
|
@ -33,9 +35,9 @@ function dayTick(){
|
|||
if(l.ready===d){toast(`<b>${l.own?tr('day_tick.your_fiber_is_finished_a_b',{a:CITY[l.a].name,b:CITY[l.b].name}):tr('day_tick.dark_fiber_handed_over_a_b',{a:CITY[l.a].name,b:CITY[l.b].name})}</b><br>${(l.ch||[]).length?tr('day_tick.channels_are_lighting_up_now'):tr('day_tick.it_is_dark_add_optics_to')}`,'goal',[{l:tr('common.open'),act:'selLink',args:{id:l.id}}]);sfx('coin');}
|
||||
if(l.own&&l.ready>d&&Math.random()<0.012){const extra=10+Math.floor(Math.random()*40);setCableReady(l,l.ready+extra);toast(tr('day_tick.construction_delay_n_days_why_a',{n:extra,why:pick(l.sub?SEA_DELAYS.map(x=>tr(x)):[tr('day_tick.archaeologists_found_a_roman'),tr('day_tick.a_protected_hamster_species_lives'),tr('day_tick.the_railway_changed_its_mind_about'),tr('day_tick.the_drilling_crew_hit_a_granite'),tr('day_tick.a_town_council_wants_a_public'),tr('day_tick.somebody_else_s_gas_main_was'),tr('day_tick.the_permit_office_lost_your_permit')]),a:CITY[l.a].name,b:CITY[l.b].name}),'bad');}}
|
||||
// DDoS protection SLA: if a protected customer's own city is hit and still goes down, you pay out (once per attack).
|
||||
if(S.ev.ddos&&S.ev.ddos.until>d){const a=S.ev.ddos;
|
||||
for(const b of S.biz)if(b.type==='scrub'&&b.city===a.city&&b.slaFor!==a.start&&sfOf(R,b.city)<0.85){
|
||||
b.slaFor=a.start;S.cash-=SLA_PEN;b.mood=Math.max(0,b.mood-18);S.stats.sla=(S.stats.sla||0)+1;
|
||||
for(const a of ddosAll()){
|
||||
for(const b of S.biz)if(b.type==='scrub'&&ddosCities(a).includes(b.city)&&!(a.sla||[]).includes(b.id)&&(a.id||b.slaFor!==a.start)&&sfOf(R,b.city)<0.85){
|
||||
(a.sla||(a.sla=[])).push(b.id);b.slaFor=a.start;S.cash-=SLA_PEN;b.mood=Math.max(0,b.mood-18);S.stats.sla=(S.stats.sla||0)+1;
|
||||
toast(tr('day_tick.sla_breach_name_the_attack_on',{name:esc(b.name),city:CITY[a.city].name,pen:fmt$(SLA_PEN)}),'bad');sfx('err');}}
|
||||
// businesses mood
|
||||
const ids=linkIds();for(const b of S.biz.slice()){if(eventTick(b,d)||capPendTick(b,d))continue;b.pm=b.mood;const sf=bizSf(b,ids),reachOk=BIZ_T[b.type].l2||BIZ_T[b.type].fiber||R.reach>0.99||scnRule('local'),scrubOk=b.type!=='scrub'||(hasScrub()&&!scrubFar(b.city)),divOk=reqOk(b);
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ Object.assign(ACT,{
|
|||
rmScrub:({city})=>{if(!S.scrubs.some(x=>x.city===city))return;if(UI.confirm!=='scrub:'+city){UI.confirm='scrub:'+city;renderAll();return;}S.scrubs=S.scrubs.filter(x=>x.city!==city);if(!hasScrub())S.scrubMode='always';UI.confirm=null;after();},
|
||||
cleanPipe:({id})=>{const t=S.transit.find(x=>x.id===id);if(!t)return;t.clean=!t.clean;toast(t.clean?tr('security_and_china.clean_pipe_add_on_enabled_on',{net:NET[t.net].name,mo:fmt$(cleanMo(t))}):tr('security_and_china.clean_pipe_add_on_removed_from',{net:NET[t.net].name}),t.clean?'good':'');after();},
|
||||
sacrif:({id})=>{const p=S.pni.find(x=>x.id===id);if(!p)return;p.sacrif=!p.sacrif;toast(p.sacrif?tr('security_and_china.net_pni_is_now_a_sacrificial',{net:NET[p.net].name}):tr('security_and_china.net_pni_is_back_to_normal',{net:NET[p.net].name}),p.sacrif?'good':'');after();},
|
||||
ixbh:()=>{const a=S.ev.ddos;if(!a){toast(tr('security_and_china.no_attack_to_blackhole_right_now'),'');return;}if(!hasIxAt(a.city)){toast(tr('security_and_china.no_ix_in_city_to_announce',{city:CITY[a.city].name}),'bad');sfx('err');return;}a.ixbh=!a.ixbh;toast(a.ixbh?tr('security_and_china.ix_blackhole_announced_in_city_about',{city:CITY[a.city].name}):tr('security_and_china.ix_blackhole_withdrawn'),a.ixbh?'good':'');sfx('alert');after();},
|
||||
rtbh:()=>{const a=S.ev.ddos;if(!a){toast(tr('security_and_china.no_attack_to_blackhole_right_now'),'');return;}a.bh=true;S.stats.rtbh=(S.stats.rtbh||0)+1;toast(tr('security_and_china.rtbh_announced_you_blackholed_the',{city:CITY[a.city].name}),'bad');sfx('alert');after();},
|
||||
unrtbh:()=>{const a=S.ev.ddos;if(!a||!a.bh)return;a.bh=false;toast(tr('security_and_china.blackhole_withdrawn_city_is',{city:CITY[a.city].name}),'');after();},
|
||||
hackback:()=>{const a=S.ev.ddos;if(!a||a.until<=S.day){toast(tr('security_and_china.nothing_to_hack_back_right_now'),'');return;}if(!spend(20000))return;S.stats.hackback=(S.stats.hackback||0)+1;
|
||||
ixbh:({id}={})=>{const a=ddosFind(id);if(!a){toast(tr('security_and_china.no_attack_to_blackhole_right_now'),'');return;}if(!ddosHasIx(a)){toast(tr('security_and_china.no_ix_in_city_to_announce',{city:CITY[a.city].name}),'bad');sfx('err');return;}a.ixbh=!a.ixbh;toast(a.ixbh?tr('security_and_china.ix_blackhole_announced_in_city_about',{city:ddosCities(a).filter(hasIxAt).map(c=>CITY[c].name).join(', ')}):tr('security_and_china.ix_blackhole_withdrawn'),a.ixbh?'good':'');sfx('alert');after();},
|
||||
rtbh:({id}={})=>{const a=ddosFind(id);if(!a){toast(tr('security_and_china.no_attack_to_blackhole_right_now'),'');return;}a.bh=true;S.stats.rtbh=(S.stats.rtbh||0)+1;toast(tr('security_and_china.rtbh_announced_you_blackholed_the',{city:CITY[a.city].name}),'bad');sfx('alert');after();},
|
||||
unrtbh:({id}={})=>{const a=ddosFind(id);if(!a)return;for(const x of ddosAll())if(x.city===a.city)x.bh=false;toast(tr('security_and_china.blackhole_withdrawn_city_is',{city:CITY[a.city].name}),'');after();},
|
||||
hackback:({id}={})=>{const a=ddosFind(id);if(!a||a.until<=S.day){toast(tr('security_and_china.nothing_to_hack_back_right_now'),'');return;}if(!spend(20000))return;S.stats.hackback=(S.stats.hackback||0)+1;
|
||||
if(Math.random()<0.35){a.until=S.day;a.bh=false;S.stats.hackWin=(S.stats.hackWin||0)+1;toast(tr('security_and_china.hackback_3000tm_strikes_back_skynot',{city:CITY[a.city].name}),'goal');sfx('coin');}
|
||||
else{const fine=15000+Math.floor(Math.random()*35000);S.cash-=fine;S.stats.vigilante=(S.stats.vigilante||0)+1;
|
||||
toast(tr('security_and_china.hackback_3000tm_hit_the_wrong_target',{who:pick([tr('security_and_china.skynot_ai_flattened_a_grandma_s'),tr('security_and_china.you_counter_flooded_a_hospital_in'),tr('security_and_china.the_botnet_was_already_someone_else')]),fine:fmt$(fine)}),'bad');sfx('err');}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ function renderLeft(){checkLayer();
|
|||
{const lv=S.lvl||1,nx=LEVELS[lv];h+=`<div class="inc" style="background:#FFF6CF"><div class="nm">${tr('hud_and_panels.customer_level_lv_name',{lv,name:LEVELS[lv-1].n})}</div><div class="meta">${nx?tr('hud_and_panels.next_req_unlocks_what',{req:nx.req,what:lc1(nx.unlock)}):tr('common.every_customer_type_is_unlocked_go')}</div></div>`;}
|
||||
if(!S.offers.length)h+=`<p class="empty">${tr('hud_and_panels.no_open_offers_right_now_businesses')}</p>`;
|
||||
for(const o of S.offers.slice().sort((a,b)=>a.exp-b.exp)){const has=bHas(o);
|
||||
h+=`<div class="row"><div class="grow"><div class="nm">${esc(o.name)}</div><div class="meta">${esc(BIZ_T[o.type].l)} · ${CITY[o.city].name}${o.city2?' ⇄ '+CITY[o.city2].name:''} · <b>${bTerms(o)}</b> · ${tr('ui.n_d_left',{n:o.exp-S.day})}${(o.reqs||[]).length?` · ${trn('hud_and_panels.n_special_requirement',o.reqs.length)}`:''}</div>${reqList(o)}
|
||||
h+=`<div class="row"><div class="grow"><div class="nm">${esc(o.name)}</div><div class="meta">${esc(BIZ_T[o.type].l)} · ${CITY[o.city].name}${o.city2?' ⇄ '+CITY[o.city2].name:''} · <b>${bTerms(o)}</b> · ${tr('ui.n_d_left',{n:o.exp-S.day})}${(o.reqs||[]).length?` · ${trn('hud_and_panels.n_special_requirement',o.reqs.length)}`:''}</div>${bRisk(o)}${reqList(o)}
|
||||
<div class="btns">${has?btn(tr('common.accept'),'accept',{id:o.id},'green sm'):btn(tr('common.go_there'),'focusCity',{city:bCities(o).find(c=>!S.pops[c])},'ghost sm')}${btn(tr('common.decline'),'decline',{id:o.id},'ghost sm')}</div>${has?'':`<div class="why">${tr('hud_and_panels.needs_a_pop_in_cities',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}</div>`}</div></div>`;}
|
||||
}else if(UI.left==='noc'){
|
||||
h+=`<div class="btns" style="margin-bottom:8px">${btn(tr('hud_and_panels.open_noc_dashboard'),'dash',{},'pink')}${btn(tr('common.connections'),'connOpen',{},'')}${btn(tr('common.traceroute'),'trace',{},'')}</div>`;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ function cityPanel(c){
|
|||
h+=`</section><section><h3>${tr('common.business_customers')}</h3>`;
|
||||
const bz=S.biz.filter(b=>bCities(b).includes(c));
|
||||
if(!bz.length)h+=`<p class="empty">${tr('city_panel.no_businesses_yet_offers_pop_up')}</p>`;
|
||||
for(const b of bz)h+=`<div class="row"><div class="grow"><div class="nm">${esc(b.name)}</div><div class="meta">${esc(BIZ_T[b.type].l)}${b.city2?` ${CITY[b.city].name} ⇄ ${CITY[b.city2].name}`:''} · ${bTerms(b)}${BIZ_T[b.type].l2?` · ${b.sites?tr('city_panel.carrying_g_per_site',{g:fmtG(R.l2[b.id]||0)}):tr('city_panel.carrying_g',{g:fmtG(R.l2[b.id]||0)})}`:''}${BIZ_T[b.type].fiber&&!fiberOk(b)?' · <b style="color:var(--bad)">'+tr('city_panel.fiber_is_down')+'</b>':''}${BIZ_T[b.type].event&&eventLive(b)?` · <b>${tr('city_panel.serving_v',{v:pct(sfOf(R,b.city))})}</b>`:''}${b.type==='scrub'&&!hasScrub()?' · <b style="color:var(--bad)">'+tr('common.needs_a_scrubbing_center')+'</b>':''}${S.day-(b.since||0)<15?` · <b>${tr('common.provisioning_n_d_grace',{n:15-(S.day-(b.since||0))})}</b>`:''}</div>${reqList(b)}${BIZ_T[b.type].l2?routeCtl(b):''}<div class="bar ${b.mood<30?'bad':b.mood<65?'warn':''}"><i style="width:${b.mood}%"></i></div><div class="meta">${tr('common.happiness_p',{p:Math.round(b.mood)})}</div></div>${btn(UI.confirm===b.id?tr('common.really_drop'):tr('common.drop'),'dropBiz',{id:b.id},'ghost sm')}</div>`;
|
||||
for(const b of bz)h+=`<div class="row"><div class="grow"><div class="nm">${esc(b.name)}</div><div class="meta">${esc(BIZ_T[b.type].l)}${b.city2?` ${CITY[b.city].name} ⇄ ${CITY[b.city2].name}`:''} · ${bTerms(b)}${BIZ_T[b.type].l2?` · ${b.sites?tr('city_panel.carrying_g_per_site',{g:fmtG(R.l2[b.id]||0)}):tr('city_panel.carrying_g',{g:fmtG(R.l2[b.id]||0)})}`:''}${BIZ_T[b.type].fiber&&!fiberOk(b)?' · <b style="color:var(--bad)">'+tr('city_panel.fiber_is_down')+'</b>':''}${BIZ_T[b.type].event&&eventLive(b)?` · <b>${tr('city_panel.serving_v',{v:pct(sfOf(R,b.city))})}</b>`:''}${b.type==='scrub'&&!hasScrub()?' · <b style="color:var(--bad)">'+tr('common.needs_a_scrubbing_center')+'</b>':''}${S.day-(b.since||0)<15?` · <b>${tr('common.provisioning_n_d_grace',{n:15-(S.day-(b.since||0))})}</b>`:''}</div>${bRisk(b)}${reqList(b)}${BIZ_T[b.type].l2?routeCtl(b):''}<div class="bar ${b.mood<30?'bad':b.mood<65?'warn':''}"><i style="width:${b.mood}%"></i></div><div class="meta">${tr('common.happiness_p',{p:Math.round(b.mood)})}</div></div>${btn(UI.confirm===b.id?tr('common.really_drop'):tr('common.drop'),'dropBiz',{id:b.id},'ghost sm')}</div>`;
|
||||
h+=`</section>`+offersHere(c);
|
||||
}else if(UI.tab==='up'){
|
||||
h+=portNote(c)+latNote(c);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ function dfPanel(l){
|
|||
}
|
||||
function offersHere(c){
|
||||
const os=S.offers.filter(o=>bCities(o).includes(c));if(!os.length)return '';
|
||||
return `<section><h3>${tr('common.offers_here')}</h3>${os.map(o=>`<div class="row"><div class="grow"><div class="nm">${esc(o.name)}</div><div class="meta">${esc(BIZ_T[o.type].l)}${o.city2?` ${CITY[o.city].name} ⇄ ${CITY[o.city2].name}`:''} · ${bTerms(o)} · ${tr('ui.n_d_left',{n:o.exp-S.day})}</div>${R.reach<0.99&&!BIZ_T[o.type].l2?`<div class="why">${tr('link_panels.they_need_the_full_internet_your',{pct:pct(R.reach)})}</div>`:''}${o.type==='scrub'&&!hasScrub()?`<div class="why">${tr('link_panels.needs_your_own_scrubbing_center')}</div>`:''}${reqList(o)}${bHas(o)?'':`<div class="why">${tr('link_panels.needs_a_pop_in_cities_too',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}</div>`}</div>${bHas(o)?btn(tr('common.accept'),'accept',{id:o.id},'green sm'):''}${btn(tr('common.no'),'decline',{id:o.id},'ghost sm')}</div>`).join('')}</section>`;
|
||||
return `<section><h3>${tr('common.offers_here')}</h3>${os.map(o=>`<div class="row"><div class="grow"><div class="nm">${esc(o.name)}</div><div class="meta">${esc(BIZ_T[o.type].l)}${o.city2?` ${CITY[o.city].name} ⇄ ${CITY[o.city2].name}`:''} · ${bTerms(o)} · ${tr('ui.n_d_left',{n:o.exp-S.day})}</div>${R.reach<0.99&&!BIZ_T[o.type].l2?`<div class="why">${tr('link_panels.they_need_the_full_internet_your',{pct:pct(R.reach)})}</div>`:''}${o.type==='scrub'&&!hasScrub()?`<div class="why">${tr('link_panels.needs_your_own_scrubbing_center')}</div>`:''}${bRisk(o)}${reqList(o)}${bHas(o)?'':`<div class="why">${tr('link_panels.needs_a_pop_in_cities_too',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}</div>`}</div>${bHas(o)?btn(tr('common.accept'),'accept',{id:o.id},'green sm'):''}${btn(tr('common.no'),'decline',{id:o.id},'ghost sm')}</div>`).join('')}</section>`;
|
||||
}
|
||||
function linkPanel(id){
|
||||
const l=S.links.find(x=>x.id===id);if(!l){UI.sel=null;return '';}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ const SCN_PROG={stg:()=>[{l:tr('common.reach'),v:R.reach,max:0.45,txt:`${pct(R.r
|
|||
darien:()=>[...['bog','lim','scl','sao'].map(c=>pChk(tr('progress.pop_in_city',{city:CITY[c].name}),!!S.pops[c])),pSrv(150)],
|
||||
gangnam:()=>[pReach(),pSrv(200)],
|
||||
fttb:()=>[...AU_BB.map(c=>pChk(tr('progress.broadband_in_city',{city:CITY[c].name}),!!(S.pops[c]&&S.pops[c].bb))),{l:tr('common.cables_overseas'),v:Math.min(2,auExits()),max:2,txt:`${auExits()} / 2`}],
|
||||
flood:()=>{const ok=S.stats.ddosOk||0,big=S.stats.ddosOkBig||0,a=S.ev.ddos&&S.ev.ddos.until>S.day?S.ev.ddos:null;
|
||||
return [{l:tr('common.floods_held'),v:ok,max:20,txt:`${ok} / 20`},{l:tr('progress.terabit_floods_held'),v:big,max:5,txt:`${big} / 5`},{l:tr('progress.floods_that_got_through'),v:0,max:0,txt:String(S.stats.ddosLost||0)}].concat(a?[{l:tr('progress.under_attack_now'),v:0,max:0,txt:`${fmtG(a.gbps)} · ${CITY[a.city].name} · ${pct(a.worst===undefined?1:a.worst)}`}]:[]);},baltic:()=>[{l:tr('progress.days_in_a_row_with_99'),v:S.stats.clean||0,max:90,txt:tr('progress.n_of_m',{n:S.stats.clean||0,m:90})}]};
|
||||
flood:()=>{const ok=S.stats.ddosOk||0,big=S.stats.ddosOkBig||0,attacks=ddosAll();
|
||||
return [{l:tr('common.floods_held'),v:ok,max:20,txt:`${ok} / 20`},{l:tr('progress.terabit_floods_held'),v:big,max:5,txt:`${big} / 5`},{l:tr('progress.floods_that_got_through'),v:0,max:0,txt:String(S.stats.ddosLost||0)}].concat(attacks.map(a=>({l:tr('progress.under_attack_now'),v:0,max:0,txt:`${fmtG(a.gbps)} · ${CITY[a.city].name} · ${pct(a.worst===undefined?1:a.worst)}`})));},baltic:()=>[{l:tr('progress.days_in_a_row_with_99'),v:S.stats.clean||0,max:90,txt:tr('progress.n_of_m',{n:S.stats.clean||0,m:90})}]};
|
||||
function scnProg(){const sc=S&&S.scn;if(!sc)return null;
|
||||
if(sc.id==='weekly')return {goal:tr('common.serve_as_much_traffic_as_you'),items:[{l:tr('progress.your_score_peak_traffic'),v:0,max:0,txt:fmtG(S.stats.peak||0)}],f:Math.min(1,S.day/sc.days)};
|
||||
const def=SCN.find(x=>x.id===sc.id),fn=SCN_PROG[sc.id];if(!def)return null;let items=[];try{items=fn?fn():[];}catch(e){items=[];}
|
||||
|
|
|
|||
|
|
@ -30,5 +30,5 @@ function custSection(){const F=UI.kf||{};let h=`<div class="panel2" id="custSec"
|
|||
const trend=b=>b.pm===undefined||Math.abs(b.mood-b.pm)<0.05?'':b.mood>b.pm?' <span style="color:var(--eye)">▲</span>':' <span style="color:var(--bad)">▼</span>';
|
||||
const sorts=[['mood',tr('common.happiness')],['mo',tr('common.per_month')],['name',tr('common.name')],['city',tr('common.where')]];
|
||||
h+=`<div class="seg" style="margin-bottom:4px">${sorts.map(([k,l])=>btn(l+(sk===k?(dir>0?' ▲':' ▼'):''),'custSort',{k},sk===k?'pink sm':'ghost sm')).join('')}</div>`;
|
||||
h+=rows.slice(0,listN('cust')).map(b=>{const why=bizWhy(b),grace=S.day-(b.since||0)<15;return `<div class="row"><div class="grow"><div class="nm">${esc(b.name)} <span class="meta">${esc(BIZ_T[b.type].l)}</span></div><div class="meta">${esc(where(b))} · ${BIZ_T[b.type].event?esc(bTerms(b)):tr('common.price_mo',{price:fmt$(bizMo(b))})}${grace?` · ${tr('common.provisioning_n_d_grace',{n:15-(S.day-(b.since||0))})}`:''}</div>${why.length?`<div class="why">${why.map(esc).join(' · ')}</div>`:''}<div class="bar ${moodCls(b.mood)}"><i style="width:${b.mood}%"></i></div><div class="meta">${tr('common.happiness_p',{p:Math.round(b.mood)})}${trend(b)}</div></div>${btn(tr('common.open'),'custGo',{id:b.id},'ghost sm')}</div>`;}).join('');
|
||||
h+=rows.slice(0,listN('cust')).map(b=>{const why=bizWhy(b),grace=S.day-(b.since||0)<15;return `<div class="row"><div class="grow"><div class="nm">${esc(b.name)} <span class="meta">${esc(BIZ_T[b.type].l)}</span></div><div class="meta">${esc(where(b))} · ${BIZ_T[b.type].event?esc(bTerms(b)):tr('common.price_mo',{price:fmt$(bizMo(b))})}${grace?` · ${tr('common.provisioning_n_d_grace',{n:15-(S.day-(b.since||0))})}`:''}</div>${bRisk(b)}${why.length?`<div class="why">${why.map(esc).join(' · ')}</div>`:''}<div class="bar ${moodCls(b.mood)}"><i style="width:${b.mood}%"></i></div><div class="meta">${tr('common.happiness_p',{p:Math.round(b.mood)})}${trend(b)}</div></div>${btn(tr('common.open'),'custGo',{id:b.id},'ghost sm')}</div>`;}).join('');
|
||||
return h+listMore('cust',rows.length,n=>trn('customers.n_more_customer',n))+`</div>`;}
|
||||
|
|
|
|||
|
|
@ -779,6 +779,7 @@
|
|||
"common.95th_percentile":"95th percentile",
|
||||
"common.about_average":"about average",
|
||||
"common.accept":"Accept",
|
||||
"common.ack_flood":"ACK flood",
|
||||
"common.ad_campaign":"Ad campaign!",
|
||||
"common.africa":"Africa",
|
||||
"common.all_cities":"All cities",
|
||||
|
|
@ -902,6 +903,7 @@
|
|||
"common.demand":"Demand",
|
||||
"common.deploy":"Deploy",
|
||||
"common.deployed":"deployed",
|
||||
"common.distributed_ingress":"Distributed ingress",
|
||||
"common.diverse":"diverse",
|
||||
"common.diverse_route":"diverse route",
|
||||
"common.dns_reflection":"DNS reflection",
|
||||
|
|
@ -1059,6 +1061,7 @@
|
|||
"common.may":"May",
|
||||
"common.member":"− member",
|
||||
"common.member_fef5":"Member",
|
||||
"common.memcached_amplification":"Memcached amplification",
|
||||
"common.merchant_silicon":"merchant silicon",
|
||||
"common.mercury":"Mercury",
|
||||
"common.metaverse_platform":"Metaverse platform",
|
||||
|
|
@ -1161,6 +1164,7 @@
|
|||
"common.price_lock":"Price lock",
|
||||
"common.price_mo":"{price}/mo",
|
||||
"common.provisioning_n_d_grace":"provisioning, {n}d grace",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Rank",
|
||||
"common.rare":"Rare",
|
||||
"common.reach":"Reach",
|
||||
|
|
@ -1275,6 +1279,7 @@
|
|||
"common.subsea_cables":"Subsea cables",
|
||||
"common.supply_chain":"Supply chain",
|
||||
"common.syn_flood":"SYN flood",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestrial",
|
||||
"common.terrestrial_19e4":"Terrestrial",
|
||||
"common.terrestrial_fiber":"Terrestrial fiber",
|
||||
|
|
@ -1406,6 +1411,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>You need a POP in every city on the contract first.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} extra for {d} days, {when} · pays {fee} when it is over",
|
||||
"customers_and_events.day_n_of_d":"day {n} of {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"Gaming attracts attacks",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} fiber pairs in your {a}–{b} trench. Trenching was the expensive part, so they want all of it",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} sites: {list} · {bw} per site · {price}/mo",
|
||||
"customers_and_events.name_at_site":"{name} at {site}",
|
||||
|
|
@ -1622,6 +1628,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"A trawler off Ostend dragged its gear straight through your {a}–{b} cable. The North Sea is about thirty metres deep and full of boats.",
|
||||
"failures.a_visiting_engineer_from_london":"A visiting engineer from London brought Marmite to the {city} NOC. Diplomatic relations broke down, and so did your router while everyone argued.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"A wind-farm service vessel dropped anchor on your {a}–{b} cable. It was there to fix a turbine.",
|
||||
"failures.across_n_transit_and_peering_ports":", across {n} transit and peering ports",
|
||||
"failures.all_n_links_in_that_trench":"All {n} links in that trench went down with it.",
|
||||
"failures.an_automation_script_in_city_ran":"An automation script in {city} ran “sed” on the whole config instead of one line. Every interface is now named “TODO”.",
|
||||
"failures.an_earthquake_shook_your_a_b":"An earthquake shook your {a}–{b} fiber loose somewhere above 4,000 metres.",
|
||||
|
|
@ -1984,13 +1991,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"A leap second convinced one of your routers it is 1970. Uptime now reads minus 56 years. Traffic is fine.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"A route you withdrew in Year 1 is still visible somewhere in the internet. Nobody knows where. It is fine. Probably.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"A two-hour meeting about router hostnames ended with a vote for “router-final-v2-NEW”.",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"After upstream scrubbing: {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"An auditor asked for a network diagram. You sent the game map. They approved it.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Attack fully mitigated",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Blackhole the target (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"Blackholed: the junk is gone, and so is {city}. The attack got what it wanted.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Contained on your sacrificial {net} PNI",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec cannot catch an {vec} (application layer)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"Flowspec on your {model} is dropping {vec} at the edge",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"Flowspec on your {model} trims {vec}, but its TCAM is small",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Edge filters dropping: {g}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec cannot catch {vec}",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec dropping: {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec dropping: {g}; some ingress routers have no TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} is leaking through",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"It was DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"IX blackhole <small>~half honour it</small>",
|
||||
|
|
@ -2001,29 +2012,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Load-bearing typo",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"Management declared a change freeze. Someone made a change to announce the change freeze.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"{name} transit LAG in {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} is scrubbing it upstream (clean-pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"No Flowspec filtering: ingress routers have no TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"No scrubbing center",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"No scrubbing needed after edge mitigation",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"On-demand scrubbing diverting, live in {n}d",
|
||||
"incidents_and_ddos.open_to_work":"Open to work",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"PNI LAG with {name} in {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Reaching your network: {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"RTBH is free and instant, but it drops everything to the victim, attack and customer alike. An IX blackhole keeps the customer up but only about half the members honour it. HackBack 3000™ by Skynot AI sometimes ends it, and sometimes flattens an innocent and earns you a fine.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Scrubbing centers unavailable or at capacity",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Scrubbing in {city}: {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Scrubbing traffic hauled over your backbone: {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · {n}d left",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Someone deleted the DNS record for the internal wiki. The runbook for fixing DNS was on the wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Someone named a VLAN “prodcution”. It is now load-bearing and can never be renamed.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"The TLS certificate on your NOC dashboard expired. Nobody can see any graphs, so technically there are no problems.",
|
||||
"incidents_and_ddos.this_attack_g":"This attack: {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Ticket of the week",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"{tier} scrubbing in {city} is cleaning it, hauled over your backbone (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"{tier} scrubbing in {city} is cleaning it",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"Vendor support asked you to “try turning it off and on again”. For the router you already rebooted. Ticket closed.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"You found a 10G link in the inventory that nobody ordered, nobody pays for, and that carries 3 Gbps of something.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Your backbone can only haul {g} of it to {city}: the rest is not scrubbed",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Your IP address spreadsheet hit 1,048,576 rows. Excel has opinions.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Your IPv6 traffic grew 400%. From one packet to five.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Your {model} here has no Flowspec TCAM",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Your monitoring system went down. You found out because nothing alerted. Very peaceful week.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Your peering coordinator updated their profile to “open to work”. Three Tier 1s suddenly want to chat. Nothing happened, but it felt nice.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"Your scrubbing centers are full: {g} leaks past",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"Your upstream support line plays the same 11 seconds of hold music. Your on-call engineer can now hum it in four keys.",
|
||||
"install.before_you_start":"Before you start",
|
||||
"install.best_played_as_an_app":"Best played as an app",
|
||||
|
|
|
|||
|
|
@ -2,6 +2,16 @@ const test = require('node:test');
|
|||
const assert = require('node:assert/strict');
|
||||
const { load, seed } = require('./harness');
|
||||
|
||||
test('daily DDoS spawns share one routing calculation and score their first active day', () => {
|
||||
const { ev, errors } = load();
|
||||
// The busier DDoS schedule needs spicy chaos (or gaming customers): stand in for the chaos rule here.
|
||||
ev("window.rule=k=>k==='chaos'?'spicy':undefined;ACT.start({});S.cash=1e9;S.day=50;S.nextFail=1e9;S.nextEvent=1e9;ACT.launchBB({city:'fra'});S.pops.fra.bb.d=200;ACT.buyTransit({city:'fra',net:'cog',tier:1});compute();window.__compute=compute;window.__random=Math.random;window.__computes=0;compute=()=>{window.__computes++;window.__compute()};Math.random=()=>0;dayTick();compute=window.__compute;Math.random=window.__random");
|
||||
assert.equal(ev('ddosAll().length'), 2, 'both daily spawn opportunities were used');
|
||||
assert.equal(ev('window.__computes'), 1, 'daily spawns do not reroute the whole network individually');
|
||||
assert.ok(ev('ddosAll().every(a=>a.worst===ddosSf(a))'), 'first-day service is recorded after routing');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('page boots to the title screen without errors', () => {
|
||||
const { ev, errors } = load();
|
||||
assert.equal(ev("document.getElementById('modal').hidden"), false);
|
||||
|
|
@ -197,6 +207,52 @@ test('Flowspec is a router-model capability, and each tool answers a flood', ()
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('a distributed SYN flood reports actual Flowspec drops and sends only the remainder to scrubbing', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.scrubs=[{city:'fra',tier:0}];S.scrubMode='always';S.ev.ddos={id:'syn',city:'fra',vec:'syn',gbps:30.2,start:0,until:7,entries:[{k:'edge',city:'fra',share:1}]};compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).flowspec'), 0);
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).sp.parts[0].cleaned'), 30.2);
|
||||
assert.match(ev('ddosPanel()'), /— No Flowspec filtering: ingress routers have no TCAM/);
|
||||
assert.match(ev('ddosPanel()'), /✓ Scrubbing in Frankfurt: 30\.2 Gbps \/ 100G/);
|
||||
assert.doesNotMatch(ev('ddosPanel()'), /✓ Flowspec|After upstream scrubbing|Reaching your network/);
|
||||
for (const [router, dropped, scrubbed] of [[1,18.12,12.08], [3,25.67,4.53]]) {
|
||||
ev(`S.pops.fra.rgen=${router};compute()`);
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).flowspec')-dropped)<1e-9);
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).sp.parts[0].cleaned')-scrubbed)<1e-9);
|
||||
assert.match(ev('ddosPanel()'), new RegExp('✓ Flowspec dropping: '+dropped.toFixed(1).replace('.', '\\.')+' Gbps'));
|
||||
assert.match(ev('ddosPanel()'), new RegExp('Scrubbing in Frankfurt: '+scrubbed.toFixed(1).replace('.', '\\.')+' Gbps / 100G'));
|
||||
assert.doesNotMatch(ev('ddosPanel()'), /no TCAM|Edge filters dropping/);
|
||||
}
|
||||
ev("S.ev.ddos.vec='ack';compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).flowspec'), 0);
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).sp.parts[0].cleaned'), 30.2);
|
||||
assert.match(ev('ddosPanel()'), /— Flowspec cannot catch ACK flood/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('Flowspec accounts for each ingress router, upstream cleaning and other edge filters separately', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=6;ACT.buildPop({city:'nyc'});S.pops.nyc.rgen=3;S.transit=[{id:'tf',city:'fra',net:'cog',tier:1},{id:'tn',city:'nyc',net:'cog',tier:1}];S.scrubs=[{city:'fra',tier:0},{city:'nyc',tier:0}];S.ev.ddos={id:'syn',city:'fra',vec:'syn',gbps:30.2,start:0,until:7,entries:[{k:'t',id:'tf',city:'fra',share:0.5},{k:'t',id:'tn',city:'nyc',share:0.5}]};compute()");
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).flowspec')-12.835)<1e-9);
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).sp.parts.reduce((n,x)=>n+x.cleaned,0)')-17.365)<1e-9);
|
||||
assert.match(ev('ddosPanel()'), /~ Flowspec dropping: 12\.8 Gbps; some ingress routers have no TCAM/);
|
||||
assert.match(ev('ddosPanel()'), /Scrubbing in Frankfurt: 15\.1 Gbps \/ 100G/);
|
||||
assert.match(ev('ddosPanel()'), /Scrubbing in New York: 2\.3 Gbps \/ 100G/);
|
||||
assert.equal(ev('ddosMitigation(S.ev.ddos).flowspec'), ev('ddosReport(S.ev.ddos).flowspec'), 'uncached reports also filter at the ingress instead of the target');
|
||||
ev('S.transit[1].clean=true;compute()');
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).reaching')-16.61)<1e-9);
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).flowspec')-1.2835)<1e-9);
|
||||
assert.match(ev('ddosPanel()'), /✓ After upstream scrubbing: 16\.6 Gbps/);
|
||||
assert.match(ev('ddosPanel()'), /~ Flowspec dropping: 1\.3 Gbps/);
|
||||
ev("S.pops.fra.rgen=3;S.ixp={fra:1,nyc:1};S.ev.ddos.ixbh=true;compute()");
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).flowspec')-14.1185)<1e-9);
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).filtered-ddosReport(S.ev.ddos).flowspec')-1.24575)<1e-9);
|
||||
assert.match(ev('ddosPanel()'), /✓ Flowspec dropping: 14\.1 Gbps/);
|
||||
assert.match(ev('ddosPanel()'), /✓ Edge filters dropping: 1\.2 Gbps/);
|
||||
assert.ok(ev('Math.abs(ddosReport(S.ev.ddos).reaching-ddosReport(S.ev.ddos).filtered-ddosReport(S.ev.ddos).sp.parts.reduce((n,x)=>n+x.cleaned,0)-ddosReport(S.ev.ddos).leak)<1e-9'));
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('RTBH blackholes the victim, and HackBack 3000 is a gamble', () => {
|
||||
const { ev } = load();
|
||||
ev("ACT.start({});S.cash=1e8;ACT.launchBB({city:'fra'});S.pops.fra.bb.d=120;ACT.buyTransit({city:'fra',net:'cog',tier:1});compute()");
|
||||
|
|
@ -593,3 +649,495 @@ test('a custom metric belongs to the city pair, like the presets, and a standby
|
|||
assert.equal(ev("FK in S.pairMet"), false);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
||||
test('Memcached amplification and ACK flood are available without gaming customers and respect Flowspec', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e8;ACT.launchBB({city:'fra'});S.pops.fra.bb.d=200;ACT.buyTransit({city:'fra',net:'cog',tier:1});RG[0].fs=2");
|
||||
assert.equal(ev('S.biz.length'), 0);
|
||||
assert.equal(ev('DDOS_VEC.memcached.fs'), true);
|
||||
assert.equal(ev('DDOS_VEC.ack.fs'), false);
|
||||
ev("S.ev.ddos={city:'fra',vec:'ack',gbps:300,until:S.day+3,start:S.day};compute()");
|
||||
const ack = ev('R.served');
|
||||
assert.match(ev('ddosPanel()'), /ACK flood/);
|
||||
assert.doesNotMatch(ev('ddosPanel()'), /application layer/);
|
||||
ev("S.ev.ddos.vec='memcached';compute()");
|
||||
assert.ok(ev('R.served') > ack, 'Flowspec filters Memcached but cannot filter ACK');
|
||||
for (const vec of ['memcached', 'ack']) {
|
||||
ev(`const old=Math.random;Math.random=()=>(${['dns','ntp','memcached','ack'].indexOf(vec)}+0.1)/ddosVectors().length;ddosAttack();Math.random=old`);
|
||||
assert.equal(ev('ddosAll().at(-1).vec'), vec, 'the generator can select each new vector');
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
||||
test('DDoS accounting conserves attack bandwidth through upstream, edge and local scrubbing', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;ACT.launchBB({city:'fra'});ACT.buyTransit({city:'fra',net:'cog',tier:1});S.pops.fra.bb.d=100;S.scrubs=[{city:'fra',tier:1}];S.transit[0].clean=true;S.ev.ddos={city:'fra',vec:'http',gbps:1842,until:5,start:0,entry:{k:'t',id:S.transit[0].id}};compute()");
|
||||
assert.ok(Math.abs(ev('R.ddos[0].reaching') - 184.2) < 1e-9);
|
||||
assert.equal(ev('R.ddos[0].sp.parts[0].cleaned'), ev('R.ddos[0].reaching'));
|
||||
assert.equal(ev('R.ddos[0].leak'), 0, 'the 1T center cleans the upstream remainder');
|
||||
assert.doesNotMatch(ev('ddosPanel()'), /842 Gbps of attack traffic leaks/);
|
||||
ev('S.transit[0].clean=false;compute()');
|
||||
assert.equal(ev('R.ddos[0].reaching'), 1842);
|
||||
assert.equal(ev('R.ddos[0].leak'), 842);
|
||||
for (const setup of ["S.transit[0].clean=true", "RG[0].fs=2;S.ev.ddos.vec='dns'", "S.scrubs=[]"]) {
|
||||
ev(setup+';compute()');
|
||||
assert.ok(ev('Math.abs(R.ddos[0].reaching-R.ddos[0].filtered-(R.ddos[0].sp?.parts.reduce((n,x)=>n+x.cleaned,0)||0)-R.ddos[0].leak)<1e-9'));
|
||||
assert.ok(ev('R.ddos[0].leak<=R.ddos[0].reaching'));
|
||||
}
|
||||
// On-demand diversion must also work for an attack which began on day zero.
|
||||
ev("S.scrubs=[{city:'fra',tier:1}];S.scrubMode='ondemand';S.day=2;compute()");
|
||||
assert.equal(ev('R.ddos[0].leak'), 0);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
||||
test('the NOC integrates DDoS mitigation totals into each live attack card without duplicate summaries on phones', () => {
|
||||
const { ev, errors, dom } = load();
|
||||
ev('ACT.start({})');
|
||||
Object.defineProperty(dom.window, 'innerWidth', { value: 360, configurable: true });
|
||||
ev("S.cash=1e9;ACT.buyTransit({city:'fra',net:'cog',tier:1});S.transit[0].clean=true;S.scrubs=[{city:'fra',tier:1}];S.ev.ddos={city:'fra',vec:'http',gbps:3840,until:5,start:0,entry:{k:'t',id:S.transit[0].id}};compute();UI.left='noc';UI.leftOpen=true;renderLeft()");
|
||||
const card = () => dom.window.document.querySelector('[data-act="rtbh"], [data-act="unrtbh"]').closest('.inc');
|
||||
const text = () => card().textContent;
|
||||
assert.match(card().querySelector('.nm').textContent, /🚨 Live attack: Frankfurt/);
|
||||
assert.equal(dom.window.document.querySelector('.ddos-stats'), null, 'use the existing attack card');
|
||||
assert.doesNotMatch(text(), /DDoS mitigation status|Attack size:|3840 Gbps|This attack:/);
|
||||
assert.equal(text().match(/3\.84 Tbps/g).length, 1, 'the attack size appears once');
|
||||
assert.match(text(), /✓ After upstream scrubbing: 384 Gbps/);
|
||||
assert.equal(text().match(/After upstream scrubbing/g).length, 1, 'show the upstream remainder once');
|
||||
assert.doesNotMatch(text(), /Reaching your network|reaching your network|Upstream scrubbing active/);
|
||||
assert.match(text(), /✓ Scrubbing in Frankfurt: 384 Gbps \/ 1T/);
|
||||
assert.match(text(), /✓ Attack fully mitigated/);
|
||||
ev('S.transit[0].clean=false;compute();renderLeft()');
|
||||
assert.doesNotMatch(text(), /After upstream scrubbing|Reaching your network/);
|
||||
assert.equal(text().match(/3\.84 Tbps/g).length, 1, 'inactive upstream scrubbing does not repeat the attack size');
|
||||
assert.match(text(), /✓ Scrubbing in Frankfurt: 1\.00 Tbps \/ 1T/);
|
||||
assert.match(text(), /~ 2\.84 Tbps is leaking through/);
|
||||
assert.equal(text().match(/leaking through/g).length, 1, 'show the mitigation outcome once');
|
||||
assert.doesNotMatch(text(), /Upstream scrubbing|Attack fully mitigated|leaks past mitigation/);
|
||||
ev("S.transit[0].clean=true;S.pops.fra.rgen=3;S.ev.ddos.vec='dns';compute();renderLeft()");
|
||||
assert.match(text(), /✓ Flowspec dropping: 326 Gbps/);
|
||||
assert.doesNotMatch(text(), /Edge filters dropping/);
|
||||
assert.match(text(), /✓ Scrubbing in Frankfurt: 57\.6 Gbps \/ 1T/);
|
||||
assert.match(text(), /✓ Attack fully mitigated/);
|
||||
ev('ACT.rtbh();renderLeft()');
|
||||
assert.match(text(), /~ Blackholed: the junk is gone, and so is Frankfurt/);
|
||||
assert.equal(text().match(/Blackholed:/g).length, 1);
|
||||
assert.doesNotMatch(text(), /After upstream scrubbing|reaching your network|scrubbing in Frankfurt|Attack fully mitigated|leaking through/i);
|
||||
assert.ok(card().querySelector('[data-act="unrtbh"]'), 'the existing controls stay in the card');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('overlapping floods share scrubbing capacity, have separate controls, and finish independently', () => {
|
||||
const { ev, errors, dom } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.nextFail=1e9;S.nextEvent=1e9;ACT.buyTransit({city:'fra',net:'cog',tier:1});S.scrubs=[{city:'fra',tier:1}];S.ev.ddos={id:'one',city:'fra',vec:'http',gbps:700,start:0,until:3};S.ev.ddosMore=[{id:'two',city:'fra',vec:'http',gbps:700,start:0,until:5}];compute();UI.left='noc';UI.leftOpen=true;renderLeft()");
|
||||
assert.equal(ev('R.ddos.length'), 2);
|
||||
assert.equal(ev('R.ddos.reduce((n,m)=>n+(m.sp?.parts.reduce((v,x)=>v+x.cleaned,0)||0),0)'), 1000);
|
||||
assert.equal(ev('R.ddos.reduce((n,m)=>n+m.leak,0)'), 400, 'one center cannot spend its capacity twice');
|
||||
const cards = [...dom.window.document.querySelectorAll('[data-act="rtbh"]')].map(b=>b.closest('.inc'));
|
||||
assert.equal(cards.length, 2);
|
||||
assert.match(cards[1].textContent, /✓ Scrubbing in Frankfurt: 1\.00 Tbps \/ 1T · This attack: 300 Gbps/);
|
||||
ev("ACT.rtbh({id:'two'})");
|
||||
assert.equal(ev("S.ev.ddos.bh||false"), false, 'the selected attack gets the control');
|
||||
assert.equal(ev('S.ev.ddosMore[0].bh'), true);
|
||||
assert.ok(ev('R.ddos.every(m=>m.leak===0)'), 'blackholing a target city drops every flood to it');
|
||||
ev("ACT.unrtbh({id:'one'});const old=Math.random;Math.random=()=>0.1;ACT.hackback({id:'two'});Math.random=old");
|
||||
assert.equal(ev('ddosAll().length'), 1, 'hack-back ends only the selected attack');
|
||||
ev('S.day=3;ddosExpire();compute()');
|
||||
assert.equal(ev('ddosAll().length'), 0);
|
||||
assert.equal(ev('(S.stats.ddosOk||0)+(S.stats.ddosLost||0)'), 2, 'both attacks scored once');
|
||||
ev('ddosExpire()');
|
||||
assert.equal(ev('(S.stats.ddosOk||0)+(S.stats.ddosLost||0)'), 2);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('overlapping DDoS saves round trip and legacy attacks migrate safely', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.ev.ddos={city:'fra',vec:'dns',gbps:'80',until:7,start:0};delete S.ev.ddosMore;delete S.ddosStarts;S=migrate(JSON.parse(JSON.stringify(S)))");
|
||||
assert.equal(ev('ddosAll().length'), 1);
|
||||
assert.equal(ev('S.ev.ddos.gbps'), 80);
|
||||
assert.equal(ev('S.ev.ddosMore.length'), 0);
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(S.ddosStarts)')), [0]);
|
||||
ev("S.ev.ddosMore=[{id:'overlap',city:'fra',vec:'ack',gbps:50,until:5,start:0,sla:['customer']},null,{city:'bad',vec:'dns'}, {city:'fra',vec:'unknown'}];S.ddosStarts=[0,'bad',Infinity,-9,99];S=migrate(JSON.parse(JSON.stringify(S)))");
|
||||
assert.equal(ev('ddosAll().length'), 2);
|
||||
assert.equal(ev('S.ev.ddosMore[0].id'), 'overlap');
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(S.ddosStarts)')), [0]);
|
||||
ev('S=migrate(JSON.parse(JSON.stringify(S)));compute()');
|
||||
assert.equal(ev('R.ddos.length'), 2);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('simultaneous attacks each bill their protected customer only once', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.nextFail=1e9;S.nextEvent=1e9;ACT.launchBB({city:'fra'});S.pops.fra.bb.d=200;ACT.buyTransit({city:'fra',net:'cog',tier:1});S.biz=[{id:'protected',name:'Shield',city:'fra',type:'scrub',bw:5,rate:900,mood:100,since:0,reqs:[]}];S.ev.ddos={id:'one',city:'fra',vec:'http',gbps:6000,start:0,until:7};S.ev.ddosMore=[{id:'two',city:'fra',vec:'http',gbps:6000,start:0,until:7}];compute();dayTick()");
|
||||
assert.equal(ev('S.stats.sla'), 2, 'same-day attacks have separate SLA identities');
|
||||
ev('S=migrate(JSON.parse(JSON.stringify(S)));dayTick()');
|
||||
assert.equal(ev('S.stats.sla'), 2, 'reloading does not pay the same credits twice');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('DDoS frequency rises with level and signed gaming customers, with a rolling weekly ceiling', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.day=50;S.lvl=1;S.biz=[]");
|
||||
const base = ev('ddosRate()');
|
||||
assert.equal(base, 0.5);
|
||||
ev('S.lvl=13');
|
||||
assert.equal(ev('ddosRate()'), base, 'level alone does not increase the non-gaming rate');
|
||||
ev("S.biz=[{type:'game',city:'fra'}];S.lvl=1");
|
||||
const early = ev('ddosRate()');
|
||||
ev('S.lvl=13');
|
||||
const level = ev('ddosRate()');
|
||||
ev("S.biz=Array.from({length:20},(_,i)=>({type:i%2?'cgame':'game',city:'fra'}))");
|
||||
const gaming = ev('ddosRate()');
|
||||
assert.ok(base < early && early < level && level < gaming && gaming <= 7);
|
||||
ev("S.offers=Array.from({length:50},()=>({type:'game'}));S.biz=[];S.lvl=1");
|
||||
assert.equal(ev('ddosRate()'), base, 'unsigned offers do not attract attacks');
|
||||
// Force every random spawn opportunity (with spicy chaos on), then verify each rolling seven-day window.
|
||||
ev("window.rule=k=>k==='chaos'?'spicy':undefined;");
|
||||
ev('window.__starts=[];window.__oldRandom=Math.random;Math.random=()=>0');
|
||||
for (let day = 50; day < 66; day++) {
|
||||
ev(`S.day=${day};ddosTick();window.__starts.push(...ddosAll().filter(a=>a.start===S.day).map(a=>a.start))`);
|
||||
assert.ok(ev('S.ddosStarts.length') <= 14);
|
||||
}
|
||||
ev('Math.random=window.__oldRandom');
|
||||
const starts = JSON.parse(ev('JSON.stringify(window.__starts)'));
|
||||
for (let day = 50; day < 66; day++) assert.ok(starts.filter(d=>d>day-7&&d<=day).length <= 14);
|
||||
assert.ok(starts.length > 14, 'the allowance renews as starts leave the rolling window');
|
||||
ev('for(let i=0;i<30;i++)ddosAttack()');
|
||||
assert.equal(ev('S.ddosStarts.length'), 14, 'manual and incident starts cannot bypass the cap');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('DDoS sizes use a smaller non-gaming baseline and preserve unbounded Flood Season scaling', () => {
|
||||
const { ev, errors } = load();
|
||||
ev('ACT.start({});S.lvl=13;R.demand=150000;S.biz=[]');
|
||||
assert.equal(ev('ddosSizeMean()'), 20000);
|
||||
ev("S.scn={id:'flood',rules:{ddos:true}};S.day=365");
|
||||
assert.equal(ev('ddosSizeMean()'), 400000);
|
||||
ev('S.day=730');
|
||||
assert.equal(ev('ddosSizeMean()'), 600000, 'Flood Season keeps growing after completion');
|
||||
ev('S.scn=null;R.demand=300000');
|
||||
assert.equal(ev('ddosSizeMean()'), 40000, 'larger networks can draw still larger attacks');
|
||||
ev('S.lvl=1');
|
||||
const early = ev('ddosSizeMax()');
|
||||
ev('S.lvl=13');
|
||||
const late = ev('ddosSizeMax()');
|
||||
ev("S.biz=[{type:'game',city:'fra'}]");
|
||||
assert.ok(early < late && late < ev('ddosSizeMax()'));
|
||||
// Fixed quantiles show longer durations as both level and gaming exposure rise.
|
||||
ev('window.__oldRandom=Math.random;Math.random=()=>0.95;S.lvl=1;S.biz=[];ddosAttack();window.__earlyDur=ddosAll().at(-1).until-S.day;S.lvl=13;S.biz=Array.from({length:40},()=>({type:\'game\',city:\'fra\',bw:0,rate:0}));ddosAttack();Math.random=window.__oldRandom');
|
||||
assert.ok(ev('ddosAll().at(-1).until-S.day') > ev('window.__earlyDur'));
|
||||
assert.equal(ev('ddosAll().at(-1).until-S.day'), 7);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('distributed attacks follow normal transit and peering traffic across regions', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=6;ACT.buildPop({city:'nyc'});for(const c of ['fra','nyc']){S.pops[c].rgen=3;S.pops[c].bb={d:c==='fra'?100:300}}S.transit=[{id:'tf',city:'fra',net:'cog',tier:2},{id:'tn',city:'nyc',net:'cog',tier:2}];S.pni=[{id:'pf',city:'fra',net:'ggl',tier:1}];S.ixp={nyc:1};S.rs={nyc:true};compute();window.__normal=JSON.stringify(R.ingressPorts);ddosAttack()");
|
||||
const normal = JSON.parse(ev('window.__normal'));
|
||||
const entries = JSON.parse(ev('JSON.stringify(ddosAll()[0].entries)'));
|
||||
const total = Object.values(normal).reduce((n,p)=>n+p.traffic,0);
|
||||
assert.ok(entries.some(p=>p.k==='t') && entries.some(p=>p.k==='p') && entries.some(p=>p.k==='ix'));
|
||||
assert.deepEqual([...new Set(entries.map(p=>p.city))].sort(), ['fra','nyc']);
|
||||
for (const en of entries) assert.ok(Math.abs(en.share-normal[en.k+':'+en.id].traffic/total)<1e-9);
|
||||
assert.ok(Math.abs(entries.reduce((n,en)=>n+en.share,0)-1)<1e-9);
|
||||
assert.match(ev('ddosPanel()'), /Live attack:/);
|
||||
assert.doesNotMatch(ev('ddosPanel()'), /ports: .*regions:/, 'keep regional detail out of the live attack card');
|
||||
ev('S=migrate(JSON.parse(JSON.stringify(S)));compute()');
|
||||
assert.equal(ev('S.ev.ddos.entries.length'), entries.length, 'distributed shares survive a save round trip');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('distributed ingress applies upstream scrubbing only to its own port and uses regional centers', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=6;ACT.buildPop({city:'nyc'});for(const c of ['fra','nyc']){S.pops[c].rgen=3;S.pops[c].bb={d:100}}S.transit=[{id:'tf',city:'fra',net:'cog',tier:2,clean:true},{id:'tn',city:'nyc',net:'cog',tier:2}];S.scrubs=[{city:'fra',tier:0}];S.ev.ddos={id:'spread',city:'fra',vec:'http',gbps:1000,start:0,until:7,entries:[{k:'t',id:'tf',city:'fra',share:0.25},{k:'t',id:'tn',city:'nyc',share:0.75}]};compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).reaching'), 775);
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).leak'), 750);
|
||||
assert.equal(ev('R.useT.tn'), 400, 'the uncleaned flood fills its own ingress port');
|
||||
assert.ok(ev('R.useT.tf') < 200, 'it cannot spill into the cleaned port');
|
||||
assert.match(ev('ddosPanel()'), /✓ After upstream scrubbing: 775 Gbps/);
|
||||
assert.match(ev('ddosPanel()'), /~ 750 Gbps is leaking through/);
|
||||
ev("S.scrubs.push({city:'nyc',tier:1});compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).leak'), 0);
|
||||
assert.match(ev('ddosPanel()'), /✓ Scrubbing in Frankfurt: 25\.0 Gbps \/ 100G/);
|
||||
assert.match(ev('ddosPanel()'), /✓ Scrubbing in New York: 750 Gbps \/ 1T/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('scrubbing hauls retain their real source on each link when several cities use one center', () => {
|
||||
const { ev, errors, dom } = load();
|
||||
ev(`ACT.start({});S.cash=1e9;S.lvl=6;for(const c of ['prg','ber'])ACT.buildPop({city:c});
|
||||
for(const c in S.pops)S.pops[c].rgen=3;
|
||||
S.links=[{id:'fp1',a:'fra',b:'prg',kind:'wave',tier:2,km:409,mo:100},
|
||||
{id:'fp2',a:'fra',b:'prg',kind:'wave',tier:2,km:409,mo:100},
|
||||
{id:'fb',a:'fra',b:'ber',kind:'wave',tier:2,km:420,mo:100},
|
||||
{id:'pb',a:'prg',b:'ber',kind:'wave',tier:2,km:280,mo:100}];
|
||||
S.transit=[{id:'tp',city:'prg',net:'cog',tier:2},{id:'tb',city:'ber',net:'cog',tier:2}];
|
||||
S.scrubs=[{city:'fra',tier:1}];
|
||||
S.ev.ddos={id:'spread',city:'ber',vec:'ack',gbps:100,start:0,until:7,
|
||||
entries:[{k:'t',id:'tp',city:'prg',share:.5},{k:'t',id:'tb',city:'ber',share:.5}]};compute()`);
|
||||
const sources = id => JSON.parse(ev(`JSON.stringify(Object.entries(R.ef[edgeKey(S.links.find(l=>l.id==='${id}'))].eg)
|
||||
.filter(([key])=>key.startsWith('scrub:')).map(([key,g])=>({city:R.egDesc[key].city,g})).sort((a,b)=>a.city.localeCompare(b.city)))`));
|
||||
assert.equal(ev('R.load.pb||0'), 0, 'Berlin does not feed the Prague link');
|
||||
assert.deepEqual(sources('fp1').map(x=>x.city), ['prg']);
|
||||
assert.deepEqual(sources('fb').map(x=>x.city), ['ber']);
|
||||
assert.ok(sources('fp1')[0].g>0 && sources('fb')[0].g>0);
|
||||
assert.ok(Math.abs(sources('fp1')[0].g-ev('R.load.fp1+R.load.fp2'))<1e-9, 'the grouped record covers both parallel links exactly');
|
||||
ev("selectLink('fp1');draw(0)");
|
||||
const row = [...dom.window.document.querySelectorAll('#panelBody .row')].find(x=>x.querySelector('.nm')?.textContent==='Attack hauled to scrubbing in Frankfurt');
|
||||
assert.ok(row);
|
||||
assert.match(row.querySelector('.meta').textContent, /^Prague · /);
|
||||
assert.equal(JSON.parse(row.querySelector('[data-act="goEgress"]').dataset.args).city, 'prg');
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify([...UI.feed])')), ['prg'], 'the map highlights the same source as the inspected link');
|
||||
row.querySelector('[data-act="goEgress"]').click();
|
||||
assert.equal(ev('UI.sel.id'), 'prg', 'Open goes to the actual source city');
|
||||
// Reordering ingress and adding an overlapping flood must not change the attribution.
|
||||
ev("S.ev.ddos.entries.reverse();S.ev.ddosMore=[{...S.ev.ddos,id:'overlap',gbps:20,entries:S.ev.ddos.entries.slice().reverse()}];compute()");
|
||||
assert.deepEqual(sources('fp1').map(x=>x.city), ['prg']);
|
||||
assert.deepEqual(sources('fb').map(x=>x.city), ['ber']);
|
||||
// When Berlin's direct link fails, its haul really does join Prague's route.
|
||||
ev('S.links.find(l=>l.id==="fb").cut=S.day+1;compute()');
|
||||
assert.ok(ev('R.load.pb')>0);
|
||||
assert.deepEqual(sources('fp1').map(x=>x.city), ['ber','prg']);
|
||||
assert.deepEqual(sources('pb').map(x=>x.city), ['ber']);
|
||||
assert.ok(Math.abs(sources('fp1').reduce((n,x)=>n+x.g,0)-ev('R.load.fp1+R.load.fp2'))<1e-9, 'shared-path totals still equal the actual link load');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
function setupScrubLatency(ev) {
|
||||
ev(`ACT.start({});S.cash=1e9;S.lvl=6;for(const c of ['par','nyc','ams'])ACT.buildPop({city:c});
|
||||
for(const c in S.pops)S.pops[c].rgen=RG.findIndex(g=>g.fs===1);
|
||||
S.links=[{id:'pf',a:'par',b:'fra',kind:'wave',tier:3,km:620/1.3,mo:100},
|
||||
{id:'fn',a:'fra',b:'nyc',kind:'wave',tier:3,km:6000,mo:100},
|
||||
{id:'fa',a:'fra',b:'ams',kind:'wave',tier:3,km:200,mo:100}];
|
||||
S.transit=[{id:'tf',city:'fra',net:'cog',tier:2},{id:'tn',city:'nyc',net:'cog',tier:2}];
|
||||
S.scrubs=[{city:'fra',tier:0},{city:'par',tier:0}];
|
||||
S.ev.ddos={id:'par-flood',city:'par',vec:'dns',gbps:33.8,start:0,until:7,
|
||||
entries:[{k:'t',id:'tf',city:'fra',share:0.65},{k:'t',id:'tn',city:'nyc',share:0.35}]};compute()`);
|
||||
}
|
||||
|
||||
test('distributed ingress does not give a locally protected victim a remote scrubbing latency', () => {
|
||||
const { ev, errors, dom } = load();
|
||||
setupScrubLatency(ev);
|
||||
assert.ok(ev("R.haul.some(q=>q.city==='nyc'&&q.to==='par'&&q.ms>60)"), 'the remote ingress still travels to its scrubbing center');
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).sp.parts.length'), 2, 'both centers clean the distributed flood');
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).flowspec')-20.28)<1e-9);
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).leak'), 0);
|
||||
Object.defineProperty(dom.window, 'innerWidth', { value: 360, configurable: true });
|
||||
ev("UI.left='noc';UI.leftOpen=true;renderLeft()");
|
||||
const text = dom.window.document.getElementById('left').textContent;
|
||||
assert.match(text, /Live attack: Paris/);
|
||||
assert.match(text, /Scrubbing in Frankfurt: 8\.8 Gbps/);
|
||||
assert.match(text, /Scrubbing in Paris: 4\.7 Gbps/);
|
||||
assert.doesNotMatch(text, /Scrubbing traffic hauled over your backbone|\+\d+(\.\d+)? ms/);
|
||||
// A local center is still nearest when it is full and other centers take overflow.
|
||||
ev("S.ev.ddos.vec='ack';S.ev.ddos.gbps=300;compute()");
|
||||
assert.doesNotMatch(ev('ddosOne(S.ev.ddos)'), /Scrubbing traffic hauled over your backbone/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('each attack shows only the nearest scrubbing detour using precise one-way link latency', () => {
|
||||
const { ev, errors } = load();
|
||||
setupScrubLatency(ev);
|
||||
ev("for(const c in S.pops)S.pops[c].rgen=3;S.scrubs=[{city:'fra',tier:0},{city:'ams',tier:0}];S.ev.ddos.vec='ack';S.ev.ddos.gbps=230;compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).sp.parts.length'), 2, 'capacity spills between centers');
|
||||
const card = ev('ddosOne(S.ev.ddos)');
|
||||
assert.equal((card.match(/Scrubbing traffic hauled over your backbone/g)||[]).length, 1);
|
||||
assert.match(card, /✓ Scrubbing traffic hauled over your backbone: Paris → Frankfurt \(\+3\.1 ms\)/);
|
||||
// An overlapping attack has its own victim and nearest center.
|
||||
ev("S.ev.ddosMore=[{id:'other',city:'ams',vec:'ack',gbps:10,start:0,until:7,entries:[{k:'t',id:'tn',city:'nyc',share:1}]}];compute()");
|
||||
assert.doesNotMatch(ev('ddosOne(S.ev.ddosMore[0])'), /Scrubbing traffic hauled over your backbone/);
|
||||
assert.match(ev('ddosOne(S.ev.ddos)'), /Paris → Frankfurt \(\+3\.1 ms\)/);
|
||||
// Ignore a failed nearby center and use the live path to Amsterdam.
|
||||
ev("S.pops.fra.down=10;S.links.push({id:'pa',a:'par',b:'ams',kind:'wave',tier:3,km:2000,mo:100});S.ev.ddos.entries=[{k:'edge',city:'par',share:1}];compute()");
|
||||
assert.match(ev('ddosOne(S.ev.ddos)'), /Paris → Amsterdam \(\+13\.0 ms\)/);
|
||||
ev('S.ev.ddos.bh=true;compute()');
|
||||
assert.doesNotMatch(ev('ddosOne(S.ev.ddos)'), /Scrubbing traffic hauled over your backbone/);
|
||||
ev('S.ev.ddos.bh=false;S.scrubMode="ondemand";compute()');
|
||||
assert.doesNotMatch(ev('ddosOne(S.ev.ddos)'), /Scrubbing traffic hauled over your backbone/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('a constrained remote haul leaves scrubbing capacity for the next overlapping flood', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=6;ACT.buildPop({city:'nyc'});for(const c of ['fra','nyc'])S.pops[c].rgen=3;S.links=[{id:'thin',a:'nyc',b:'fra',kind:'wave',tier:1,km:6000,mo:100}];S.scrubs=[{city:'fra',tier:1}];S.ev.ddos={id:'far',city:'nyc',vec:'http',gbps:600,start:0,until:7};S.ev.ddosMore=[{id:'near',city:'fra',vec:'http',gbps:900,start:0,until:7}];compute()");
|
||||
const clean = JSON.parse(ev('JSON.stringify(R.ddos.map(m=>({id:m.attack.id,clean:m.sp?.parts.reduce((n,x)=>n+x.cleaned,0)||0,leak:m.leak})))'));
|
||||
assert.equal(clean.find(m=>m.id==='near').clean, 900);
|
||||
assert.ok(clean.find(m=>m.id==='far').clean <= 100);
|
||||
assert.ok(clean.reduce((n,m)=>n+m.clean,0) <= 1000);
|
||||
for (const m of clean) assert.equal(m.clean+m.leak, m.id==='near'?900:600);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('distributed attack statistics survive an ingress outage and corrupted saved shares', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=6;ACT.buildPop({city:'nyc'});S.ev.ddos={id:'spread',city:'fra',vec:'http',gbps:1000,start:0,until:7,entries:[{k:'t',id:'a',city:'fra',share:0.25},{k:'t',id:'b',city:'nyc',share:0.75}]};S.pops.nyc.down=5;compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).reaching'), 1000);
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).leak'), 1000);
|
||||
ev("S.ev.ddos.entries.push({k:'t',id:'bad',city:'unknown',share:5},{k:'t',id:'bad2',city:'fra',share:-1});S=migrate(JSON.parse(JSON.stringify(S)));compute()");
|
||||
assert.equal(ev('S.ev.ddos.entries.length'), 2);
|
||||
assert.equal(ev('S.ev.ddos.entries.reduce((n,en)=>n+en.share,0)'), 1);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('RackNet and TeamSpooked require signed gaming customers, bypass Flowspec, and stay within a third of the current size range', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=13;S.pops.fra.bb={d:150000};ACT.buyTransit({city:'fra',net:'cog',tier:2});compute()");
|
||||
assert.equal(ev("ddosVectors().includes('racknet')||ddosVectors().includes('teamspooked')"), false);
|
||||
ev("S.offers=[{type:'game'}]");
|
||||
assert.equal(ev("ddosVectors().includes('racknet')"), false, 'an unsigned offer does not introduce gaming attacks');
|
||||
ev("S.biz=[{type:'game',id:'gamer',name:'Gamer',city:'fra',bw:0,rate:0}];compute()");
|
||||
for (const vec of ['racknet','teamspooked']) {
|
||||
assert.equal(ev(`DDOS_VEC.${vec}.fs`), false);
|
||||
const sizeMax = ev('ddosSizeMax()/3');
|
||||
ev(`const old=Math.random;let n=0;Math.random=()=>n++===1?(ddosVectors().indexOf('${vec}')+0.5)/ddosVectors().length:0.999999;ddosAttack();Math.random=old`);
|
||||
assert.equal(ev('ddosAll().at(-1).vec'), vec);
|
||||
assert.ok(ev('ddosAll().at(-1).gbps') <= sizeMax);
|
||||
assert.ok(ev('ddosAll().at(-1).gbps') > sizeMax*(1-0.00002), 'the upper randomized quantile approaches the one-third limit, including rare spikes');
|
||||
}
|
||||
ev("S.biz[0].type='cgame'");
|
||||
assert.equal(ev("ddosVectors().includes('teamspooked')"), true, 'cloud gaming also attracts these vectors');
|
||||
ev('S.biz=[]');
|
||||
assert.equal(ev("ddosVectors().includes('teamspooked')"), false);
|
||||
assert.equal(ev('ddosAll().length'), 2, 'existing attacks finish naturally after the gaming customer leaves');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('normal DDoS starts average half an attack per week without gaming and never exceed a seven-per-week expected rate', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("window.rule=k=>k==='chaos'?'spicy':undefined;ACT.start({});S.day=50");
|
||||
const checks = JSON.parse(ev(`
|
||||
const oldAttack=ddosAttack,oldRandom=Math.random,out=[];
|
||||
try {
|
||||
for(const [level,games] of [[1,0],[13,0],[1,1],[13,1],[13,10],[13,1000]]){
|
||||
S.lvl=level;S.biz=Array.from({length:games},()=>({type:'game'}));
|
||||
let starts=0,draw=0;ddosAttack=()=>{starts++};Math.random=()=>((draw++)+0.5)/14000;
|
||||
for(let day=0;day<7000;day++)ddosTick();
|
||||
out.push({level,games,expected:ddosRate(),observed:starts/1000});
|
||||
}
|
||||
} finally {ddosAttack=oldAttack;Math.random=oldRandom;}
|
||||
JSON.stringify(out)
|
||||
`));
|
||||
for(const row of checks){
|
||||
assert.ok(Math.abs(row.observed-row.expected)<=0.0011, JSON.stringify(row));
|
||||
if(row.games===0)assert.equal(row.observed,0.5);
|
||||
else assert.ok(row.expected>0.5&&row.expected<=7);
|
||||
}
|
||||
assert.ok(checks[3].expected>checks[2].expected, 'level increases gaming frequency');
|
||||
assert.ok(checks[4].expected>checks[3].expected, 'more gaming customers increase frequency');
|
||||
assert.ok(checks[3].expected<0.8, 'one gaming customer does not suddenly add several attacks per week, even at the last level');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('normal attack sizes match the one- and fifty-gamer targets while frequency rises gradually', () => {
|
||||
const { ev, errors } = load();
|
||||
ev('ACT.start({})');
|
||||
const samples = JSON.parse(ev(`
|
||||
const oldRandom=Math.random,out=[];
|
||||
try {
|
||||
for(const [level,demand] of [[1,0],[3,1850],[LEVELS.length,LV_REQ.at(-1).pk]]){
|
||||
const counts=[];
|
||||
for(const games of [0,1,2,5,10,20,50,100,1000]){
|
||||
S.lvl=level;S.biz=Array.from({length:games},(_,i)=>({id:'g'+i,type:i%2?'cgame':'game',city:'fra',bw:0,rate:0}));
|
||||
const vectors=ddosVectors();let sum=0;
|
||||
for(let i=0;i<vectors.length;i++)for(const [roll,weight] of [[0.49,0.98],[0.99,0.02]]){
|
||||
S.ev.ddos=null;S.ev.ddosMore=[];S.ddosStarts=[];R.demand=demand;
|
||||
let draw=0;Math.random=()=>draw++===1?(i+0.5)/vectors.length:roll;
|
||||
ddosAttack(false);sum+=weight*S.ev.ddos.gbps;
|
||||
}
|
||||
counts.push({games,mean:sum/vectors.length,rate:ddosRate()});
|
||||
}
|
||||
out.push({level,demand,counts});
|
||||
}
|
||||
} finally {Math.random=oldRandom;}
|
||||
JSON.stringify(out)
|
||||
`));
|
||||
for(const row of samples){
|
||||
const [plain,first]=row.counts,fifty=row.counts.find(c=>c.games===50),hundred=row.counts.find(c=>c.games===100),many=row.counts.at(-1);
|
||||
assert.ok(Math.abs(first.mean-plain.mean*3)<0.003, 'the first gamer triples the overall mean, allowing only bandwidth rounding: '+JSON.stringify(row));
|
||||
assert.ok(Math.abs(fifty.mean-plain.mean*8)<0.01, 'fifty gamers bring eightfold sizes, allowing only bandwidth rounding');
|
||||
assert.ok(hundred.mean>first.mean*3, 'growth continues across dozens of gaming customers');
|
||||
assert.ok(hundred.mean>plain.mean*10 && hundred.mean<plain.mean*11, 'a hundred gamers bring roughly tenfold sizes');
|
||||
assert.ok(many.mean<=plain.mean*12+0.01, 'high-exposure sizes approach the existing upper balance');
|
||||
assert.equal(plain.rate,0.5);
|
||||
assert.ok(first.rate<0.8);
|
||||
assert.ok(hundred.rate>6 && many.rate<=7);
|
||||
for(let i=1;i<row.counts.length;i++){
|
||||
assert.ok(row.counts[i].mean>row.counts[i-1].mean, 'each sampled count increases actual spawned attack sizes');
|
||||
assert.ok(row.counts[i].rate>row.counts[i-1].rate, 'each sampled count increases frequency');
|
||||
}
|
||||
}
|
||||
assert.ok(Math.abs(samples[0].counts[0].mean-1)<0.001, 'the minimum-demand baseline still permits small attacks');
|
||||
assert.ok(Math.abs(samples[1].counts[0].mean-740/13)<0.001, 'the 1.85 Tbps non-gaming example keeps its average');
|
||||
assert.ok(Math.abs(samples[2].counts[0].mean-samples[2].demand*4/3/10)<0.001);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('normal attack sizes cover a broad ordinary range and a two-percent large tail without raising the mean', () => {
|
||||
const { ev, errors } = load();
|
||||
ev('ACT.start({});S.lvl=3;S.biz=[];R.demand=1850');
|
||||
const distribution = JSON.parse(ev(`
|
||||
const oldRandom=Math.random,ordinary=[],large=[];let sum=0;
|
||||
try {
|
||||
for(let i=0;i<10000;i++){
|
||||
Math.random=()=>(i+0.5)/10000;
|
||||
const g=ddosSize('syn');sum+=g;(g>100?large:ordinary).push(g);
|
||||
}
|
||||
} finally {Math.random=oldRandom;}
|
||||
JSON.stringify({ordinary:{n:ordinary.length,min:Math.min(...ordinary),max:Math.max(...ordinary)},
|
||||
large:{n:large.length,min:Math.min(...large),max:Math.max(...large),near500:large.some(g=>g>=490&&g<=510)},mean:sum/10000})
|
||||
`));
|
||||
assert.equal(distribution.ordinary.n, 9800);
|
||||
assert.equal(distribution.large.n, 200);
|
||||
assert.ok(distribution.ordinary.min>=8.9 && distribution.ordinary.min<10);
|
||||
assert.ok(distribution.ordinary.max>85 && distribution.ordinary.max<=89.1);
|
||||
assert.ok(distribution.ordinary.max/distribution.ordinary.min>9.9);
|
||||
assert.ok(distribution.large.min>=356 && distribution.large.max<=535);
|
||||
assert.ok(distribution.large.near500, 'the example network can occasionally face a roughly 500 Gbps flood');
|
||||
assert.ok(Math.abs(distribution.mean-740/13)<0.001, 'the rare tail preserves the previous 56.923 Gbps average');
|
||||
// Verify that real spawns use both bands, not just the standalone sampler.
|
||||
for (const [roll,minimum,maximum] of [[0.49,8.9,89.1],[0.99,356,535]]) {
|
||||
ev(`S.ev.ddos=null;S.ev.ddosMore=[];S.ddosStarts=[];R.demand=1850;const old=Math.random;let n=0;Math.random=()=>{const i=n++;return i===1?(ddosVectors().indexOf('syn')+0.5)/ddosVectors().length:i===2?${roll}:0.5};try{ddosAttack()}finally{Math.random=old}`);
|
||||
assert.equal(ev('S.ev.ddos.vec'), 'syn');
|
||||
assert.ok(ev('S.ev.ddos.gbps')>=minimum && ev('S.ev.ddos.gbps')<=maximum);
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('Flood Season retains its existing size quantiles and escalation when normal attacks gain rare spikes', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.scn={id:'flood',rules:{ddos:true}};S.lvl=3;S.biz=[];R.demand=1850");
|
||||
for (const [day,expected] of [[0,[700,1400,2099]],[365,[1400,2800,4199]],[730,[2100,4200,6299]]]) {
|
||||
ev(`S.day=${day}`);
|
||||
const actual = JSON.parse(ev("const old=Math.random;let sizes;try{sizes=[0,0.5,0.999999].map(r=>{Math.random=()=>r;return ddosSize('syn')})}finally{Math.random=old}JSON.stringify(sizes)"));
|
||||
assert.deepEqual(actual, expected);
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the busier DDoS schedule needs spicy chaos or gaming customers; otherwise attacks come as before', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.day=50;S.lvl=13;S.biz=[];S.nextFail=1e9;S.nextEvent=1e9");
|
||||
const ticks = () => ev("(()=>{const old=Math.random,oa=ddosAttack;let n=0;ddosAttack=()=>{n++};Math.random=()=>0;try{for(let i=0;i<30;i++)ddosTick();}finally{Math.random=old;ddosAttack=oa;}return n;})()");
|
||||
assert.equal(ticks(), 0, 'no spicy chaos, no gamers: no extra schedule');
|
||||
// DDoS stays one of the regular incidents instead: fireFailure can still roll one.
|
||||
// DDoS stays one of the regular incidents instead: some roll of fireFailure() still starts one.
|
||||
assert.ok(ev("(()=>{const old=Math.random;try{for(let i=0;i<200;i++){const r=i/200;Math.random=()=>r;S.ev.ddos=null;S.ev.ddosMore=[];S.ddosStarts=[];fireFailure();if(ddosAll().length)return true;}return false;}finally{Math.random=old;}})()"), 'fireFailure can start an attack');
|
||||
ev("S.ev.ddos=null;S.ev.ddosMore=[];S.ddosStarts=[];S.inc=[]");
|
||||
ev("S.biz=[{type:'game',city:'fra',bw:5,rate:1,reqs:[]}]");
|
||||
assert.ok(ticks() > 0, 'gaming customers bring their own attacks');
|
||||
ev("S.biz=[];window.rule=k=>k==='chaos'?'spicy':'calm'");
|
||||
assert.ok(ticks() > 0, 'spicy chaos brings more attacks');
|
||||
ev("window.rule=k=>k==='chaos'?'calm':undefined");
|
||||
assert.equal(ticks(), 0, 'any other chaos setting keeps them as on main');
|
||||
// Flood Season, not spicy: one flood at a time, 3 to 7 days apart, however old the scenario is.
|
||||
ev("delete window.rule;ACT.startScn({id:'flood',sure:1});S.biz=[]");
|
||||
const gaps = JSON.parse(ev("(()=>{const o=[];for(const d of [0,1000])for(const r of [0,0.999]){S.day=d;const old=Math.random;Math.random=()=>r;o.push(floodGap());Math.random=old;}return JSON.stringify(o);})()"));
|
||||
assert.deepEqual(gaps, [3, 7, 3, 7]);
|
||||
ev("S.scn.nextDdos=S.day;ddosTick()");
|
||||
assert.equal(ev('ddosAll().length'), 1);
|
||||
ev("S.scn.nextDdos=S.day;ddosTick()");
|
||||
assert.equal(ev('ddosAll().length'), 1, 'the next flood waits for the last one to end');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ module.exports = `
|
|||
for(f of flows){
|
||||
if(f.rem<=1e-6||(rank===0&&!f.cache)||(pass&&!pass(f)))continue;
|
||||
Dv=SDi[f.ci];Pv=SPi[f.ci];PP=walked[f.ci]||(walked[f.ci]=[]);vis++;
|
||||
const candidates=E.filter(e=>e.used<e.cap&&e.ok(f.n)&&
|
||||
(TR?eff(e,f.n):base(e))===rank&&Dv[CIDX[e.city]]<Infinity)
|
||||
const candidates=E.filter(e=>e.used<e.cap&&(f.pin?e.ek===f.pin:e.ok(f.n))&&
|
||||
(f.pin?base(e):TR?eff(e,f.n):base(e))===rank&&Dv[CIDX[e.city]]<Infinity)
|
||||
.sort((a,b)=>(a.pref==='high'?0:1)-(b.pref==='high'?0:1)||Dv[CIDX[a.city]]-Dv[CIDX[b.city]]);
|
||||
for(let i=0;i<candidates.length&&f.rem>1e-6;){
|
||||
let j=i+1;while(j<candidates.length&&(candidates[j].pref==='high')===(candidates[i].pref==='high')&&
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ test('Flood Season: attacks keep coming, grow, and only count when service held'
|
|||
assert.ok(ev('S.lvl') >= 3, 'starts with bigger gear unlocked');
|
||||
// a few weeks in: several attacks start on their own schedule
|
||||
let n = 0;
|
||||
for (let i = 0; i < 40; i++) { ev('dayTick()'); if (ev('!!(S.ev.ddos&&S.ev.ddos.start===S.day)')) n++; }
|
||||
for (let i = 0; i < 40; i++) { ev('dayTick()'); if (ev('ddosAll().some(a=>a.start===S.day)')) n++; }
|
||||
assert.ok(n >= 4, `attacks keep coming (${n} in 40 days)`);
|
||||
assert.ok(ev('(S.stats.ddosOk||0)+(S.stats.ddosLost||0)') >= 3, 'finished attacks are scored');
|
||||
// scoring: held only if service stayed at 97%+
|
||||
|
|
@ -468,3 +468,29 @@ test('RouteScript: help, ready-made scripts and the AI button', () => {
|
|||
ev("UI.dtab='overview';renderAll()");
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
||||
test('Flood Season keeps attacking and escalating after both success and timeout', () => {
|
||||
for (const outcome of ['done', 'failed']) {
|
||||
const { ev, errors, dom } = load();
|
||||
ev("ACT.startScn({id:'flood',sure:1});S.cash=1e9;S.nextFail=1e9;S.nextEvent=1e9");
|
||||
if (outcome === 'done') ev('S.stats.ddosOk=20;S.stats.ddosOkBig=5;S.day=100');
|
||||
else ev('S.day=365');
|
||||
ev('scnTick(S.day)');
|
||||
assert.ok(ev(`!!S.scn.${outcome}`));
|
||||
assert.ok([...dom.window.document.querySelectorAll('#modal [data-act="closeModal"]')].some(b=>b.textContent==='Keep playing'));
|
||||
ev('ACT.closeModal();S.scn.nextDdos=S.day+1;dayTick()');
|
||||
assert.equal(ev('S.ev.ddos.start'), ev('S.day'), 'Keep playing still spawns attacks');
|
||||
const before = ev('S.day');
|
||||
ev('S.scn.nextDdos=S.day+1;S.day+=8;dayTick()');
|
||||
assert.ok(ev('ddosAll().at(-1).start') > before, 'subsequent attacks keep coming');
|
||||
// Escalating frequency belongs to spicy chaos (stood in for here); calmer games keep the old 3 to 7 days.
|
||||
ev("window.rule=k=>k==='chaos'?'spicy':undefined");
|
||||
const gaps = JSON.parse(ev('const old=Math.random;Math.random=()=>0.5;S.day=0;const early=floodGap();S.day=1000;const late=floodGap();Math.random=old;JSON.stringify([early,late])'));
|
||||
assert.ok(gaps[1] < gaps[0], 'frequency keeps increasing with scenario age');
|
||||
const sizes = JSON.parse(ev('const old=Math.random;Math.random=()=>0.9;S.day=0;ddosAttack();const early=ddosAll().at(-1).gbps;S.day=1000;ddosAttack();const late=ddosAll().at(-1).gbps;Math.random=old;JSON.stringify([early,late])'));
|
||||
assert.ok(sizes[1] > sizes[0], 'intensity keeps increasing with scenario age');
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ test('indexed routing matches the simple allocation loop across network changes'
|
|||
"S.te.script='prefer transit Cogentle\\nprepend transit Cogentle 2\\nprotect customers'",
|
||||
"S.ev.rpki={nets:['ggl','nfx'],until:S.day+3};S.ev.depeer=S.day+3",
|
||||
"S.ev.ddos={city:'fra',until:S.day+3,gbps:300,vec:'syn',entry:{k:'edge'}}",
|
||||
"S.ev.ddos.entries=[{k:'t',id:'transit0',city:'fra',share:.4},{k:'t',id:'transit4',city:'nyc',share:.6}]",
|
||||
"S.links[0].eqDown=S.day+2;S.links[1].cut=S.day+2;S.links[2].loss={until:S.day+2,f:0.5}",
|
||||
"S.links[4].chFail={until:S.day+2,o:'tp16'};S.links[6].ch.push('zr4');S.links[8].regen=2",
|
||||
"S.day+=4;S.pni.splice(0,20);S.caches.splice(0,10);S.transit[0].pref='high'",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,30 @@ function network(ev) {
|
|||
ev("const L=(a,b,t,v)=>{UI.via=v||null;openLinkModal(a,b);ACT.buildLink({tier:t});};L('fra','ams',3);L('fra','par',3);L('ams','lon',2,'uly');closeModal()");
|
||||
}
|
||||
|
||||
test('gaming offers and signed customers show their DDoS risk in Deals, city panels and customer lists', () => {
|
||||
const { ev, errors, dom } = load();
|
||||
ev("ACT.start({});S.cash=1e9;ACT.buyTransit({city:'fra',net:'cog',tier:1});S.offers=['game','cgame','host'].map(type=>({id:type,city:'fra',name:type,bw:5,rate:100,reqs:[],exp:S.day+30,type}));UI.left='deals';UI.leftOpen=true;renderLeft()");
|
||||
const notes = (root, action) => {
|
||||
const buttons = [...root.querySelectorAll(`[data-act="${action}"]`)];
|
||||
assert.equal(buttons.length, 3);
|
||||
for (const button of buttons) {
|
||||
const id = JSON.parse(button.dataset.args).id;
|
||||
const count = (button.closest('.row').textContent.match(/Gaming attracts attacks/g)||[]).length;
|
||||
assert.equal(count, id==='game'||id==='cgame'?1:0, `risk note for ${id}`);
|
||||
}
|
||||
};
|
||||
assert.equal(ev('gamingCount()'), 0, 'offers disclose future risk before signing');
|
||||
notes(dom.window.document.getElementById('leftBody'), 'accept');
|
||||
ev("selectCity('fra');ACT.tab({t:'cust'})");
|
||||
notes(dom.window.document.getElementById('panelBody'), 'accept');
|
||||
ev("for(const id of ['game','cgame','host'])ACT.accept({id});UI.tab='cust';renderPanel()");
|
||||
assert.equal(ev('gamingCount()'), 2, 'the note uses the same customer classification as the attack calculation');
|
||||
notes(dom.window.document.getElementById('panelBody'), 'dropBiz');
|
||||
ev('ACT.custOpen({})');
|
||||
notes(dom.window.document.getElementById('custSec'), 'custGo');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('event networks pay in full when the crowd is served, nothing up front', () => {
|
||||
const { ev, errors } = load();
|
||||
seed(ev, 4);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue