feat(core): packet capture per card after Java's Lauscher, measured card by card

The engine keeps Java's packet capture (capture.ts): per network card
every frame it sent (when it leaves on the cable) or received (also one
for another card), once, with time and number; switches log nothing;
frames the packet loss dropped are kept apart; the capture outlives a
stop and a new start, as in Java, until clearCapture. Per port instead
of per MAC, at most 10,000 frames a card.

expectSameCaptures compares each card's capture with Java's list of that
card in the ARP, WLAN, DNS, TCP, NAT, RIP and single-client DHCP runs.
It found that ScenarioNetwork ignored a switch's learning time (Java ran
300 s, the core the scenarios' 5 s); the oracle sets it now, and the TCP
and DHCP runs are recorded again. A core test found that a new start
numbers frames from 1 again and the capture took them as seen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 08:53:37 +00:00
co-authored by Claude Opus 5.5
parent 65ccd9ddd7
commit 088b62469f
24 changed files with 796 additions and 344 deletions
@@ -2,7 +2,7 @@
"frames": {
"00000000-0000-0000-0000-000000000101": [
{
"time": 855,
"time": 850,
"source": "02:00:00:00:01:12",
"destination": "FF:FF:FF:FF:FF:FF",
"arp": 1,
@@ -10,7 +10,7 @@
"targetIp": "192.168.0.10"
},
{
"time": 856,
"time": 852,
"source": "02:00:00:00:01:11",
"destination": "02:00:00:00:01:12",
"arp": 2,
@@ -18,13 +18,13 @@
"targetIp": "192.168.0.20"
},
{
"time": 1083,
"time": 1079,
"source": "02:00:00:00:01:12",
"destination": "02:00:00:00:01:11",
"sourceIp": "192.168.0.20",
"destinationIp": "192.168.0.10",
"protocol": 6,
"sourcePort": 52633,
"sourcePort": 52891,
"destinationPort": 80,
"payload": null,
"tcpFlags": "S",
@@ -32,28 +32,28 @@
"acknowledgement": 0
},
{
"time": 1085,
"time": 1081,
"source": "02:00:00:00:01:11",
"destination": "02:00:00:00:01:12",
"sourceIp": "192.168.0.10",
"destinationIp": "192.168.0.20",
"protocol": 6,
"sourcePort": 80,
"destinationPort": 52633,
"destinationPort": 52891,
"payload": null,
"tcpFlags": "SA",
"sequence": 1000000,
"acknowledgement": 2000001
},
{
"time": 17585,
"time": 17582,
"source": "02:00:00:00:01:11",
"destination": "02:00:00:00:01:12",
"sourceIp": "192.168.0.10",
"destinationIp": "192.168.0.20",
"protocol": 6,
"sourcePort": 80,
"destinationPort": 52633,
"destinationPort": 52891,
"payload": null,
"tcpFlags": "F",
"sequence": 1000001,
@@ -62,7 +62,7 @@
],
"00000000-0000-0000-0000-000000000102": [
{
"time": 733,
"time": 728,
"source": "02:00:00:00:01:12",
"destination": "FF:FF:FF:FF:FF:FF",
"arp": 1,
@@ -70,7 +70,7 @@
"targetIp": "192.168.0.10"
},
{
"time": 968,
"time": 963,
"source": "02:00:00:00:01:11",
"destination": "02:00:00:00:01:12",
"arp": 2,
@@ -78,13 +78,13 @@
"targetIp": "192.168.0.20"
},
{
"time": 970,
"time": 966,
"source": "02:00:00:00:01:12",
"destination": "02:00:00:00:01:11",
"sourceIp": "192.168.0.20",
"destinationIp": "192.168.0.10",
"protocol": 6,
"sourcePort": 52633,
"sourcePort": 52891,
"destinationPort": 80,
"payload": null,
"tcpFlags": "S",
@@ -92,14 +92,14 @@
"acknowledgement": 0
},
{
"time": 17697,
"time": 17694,
"source": "02:00:00:00:01:11",
"destination": "02:00:00:00:01:12",
"sourceIp": "192.168.0.10",
"destinationIp": "192.168.0.20",
"protocol": 6,
"sourcePort": 80,
"destinationPort": 52633,
"destinationPort": 52891,
"payload": null,
"tcpFlags": "F",
"sequence": 1000001,
@@ -108,63 +108,81 @@
],
"00000000-0000-0000-0000-000000000103": [
{
"time": 855,
"time": 850,
"source": "02:00:00:00:01:12",
"destination": "FF:FF:FF:FF:FF:FF",
"arp": 1,
"senderIp": "192.168.0.20",
"targetIp": "192.168.0.10"
},
{
"time": 17696,
"source": "02:00:00:00:01:11",
"destination": "02:00:00:00:01:12",
"sourceIp": "192.168.0.10",
"destinationIp": "192.168.0.20",
"protocol": 6,
"sourcePort": 80,
"destinationPort": 52891,
"payload": null,
"tcpFlags": "F",
"sequence": 1000001,
"acknowledgement": 0
}
]
},
"events": [
[
218,
213,
"server oeffnen called"
],
[
719,
714,
"client verbinden called"
],
[
1085,
1081,
"lost SYN+ACK"
],
[
9025,
9019,
"client verbinden failed TimeOutException"
],
[
17632,
17626,
"server oeffnen returned"
]
],
"states": {
"server": [
[
221,
215,
"CLOSED"
],
[
217,
"LISTEN"
],
[
1085,
1081,
"SYN_RCVD"
],
[
17585,
17582,
"FIN_WAIT_1"
]
],
"client": [
[
719,
713,
"CLOSED"
],
[
731,
724,
"SYN_SENT"
],
[
8980,
8974,
"CLOSED"
]
]