Skip to content

Commit 579f53d

Browse files
feat: add ARP example (#282)
This PR adds an example with a local network consisting of 3 hosts connected to a single switch. ![image of the network example](https://github.com/user-attachments/assets/ef54f17b-f995-4cbe-8211-bc3a8ce9765b) The three hosts have empty ARP tables and users are supposed to populate them sending ARP requests. Co-authored-by: Pedro Gallino <[email protected]>
1 parent b9dbb4e commit 579f53d

File tree

1 file changed

+171
-0
lines changed

1 file changed

+171
-0
lines changed

examples/localNetwork.json

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
{
2+
"nodes": [
3+
{
4+
"id": 1,
5+
"type": 2,
6+
"x": 4717.25,
7+
"y": 5001.484375,
8+
"interfaces": [
9+
{
10+
"name": "eth0",
11+
"mac": "00:00:10:00:00:01"
12+
},
13+
{
14+
"name": "eth1",
15+
"mac": "00:00:10:00:00:02"
16+
},
17+
{
18+
"name": "eth2",
19+
"mac": "00:00:10:00:00:03"
20+
},
21+
{
22+
"name": "eth3",
23+
"mac": "00:00:10:00:00:04"
24+
},
25+
{
26+
"name": "eth4",
27+
"mac": "00:00:10:00:00:05"
28+
},
29+
{
30+
"name": "eth5",
31+
"mac": "00:00:10:00:00:06"
32+
},
33+
{
34+
"name": "eth6",
35+
"mac": "00:00:10:00:00:07"
36+
},
37+
{
38+
"name": "eth7",
39+
"mac": "00:00:10:00:00:08"
40+
}
41+
],
42+
"tag": "Switch",
43+
"forwardingTable": []
44+
},
45+
{
46+
"id": 2,
47+
"type": 0,
48+
"x": 4738.75,
49+
"y": 4821.96875,
50+
"interfaces": [
51+
{
52+
"name": "eth0",
53+
"mac": "00:00:10:00:00:09",
54+
"ip": "10.0.0.1"
55+
}
56+
],
57+
"tag": "Host A",
58+
"mask": "255.255.255.255",
59+
"arpTable": [
60+
["10.0.0.2", "", false],
61+
["10.0.0.3", "", false],
62+
["10.0.0.4", "", false]
63+
],
64+
"runningPrograms": []
65+
},
66+
{
67+
"id": 3,
68+
"type": 0,
69+
"x": 4887.25,
70+
"y": 5141.484375,
71+
"interfaces": [
72+
{
73+
"name": "eth0",
74+
"mac": "00:00:10:00:00:0a",
75+
"ip": "10.0.0.2"
76+
}
77+
],
78+
"tag": "Host B",
79+
"mask": "255.255.255.255",
80+
"arpTable": [
81+
["10.0.0.1", "", false],
82+
["10.0.0.3", "", false],
83+
["10.0.0.4", "", false]
84+
],
85+
"runningPrograms": []
86+
},
87+
{
88+
"id": 4,
89+
"type": 0,
90+
"x": 4533.25,
91+
"y": 5135.484375,
92+
"interfaces": [
93+
{
94+
"name": "eth0",
95+
"mac": "00:00:10:00:00:0b",
96+
"ip": "10.0.0.3"
97+
}
98+
],
99+
"tag": "Host C",
100+
"mask": "255.255.255.255",
101+
"arpTable": [
102+
["10.0.0.1", "", false],
103+
["10.0.0.2", "", false],
104+
["10.0.0.4", "", false]
105+
],
106+
"runningPrograms": []
107+
}
108+
],
109+
"edges": [
110+
{
111+
"from": {
112+
"id": 3,
113+
"iface": 0
114+
},
115+
"to": {
116+
"id": 1,
117+
"iface": 0
118+
}
119+
},
120+
{
121+
"from": {
122+
"id": 1,
123+
"iface": 1
124+
},
125+
"to": {
126+
"id": 2,
127+
"iface": 0
128+
}
129+
},
130+
{
131+
"from": {
132+
"id": 4,
133+
"iface": 0
134+
},
135+
"to": {
136+
"id": 1,
137+
"iface": 2
138+
}
139+
},
140+
{
141+
"from": {
142+
"id": 1,
143+
"iface": 1
144+
},
145+
"to": {
146+
"id": 2,
147+
"iface": 0
148+
}
149+
},
150+
{
151+
"from": {
152+
"id": 3,
153+
"iface": 0
154+
},
155+
"to": {
156+
"id": 1,
157+
"iface": 0
158+
}
159+
},
160+
{
161+
"from": {
162+
"id": 4,
163+
"iface": 0
164+
},
165+
"to": {
166+
"id": 1,
167+
"iface": 2
168+
}
169+
}
170+
]
171+
}

0 commit comments

Comments
 (0)