Skip to content

Commit 7fc77ad

Browse files
authored
feat: add "Misconfigured Router" example (#272)
This PR adds an example showcasing how TTL can cause packets to be discarded when loops cause too many hops. ![image](https://github.com/user-attachments/assets/25aef214-97a3-4df7-a91f-42b769a085a3)
1 parent 94a9fdd commit 7fc77ad

File tree

1 file changed

+269
-0
lines changed

1 file changed

+269
-0
lines changed

examples/misconfiguredRouter.json

Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
{
2+
"nodes": [
3+
{
4+
"id": 1,
5+
"type": 0,
6+
"x": 4740.25,
7+
"y": 5055.484375,
8+
"interfaces": [
9+
{
10+
"name": "eth0",
11+
"mac": "00:00:10:00:00:01",
12+
"ip": "10.0.0.1"
13+
}
14+
],
15+
"tag": "Echo Sender",
16+
"mask": "255.255.255.255",
17+
"arpTable": [],
18+
"runningPrograms": [
19+
{
20+
"pid": 4,
21+
"name": "Echo server",
22+
"inputs": ["5", "15000"]
23+
}
24+
]
25+
},
26+
{
27+
"id": 2,
28+
"type": 1,
29+
"x": 4854.25,
30+
"y": 4822.484375,
31+
"interfaces": [
32+
{
33+
"name": "eth0",
34+
"mac": "00:00:10:00:00:02",
35+
"ip": "10.0.0.2"
36+
},
37+
{
38+
"name": "eth1",
39+
"mac": "00:00:10:00:00:03",
40+
"ip": "10.0.0.3"
41+
},
42+
{
43+
"name": "eth2",
44+
"mac": "00:00:10:00:00:04",
45+
"ip": "10.0.0.4"
46+
},
47+
{
48+
"name": "eth3",
49+
"mac": "00:00:10:00:00:05",
50+
"ip": "10.0.0.5"
51+
}
52+
],
53+
"tag": null,
54+
"mask": "255.255.255.255",
55+
"arpTable": [],
56+
"routingTable": [
57+
["10.0.0.1", "255.255.255.255", 2, false, false],
58+
["10.0.0.6", "255.255.255.255", 0, false, false],
59+
["10.0.0.10", "255.255.255.255", 1, false, false],
60+
["10.0.0.14", "255.255.255.255", 1, false, false]
61+
],
62+
"packetQueueSize": 4096,
63+
"bytesPerSecond": 1024
64+
},
65+
{
66+
"id": 3,
67+
"type": 1,
68+
"x": 5095.25,
69+
"y": 4824.484375,
70+
"interfaces": [
71+
{
72+
"name": "eth0",
73+
"mac": "00:00:10:00:00:06",
74+
"ip": "10.0.0.6"
75+
},
76+
{
77+
"name": "eth1",
78+
"mac": "00:00:10:00:00:07",
79+
"ip": "10.0.0.7"
80+
},
81+
{
82+
"name": "eth2",
83+
"mac": "00:00:10:00:00:08",
84+
"ip": "10.0.0.8"
85+
},
86+
{
87+
"name": "eth3",
88+
"mac": "00:00:10:00:00:09",
89+
"ip": "10.0.0.9"
90+
}
91+
],
92+
"tag": null,
93+
"mask": "255.255.255.255",
94+
"arpTable": [],
95+
"routingTable": [
96+
["10.0.0.1", "255.255.255.255", 0, false, false],
97+
["10.0.0.2", "255.255.255.255", 0, false, false],
98+
["10.0.0.11", "255.255.255.255", 1, false, false],
99+
["10.0.0.14", "255.255.255.255", 0, true, false]
100+
],
101+
"packetQueueSize": 4096,
102+
"bytesPerSecond": 1024
103+
},
104+
{
105+
"id": 4,
106+
"type": 1,
107+
"x": 4974.25,
108+
"y": 5060.484375,
109+
"interfaces": [
110+
{
111+
"name": "eth0",
112+
"mac": "00:00:10:00:00:0a",
113+
"ip": "10.0.0.10"
114+
},
115+
{
116+
"name": "eth1",
117+
"mac": "00:00:10:00:00:0b",
118+
"ip": "10.0.0.11"
119+
},
120+
{
121+
"name": "eth2",
122+
"mac": "00:00:10:00:00:0c",
123+
"ip": "10.0.0.12"
124+
},
125+
{
126+
"name": "eth3",
127+
"mac": "00:00:10:00:00:0d",
128+
"ip": "10.0.0.13"
129+
}
130+
],
131+
"tag": "Misconfigured Router",
132+
"mask": "255.255.255.255",
133+
"arpTable": [],
134+
"routingTable": [
135+
["10.0.0.1", "255.255.255.255", 0, false, false],
136+
["10.0.0.3", "255.255.255.255", 0, false, false],
137+
["10.0.0.7", "255.255.255.255", 1, false, false],
138+
["10.0.0.14", "255.255.255.255", 1, true, false]
139+
],
140+
"packetQueueSize": 4096,
141+
"bytesPerSecond": 1024
142+
},
143+
{
144+
"id": 5,
145+
"type": 0,
146+
"x": 5183.25,
147+
"y": 5060.484375,
148+
"interfaces": [
149+
{
150+
"name": "eth0",
151+
"mac": "00:00:10:00:00:0e",
152+
"ip": "10.0.0.14"
153+
}
154+
],
155+
"tag": "Echo Target",
156+
"mask": "255.255.255.255",
157+
"arpTable": [],
158+
"runningPrograms": [
159+
{
160+
"pid": 1,
161+
"name": "Serve HTTP requests",
162+
"inputs": []
163+
}
164+
]
165+
}
166+
],
167+
"edges": [
168+
{
169+
"from": {
170+
"id": 2,
171+
"iface": 2
172+
},
173+
"to": {
174+
"id": 1,
175+
"iface": 0
176+
}
177+
},
178+
{
179+
"from": {
180+
"id": 2,
181+
"iface": 2
182+
},
183+
"to": {
184+
"id": 1,
185+
"iface": 0
186+
}
187+
},
188+
{
189+
"from": {
190+
"id": 3,
191+
"iface": 0
192+
},
193+
"to": {
194+
"id": 2,
195+
"iface": 0
196+
}
197+
},
198+
{
199+
"from": {
200+
"id": 4,
201+
"iface": 0
202+
},
203+
"to": {
204+
"id": 2,
205+
"iface": 1
206+
}
207+
},
208+
{
209+
"from": {
210+
"id": 3,
211+
"iface": 0
212+
},
213+
"to": {
214+
"id": 2,
215+
"iface": 0
216+
}
217+
},
218+
{
219+
"from": {
220+
"id": 4,
221+
"iface": 1
222+
},
223+
"to": {
224+
"id": 3,
225+
"iface": 1
226+
}
227+
},
228+
{
229+
"from": {
230+
"id": 4,
231+
"iface": 0
232+
},
233+
"to": {
234+
"id": 2,
235+
"iface": 1
236+
}
237+
},
238+
{
239+
"from": {
240+
"id": 4,
241+
"iface": 1
242+
},
243+
"to": {
244+
"id": 3,
245+
"iface": 1
246+
}
247+
},
248+
{
249+
"from": {
250+
"id": 5,
251+
"iface": 0
252+
},
253+
"to": {
254+
"id": 4,
255+
"iface": 2
256+
}
257+
},
258+
{
259+
"from": {
260+
"id": 5,
261+
"iface": 0
262+
},
263+
"to": {
264+
"id": 4,
265+
"iface": 2
266+
}
267+
}
268+
]
269+
}

0 commit comments

Comments
 (0)