From 47f36645a49b16cdfbd3c5d9756bb1477ff29c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Sat, 21 Jun 2025 16:38:22 -0300 Subject: [PATCH] feat: add subnetting example --- examples/subnetting.json | 652 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 652 insertions(+) create mode 100644 examples/subnetting.json diff --git a/examples/subnetting.json b/examples/subnetting.json new file mode 100644 index 00000000..058b4259 --- /dev/null +++ b/examples/subnetting.json @@ -0,0 +1,652 @@ +{ + "nodes": [ + { + "id": 1, + "type": 1, + "x": 4857.25, + "y": 4830.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:01", + "ip": "172.220.108.125" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:02", + "ip": "172.220.108.121" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:03", + "ip": "172.220.104.1" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:04", + "ip": "10.0.0.4" + } + ], + "tag": null, + "mask": "255.255.255.255", + "arpTable": [], + "routingTable": [ + ["172.220.104.2", "255.255.255.255", 2, true, true], + ["172.220.106.2", "255.255.255.255", 1, true, true], + ["172.220.108.2", "255.255.255.255", 0, true, true], + ["172.220.108.66", "255.255.255.255", 0, true, true], + ["172.220.108.98", "255.255.255.255", 0, true, true], + ["172.220.108.115", "255.255.255.255", 0, true, true], + ["172.220.108.122", "255.255.255.255", 1, true, true], + ["172.220.108.126", "255.255.255.255", 0, true, true], + ["172.220.108.120", "255.255.255.252", 1, true, false], + ["172.220.108.0", "255.255.255.0", 0, true, false], + ["172.220.104.0", "255.255.254.0", 2, true, false], + ["172.220.106.0", "255.255.254.0", 1, true, false] + ], + "packetQueueSize": 4096, + "bytesPerSecond": 1024 + }, + { + "id": 2, + "type": 1, + "x": 4704.030438169245, + "y": 5016.440784123436, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:05", + "ip": "172.220.108.113" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:06", + "ip": "172.220.108.122" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:07", + "ip": "172.220.106.1" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:08", + "ip": "10.0.0.8" + } + ], + "tag": null, + "mask": "255.255.255.255", + "arpTable": [], + "routingTable": [ + ["172.220.104.2", "255.255.255.255", 1, true, true], + ["172.220.106.2", "255.255.255.255", 2, true, true], + ["172.220.108.2", "255.255.255.255", 0, true, true], + ["172.220.108.66", "255.255.255.255", 0, true, true], + ["172.220.108.98", "255.255.255.255", 0, true, true], + ["172.220.108.114", "255.255.255.255", 0, true, true], + ["172.220.108.115", "255.255.255.255", 0, true, true], + ["172.220.108.121", "255.255.255.255", 1, true, true], + ["172.220.108.120", "255.255.255.252", 1, true, false], + ["172.220.108.0", "255.255.255.0", 0, true, false], + ["172.220.104.0", "255.255.254.0", 1, true, false], + ["172.220.106.0", "255.255.254.0", 2, true, false] + ], + "packetQueueSize": 4096, + "bytesPerSecond": 1024 + }, + { + "id": 3, + "type": 1, + "x": 5018.25, + "y": 5023.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:09", + "ip": "172.220.108.114" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:0a", + "ip": "172.220.108.126" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:0b", + "ip": "172.220.108.1" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:0c", + "ip": "10.0.0.12" + } + ], + "tag": null, + "mask": "255.255.255.255", + "arpTable": [], + "routingTable": [ + ["172.220.104.2", "255.255.255.255", 1, true, true], + ["172.220.106.2", "255.255.255.255", 0, true, true], + ["172.220.108.2", "255.255.255.255", 2, true, true], + ["172.220.108.66", "255.255.255.255", 0, true, true], + ["172.220.108.98", "255.255.255.255", 0, true, true], + ["172.220.108.113", "255.255.255.255", 0, true, true], + ["172.220.108.115", "255.255.255.255", 0, true, true], + ["172.220.108.125", "255.255.255.255", 1, true, true], + ["172.220.108.124", "255.255.255.252", 1, true, true], + ["172.220.108.112", "255.255.255.248", 0, true, false], + ["172.220.108.120", "255.255.255.248", 1, true, false], + ["172.220.108.92", "255.255.255.240", 2, true, true], + ["172.220.108.0", "255.255.255.192", 2, true, false], + ["172.220.108.64", "255.255.255.192", 0, true, false], + ["172.220.104.0", "255.255.254.0", 1, true, false], + ["172.220.106.0", "255.255.254.0", 0, true, false] + ], + "packetQueueSize": 4096, + "bytesPerSecond": 1024 + }, + { + "id": 4, + "type": 1, + "x": 4851.25, + "y": 5190.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:0d", + "ip": "172.220.108.115" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:0e", + "ip": "172.220.108.65" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:0f", + "ip": "172.220.108.97" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:10", + "ip": "10.0.0.16" + } + ], + "tag": null, + "mask": "255.255.255.255", + "arpTable": [], + "routingTable": [ + ["172.220.104.2", "255.255.255.255", 0, true, true], + ["172.220.106.2", "255.255.255.255", 0, true, true], + ["172.220.108.2", "255.255.255.255", 0, true, true], + ["172.220.108.66", "255.255.255.255", 1, true, true], + ["172.220.108.98", "255.255.255.255", 2, true, true], + ["172.220.108.113", "255.255.255.255", 0, true, true], + ["172.220.108.114", "255.255.255.255", 0, true, true], + ["172.220.108.121", "255.255.255.255", 0, true, true], + ["172.220.108.92", "255.255.255.240", 2, true, true], + ["172.220.108.96", "255.255.255.240", 2, true, false], + ["172.220.108.64", "255.255.255.224", 1, true, false], + ["172.220.104.0", "255.255.248.0", 0, true, false] + ], + "packetQueueSize": 4096, + "bytesPerSecond": 1024 + }, + { + "id": 5, + "type": 2, + "x": 4858.926731553027, + "y": 5033.929075311928, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:11" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:12" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:13" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:14" + }, + { + "name": "eth4", + "mac": "00:00:10:00:00:15" + }, + { + "name": "eth5", + "mac": "00:00:10:00:00:16" + }, + { + "name": "eth6", + "mac": "00:00:10:00:00:17" + }, + { + "name": "eth7", + "mac": "00:00:10:00:00:18" + } + ], + "tag": "H", + "forwardingTable": [ + ["00:00:10:00:00:09", 1, true, true], + ["00:00:10:00:00:0d", 2, true, true] + ] + }, + { + "id": 7, + "type": 0, + "x": 4859.25, + "y": 4683.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:21", + "ip": "172.220.104.2" + } + ], + "tag": "A (500)", + "mask": "255.255.255.255", + "arpTable": [], + "runningPrograms": [] + }, + { + "id": 8, + "type": 2, + "x": 4957.25, + "y": 4918.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:22" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:23" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:24" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:25" + }, + { + "name": "eth4", + "mac": "00:00:10:00:00:26" + }, + { + "name": "eth5", + "mac": "00:00:10:00:00:27" + }, + { + "name": "eth6", + "mac": "00:00:10:00:00:28" + }, + { + "name": "eth7", + "mac": "00:00:10:00:00:29" + } + ], + "tag": "G", + "forwardingTable": [["00:00:10:00:00:01", 1, true, true]] + }, + { + "id": 9, + "type": 2, + "x": 4770.25, + "y": 4903.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:2a" + }, + { + "name": "eth1", + "mac": "00:00:10:00:00:2b" + }, + { + "name": "eth2", + "mac": "00:00:10:00:00:2c" + }, + { + "name": "eth3", + "mac": "00:00:10:00:00:2d" + }, + { + "name": "eth4", + "mac": "00:00:10:00:00:2e" + }, + { + "name": "eth5", + "mac": "00:00:10:00:00:2f" + }, + { + "name": "eth6", + "mac": "00:00:10:00:00:30" + }, + { + "name": "eth7", + "mac": "00:00:10:00:00:31" + } + ], + "tag": "F", + "forwardingTable": [["00:00:10:00:00:06", 1, true, true]] + }, + { + "id": 11, + "type": 0, + "x": 5184.25, + "y": 5028.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:3a", + "ip": "172.220.108.2" + } + ], + "tag": "C (30)", + "mask": "255.255.255.255", + "arpTable": [], + "runningPrograms": [] + }, + { + "id": 12, + "type": 0, + "x": 4556.25, + "y": 5020.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:3b", + "ip": "172.220.106.2" + } + ], + "tag": "B (256)", + "mask": "255.255.255.255", + "arpTable": [], + "runningPrograms": [] + }, + { + "id": 14, + "type": 0, + "x": 5048.25, + "y": 5199.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:44", + "ip": "172.220.108.66" + } + ], + "tag": "D (20)", + "mask": "255.255.255.255", + "arpTable": [], + "runningPrograms": [] + }, + { + "id": 15, + "type": 0, + "x": 4651.25, + "y": 5188.484375, + "interfaces": [ + { + "name": "eth0", + "mac": "00:00:10:00:00:45", + "ip": "172.220.108.98" + } + ], + "tag": "E (13)", + "mask": "255.255.255.255", + "arpTable": [], + "runningPrograms": [] + } + ], + "edges": [ + { + "from": { + "id": 8, + "iface": 1 + }, + "to": { + "id": 1, + "iface": 0 + } + }, + { + "from": { + "id": 9, + "iface": 0 + }, + "to": { + "id": 1, + "iface": 1 + } + }, + { + "from": { + "id": 7, + "iface": 0 + }, + "to": { + "id": 1, + "iface": 2 + } + }, + { + "from": { + "id": 5, + "iface": 0 + }, + "to": { + "id": 2, + "iface": 0 + } + }, + { + "from": { + "id": 9, + "iface": 1 + }, + "to": { + "id": 2, + "iface": 1 + } + }, + { + "from": { + "id": 12, + "iface": 0 + }, + "to": { + "id": 2, + "iface": 2 + } + }, + { + "from": { + "id": 5, + "iface": 1 + }, + "to": { + "id": 3, + "iface": 0 + } + }, + { + "from": { + "id": 8, + "iface": 0 + }, + "to": { + "id": 3, + "iface": 1 + } + }, + { + "from": { + "id": 11, + "iface": 0 + }, + "to": { + "id": 3, + "iface": 2 + } + }, + { + "from": { + "id": 5, + "iface": 2 + }, + "to": { + "id": 4, + "iface": 0 + } + }, + { + "from": { + "id": 14, + "iface": 0 + }, + "to": { + "id": 4, + "iface": 1 + } + }, + { + "from": { + "id": 15, + "iface": 0 + }, + "to": { + "id": 4, + "iface": 2 + } + }, + { + "from": { + "id": 5, + "iface": 0 + }, + "to": { + "id": 2, + "iface": 0 + } + }, + { + "from": { + "id": 5, + "iface": 1 + }, + "to": { + "id": 3, + "iface": 0 + } + }, + { + "from": { + "id": 5, + "iface": 2 + }, + "to": { + "id": 4, + "iface": 0 + } + }, + { + "from": { + "id": 7, + "iface": 0 + }, + "to": { + "id": 1, + "iface": 2 + } + }, + { + "from": { + "id": 8, + "iface": 1 + }, + "to": { + "id": 1, + "iface": 0 + } + }, + { + "from": { + "id": 8, + "iface": 0 + }, + "to": { + "id": 3, + "iface": 1 + } + }, + { + "from": { + "id": 9, + "iface": 0 + }, + "to": { + "id": 1, + "iface": 1 + } + }, + { + "from": { + "id": 9, + "iface": 1 + }, + "to": { + "id": 2, + "iface": 1 + } + }, + { + "from": { + "id": 11, + "iface": 0 + }, + "to": { + "id": 3, + "iface": 2 + } + }, + { + "from": { + "id": 12, + "iface": 0 + }, + "to": { + "id": 2, + "iface": 2 + } + }, + { + "from": { + "id": 14, + "iface": 0 + }, + "to": { + "id": 4, + "iface": 1 + } + }, + { + "from": { + "id": 15, + "iface": 0 + }, + "to": { + "id": 4, + "iface": 2 + } + } + ] +}