From 6a3c0bc6afdec4446b89f7a7daeec496aec100e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Sun, 1 Jun 2025 23:45:26 -0300 Subject: [PATCH 1/2] feat: add "Misconfigured Router" example --- examples/misconfiguredRouter.json | 344 ++++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 examples/misconfiguredRouter.json diff --git a/examples/misconfiguredRouter.json b/examples/misconfiguredRouter.json new file mode 100644 index 00000000..13c9a1ac --- /dev/null +++ b/examples/misconfiguredRouter.json @@ -0,0 +1,344 @@ +{ + "nodes": [ + { + "id": 1, + "type": 0, + "x": 4740.25, + "y": 5055.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:01", + "ip": "10.0.0.1" + } + ], + "tag": "Echo Sender", + "mask": "255.255.255.255", + "arpTable": [], + "runningPrograms": [ + { + "pid": 4, + "name": "Echo server", + "inputs": [ + "5", + "15000" + ] + } + ] + }, + { + "id": 2, + "type": 1, + "x": 4854.25, + "y": 4822.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:02", + "ip": "10.0.0.2" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:03", + "ip": "10.0.0.3" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:04", + "ip": "10.0.0.4" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:05", + "ip": "10.0.0.5" + } + ], + "tag": null, + "mask": "255.255.255.255", + "arpTable": [], + "routingTable": [ + [ + "10.0.0.1", + "255.255.255.255", + 2, + false, + false + ], + [ + "10.0.0.6", + "255.255.255.255", + 0, + false, + false + ], + [ + "10.0.0.10", + "255.255.255.255", + 1, + false, + false + ], + [ + "10.0.0.14", + "255.255.255.255", + 1, + false, + false + ] + ], + "packetQueueSize": 4096, + "bytesPerSecond": 1024 + }, + { + "id": 3, + "type": 1, + "x": 5095.25, + "y": 4824.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:06", + "ip": "10.0.0.6" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:07", + "ip": "10.0.0.7" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:08", + "ip": "10.0.0.8" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:09", + "ip": "10.0.0.9" + } + ], + "tag": null, + "mask": "255.255.255.255", + "arpTable": [], + "routingTable": [ + [ + "10.0.0.1", + "255.255.255.255", + 0, + false, + false + ], + [ + "10.0.0.2", + "255.255.255.255", + 0, + false, + false + ], + [ + "10.0.0.11", + "255.255.255.255", + 1, + false, + false + ], + [ + "10.0.0.14", + "255.255.255.255", + 0, + true, + false + ] + ], + "packetQueueSize": 4096, + "bytesPerSecond": 1024 + }, + { + "id": 4, + "type": 1, + "x": 4974.25, + "y": 5060.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:0a", + "ip": "10.0.0.10" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:0b", + "ip": "10.0.0.11" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:0c", + "ip": "10.0.0.12" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:0d", + "ip": "10.0.0.13" + } + ], + "tag": "Misconfigured Router", + "mask": "255.255.255.255", + "arpTable": [], + "routingTable": [ + [ + "10.0.0.1", + "255.255.255.255", + 0, + false, + false + ], + [ + "10.0.0.3", + "255.255.255.255", + 0, + false, + false + ], + [ + "10.0.0.7", + "255.255.255.255", + 1, + false, + false + ], + [ + "10.0.0.14", + "255.255.255.255", + 1, + true, + false + ] + ], + "packetQueueSize": 4096, + "bytesPerSecond": 1024 + }, + { + "id": 5, + "type": 0, + "x": 5183.25, + "y": 5060.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:0e", + "ip": "10.0.0.14" + } + ], + "tag": "Echo Target", + "mask": "255.255.255.255", + "arpTable": [], + "runningPrograms": [ + { + "pid": 1, + "name": "Serve HTTP requests", + "inputs": [] + } + ] + } + ], + "edges": [ + { + "from": { + "id": 2, + "iface": 2 + }, + "to": { + "id": 1, + "iface": 0 + } + }, + { + "from": { + "id": 2, + "iface": 2 + }, + "to": { + "id": 1, + "iface": 0 + } + }, + { + "from": { + "id": 3, + "iface": 0 + }, + "to": { + "id": 2, + "iface": 0 + } + }, + { + "from": { + "id": 4, + "iface": 0 + }, + "to": { + "id": 2, + "iface": 1 + } + }, + { + "from": { + "id": 3, + "iface": 0 + }, + "to": { + "id": 2, + "iface": 0 + } + }, + { + "from": { + "id": 4, + "iface": 1 + }, + "to": { + "id": 3, + "iface": 1 + } + }, + { + "from": { + "id": 4, + "iface": 0 + }, + "to": { + "id": 2, + "iface": 1 + } + }, + { + "from": { + "id": 4, + "iface": 1 + }, + "to": { + "id": 3, + "iface": 1 + } + }, + { + "from": { + "id": 5, + "iface": 0 + }, + "to": { + "id": 4, + "iface": 2 + } + }, + { + "from": { + "id": 5, + "iface": 0 + }, + "to": { + "id": 4, + "iface": 2 + } + } + ] +} \ No newline at end of file From 7c6603344548d5e4c5ee606763e1a1511b300505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Mon, 2 Jun 2025 23:33:19 -0300 Subject: [PATCH 2/2] chore: format example --- examples/misconfiguredRouter.json | 103 ++++-------------------------- 1 file changed, 14 insertions(+), 89 deletions(-) diff --git a/examples/misconfiguredRouter.json b/examples/misconfiguredRouter.json index 13c9a1ac..ccb0aa38 100644 --- a/examples/misconfiguredRouter.json +++ b/examples/misconfiguredRouter.json @@ -19,10 +19,7 @@ { "pid": 4, "name": "Echo server", - "inputs": [ - "5", - "15000" - ] + "inputs": ["5", "15000"] } ] }, @@ -57,34 +54,10 @@ "mask": "255.255.255.255", "arpTable": [], "routingTable": [ - [ - "10.0.0.1", - "255.255.255.255", - 2, - false, - false - ], - [ - "10.0.0.6", - "255.255.255.255", - 0, - false, - false - ], - [ - "10.0.0.10", - "255.255.255.255", - 1, - false, - false - ], - [ - "10.0.0.14", - "255.255.255.255", - 1, - false, - false - ] + ["10.0.0.1", "255.255.255.255", 2, false, false], + ["10.0.0.6", "255.255.255.255", 0, false, false], + ["10.0.0.10", "255.255.255.255", 1, false, false], + ["10.0.0.14", "255.255.255.255", 1, false, false] ], "packetQueueSize": 4096, "bytesPerSecond": 1024 @@ -120,34 +93,10 @@ "mask": "255.255.255.255", "arpTable": [], "routingTable": [ - [ - "10.0.0.1", - "255.255.255.255", - 0, - false, - false - ], - [ - "10.0.0.2", - "255.255.255.255", - 0, - false, - false - ], - [ - "10.0.0.11", - "255.255.255.255", - 1, - false, - false - ], - [ - "10.0.0.14", - "255.255.255.255", - 0, - true, - false - ] + ["10.0.0.1", "255.255.255.255", 0, false, false], + ["10.0.0.2", "255.255.255.255", 0, false, false], + ["10.0.0.11", "255.255.255.255", 1, false, false], + ["10.0.0.14", "255.255.255.255", 0, true, false] ], "packetQueueSize": 4096, "bytesPerSecond": 1024 @@ -183,34 +132,10 @@ "mask": "255.255.255.255", "arpTable": [], "routingTable": [ - [ - "10.0.0.1", - "255.255.255.255", - 0, - false, - false - ], - [ - "10.0.0.3", - "255.255.255.255", - 0, - false, - false - ], - [ - "10.0.0.7", - "255.255.255.255", - 1, - false, - false - ], - [ - "10.0.0.14", - "255.255.255.255", - 1, - true, - false - ] + ["10.0.0.1", "255.255.255.255", 0, false, false], + ["10.0.0.3", "255.255.255.255", 0, false, false], + ["10.0.0.7", "255.255.255.255", 1, false, false], + ["10.0.0.14", "255.255.255.255", 1, true, false] ], "packetQueueSize": 4096, "bytesPerSecond": 1024 @@ -341,4 +266,4 @@ } } ] -} \ No newline at end of file +}