test(core): RIP measured with Java FILIUS

RipRun runs rip-chain's three routers in Java FILIUS, each router's random
set by reflection to the core's ripSeed, and writes the frames, every
change of each RIP table and the calls. converge: the tables fill, a ping
at 45 s. expire: R3 falls silent at 10 s; R2 marks its network 16 hops only
at its own next beacon, R1 passes it on at once, the ping gets ICMP 3/0.
Both match: per sending card the same messages at the same times, every
table through the same states. The first 5 s are compared by the state the
tables reach, since Java's routers start one after the other.

Measured on the JDK: Java's pause divides nextFloat() by 3 in float; the
core does too now (a millisecond off in one draw of about 10,000 before).
Scenarios name their RIP routers in the new field rip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 19:41:56 +00:00
co-authored by Claude Opus 5.5
parent a4036f12a3
commit 37f5d77477
12 changed files with 1695 additions and 6 deletions
+31
View File
@@ -344,3 +344,34 @@ Frames, Abstände und die Zeiten, zu denen die Aufrufe zurückkehren). Die UDP-A
seit F2.4b-2: ein Senden kehrt sofort zurück wie in Java (Swifts Senden wartete, bis
alle Frames angekommen waren), und je Knoten und Protokoll sendet ein Transport-Thread
ein Segment nach dem anderen.
## RIP zur Laufzeit
`RipRun` startet das Netz von `rip-chain` (PC 10.0.1.2 – R1 – R2 – R3 – PC
10.0.3.2, jeder Router mit RIP; `ScenarioNetwork` schaltet RIP für die im
Feld `rip` genannten Router ein) und schreibt nach `rip-java-<ablauf>.java.json`
die Frames, jede Änderung jeder RIP-Tabelle (alle 2 ms abgefragt, Zeile
`netz/maske gateway schnittstelle hops; …`) und die Aufrufe. Java würfelt die
Pausen eines Routers aus einem neuen `Random`; `RipRun` setzt jedem Router
per Reflection (`VermittlungsrechnerBetriebssystem.ripbeacon`,
`RIPBeacon.rand`) den Startwert, den der Kern ihm gibt (`ripSeed`: Startwert
des Szenarios, `0x52495000` und FNV-1a der Router-ID). Dann würfeln beide
dieselben Pausen.
* `converge`: die Tabellen füllen sich, bei 45 s pingt 10.0.1.2 10.0.3.2.
* `expire`: bei 10 s schweigt R3 (`RIPTable.setNextBeacon(Long.MAX_VALUE)`),
bei 125 s der Ping noch einmal.
Gemessen (30.09.2026, dazu die Pausenformel am JDK):
* Die Pause ist `(int) (30000 * (rand.nextFloat() / 3 + 0.84))`; `nextFloat() / 3`
rechnet Java in `float`, in etwa einem von 10.000 Fällen eine Millisekunde
anders als in `double`.
* Eine gelernte Route bekommt 16 Hops erst beim nächsten Beacon ihres Routers
nach dem Verfallen (`RIPTable.check`): R3s Netz verfiel bei R2 nach rund
76,4 s, R2 setzte es bei seinem Beacon um 86,7 s auf 16; R1 hörte die 16 vom
selben Router und meldete sofort. Der Ping bekommt dann ICMP 3/0 von R1.
* Die Router starten nacheinander, rund 20 ms auseinander; wer einen
Nachbarn vor seinem ersten Beacon hört, sendet die gelernte Route gleich
mit. Senden mehrere zugleich, fehlt im Lauscher mancher eigene Frame.